Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest backup in any state should not be deleted while partial delete command #49

Closed
wants to merge 2 commits into from

Conversation

MedvedewEM
Copy link
Contributor

Example:

backup100 CREATING
backup99 CREATED
backup98 FAILED
...
backup0 CREATED

backup100 - newest
backup0 - oldest

Given:
We want to delete oldest one, but backup100 is still creating.

Actions:

  • we run ch-backup delete --purge-partial backup0
  • we compute deleting_backups and retained_backups and collect deduplication data
  • backup100's metadata is loaded with state=CREATING, so we think it could be deleted/partially deleted as well
  • while we downloading other backups metadata (it could take a while) backup0 is changing state to CREATED
  • delete command finishes metadata downloading
  • backup100 will be deleted, but it was created right now

Fix
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.

@MedvedewEM
Copy link
Contributor Author

#50

@MedvedewEM MedvedewEM closed this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant