Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Closed
2 tasks
jpraynaud opened this issue Jan 13, 2025 · 0 comments · Fixed by #2257
Closed
2 tasks

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

jpraynaud opened this issue Jan 13, 2025 · 0 comments · Fixed by #2257
Assignees
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
@jpraynaud jpraynaud assigned dlachaume and sfauvel and unassigned dlachaume Jan 22, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
refactoring 🛠️ Code refactoring and enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants