Closed
Description
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