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

Enhance Snapshotter to avoid file deletion on error if already exists #2215

Open
2 tasks
jpraynaud opened this issue Jan 13, 2025 · 0 comments
Open
2 tasks
Labels
refactoring 🛠️ Code refactoring and enhancements

Comments

@jpraynaud
Copy link
Member

Why

We need to support some edge case of the Snapshotter. Some existing files could be deleted or compromised if the snapshotting is asked multiple times on the same file.

What

Implement a mechanism to replace an existing snapshotted file only if the snapshotting is successful.

How

  • Create the snapshot in a temporary file (same name with a .tmp suffix)
  • If the snapshotting is successful rename the temporary file to the final file name otherwise delete the temporary file
@jpraynaud jpraynaud added the refactoring 🛠️ Code refactoring and enhancements label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring 🛠️ Code refactoring and enhancements
Projects
None yet
Development

No branches or pull requests

1 participant