Latest backup in any state should not be deleted while partial delete command #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example:
backup100
- newestbackup0
- oldestGiven:
We want to delete oldest one, but backup100 is still creating.
Actions:
ch-backup delete --purge-partial backup0
deleting_backups
andretained_backups
and collect deduplication databackup100
's metadata is loaded withstate=CREATING
, so we think it could be deleted/partially deleted as wellbackup0
is changing state toCREATED
backup100
will be deleted, but it was created right nowFix
Skip newest backup while purge-partial flag in delete command.
Btw, lock on backup and delete commands does not help there because metadata loading works outside of lock scope.
Also newest backup could be useful for future's backups because of deduplication.