Merge lp://staging/~charlesk/keeper/metadata-management into lp://staging/keeper/devel
- metadata-management
- Merge into devel
Status: | Merged |
---|---|
Merged at revision: | 104 |
Proposed branch: | lp://staging/~charlesk/keeper/metadata-management |
Merge into: | lp://staging/keeper/devel |
Prerequisite: | lp://staging/~charlesk/keeper/connection-helper |
Diff against target: |
737 lines (+228/-198) 13 files modified
debian/rules (+1/-0) src/service/keeper-task.cpp (+1/-1) src/service/keeper-task.h (+0/-3) src/service/keeper-user.cpp (+11/-4) src/service/keeper.cpp (+46/-16) src/service/keeper.h (+6/-3) src/service/task-manager.cpp (+69/-80) src/service/task-manager.h (+6/-4) tests/integration/helpers/test-helpers-base.cpp (+30/-38) tests/integration/helpers/test-helpers-base.h (+1/-1) tests/unit/tar/keeper-tar-create-test.cpp (+0/-1) tests/unit/tar/tar-creator-test.cpp (+0/-1) tests/utils/file-utils.cpp (+57/-46) |
To merge this branch: | bzr merge lp://staging/~charlesk/keeper/metadata-management |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
unity-api-1-bot | continuous-integration | Needs Fixing | |
Xavi Garcia (community) | Approve | ||
Review via email:
|
Commit message
Avoid out-of-date data cache in TaskManager
Description of the change
TaskManager makes its own copy of backup/restore choices. These are initialized once at startup and then never updated again. When we start updating restore's choices after a successful backup, this will fall out-of-sync with the choices in the Keeper class.
The thing is, the only place that cache is used is TaskManager:
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Xavi Garcia (xavi-garcia-mena) wrote : | # |
Looks good to me, one question, though:
with the previous implementation it was possible to have both Backup and Restore tasks queued and executed.
I'm not sure we want this, anyway. And this implementation would fail in such case as it starts the backup tasks first and immediately after that it would start the restore tasks.
The result of having uuids for both restore and backup would be that keeper would print out the following warning: qWarning() << "keeper is already active"; and will not run the restore tasks.
The problem is that restore tasks would include backup tasks as well.
I think we could just avoid even starting the restore tasks because we can know in advance that such thing is going to happen if we got also backup tasks.
I've added an inline comment to the code.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:142
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charles Kerr (charlesk) wrote : | # |
> with the previous implementation it was possible to have both Backup and Restore tasks queued and executed. I'm not sure we want this, anyway
We don't, which is com.canonical.
> In here if we receive uuids for both backup and restore tasks the vector "tasks" will call start_restore with the backup tasks plus the restore tasks.
That's not correct, the vector `tasks' is cleared right after calling start_backup().
> I think we could just avoid even starting the restore tasks because we can know in advance that such thing is going to happen if we got also backup tasks.
Sounds good to me. Fixed r138
> Also... if we don't allow backup and restore tasks to be executed at the same time we could print out a warning to inform the user.
That's a good point.
Error message added r138
Error message includes check for "keeper is already active" r139-140
Error message returned over DBus r141-142
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:144
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:147
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:147
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PASSED: Continuous integration, rev:151
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Xavi Garcia (xavi-garcia-mena) wrote : | # |
I didn't see the clear for the tasks list, sorry for that.
Although we have 2 separated methods for startbackup and startRestore the user could call any of them passing uuids that are not backups or restores. So, for example, the user calls GetBackupChoices and GetRestoreChoices, combines both and calls StartBackup.
It's an extreme case, but it makes possible to start a backup with restore uuids.
Now with your last change is not possible to call start_backup and start_restore right after as you added an if...else statement.
Anyway, it looks perfect to me. Thanks!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PASSED: Continuous integration, rev:152
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
- 153. By Charles Kerr
-
in debian/rules, add env variable to have ctest dump failed tests' output
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:153
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:137 /jenkins. canonical. com/unity- api-1/job/ lp-keeper- ci/46/ /jenkins. canonical. com/unity- api-1/job/ build/578/ console /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/584 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 410/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 410/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= yakkety/ 410 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= yakkety/ 410/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-keeper- ci/46/rebuild
https:/