Skip to content

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

Closed
@jpraynaud

Description

@jpraynaud

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions