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

cli: ensure that 'snapshot save' is fsync safe and also only writes to the requested file on success #7698

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented Apr 23, 2020

Now we will write to ${user_requested_file}.unverified initially. When that's complete we ensure the bytes have hit the disk (fsync) and have to pass the snapshot verification process on re-read BEFORE we actually rename it to the actual ${user_requested_file}.

This ensures that the snapshot filename only ever either exists and is verified or never exists.

@rboyer rboyer added the type/bug Feature does not function as expected label Apr 23, 2020
@rboyer rboyer requested a review from a team April 23, 2020 22:22
@rboyer rboyer self-assigned this Apr 23, 2020
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rboyer rboyer changed the base branch from fix-snapshot-verify to master April 24, 2020 22:18
@rboyer rboyer force-pushed the fix-snapshot-save branch from 2dcdf2c to a51ca0c Compare April 24, 2020 22:21
@rboyer rboyer merged commit b989967 into master Apr 24, 2020
@rboyer rboyer deleted the fix-snapshot-save branch April 24, 2020 22:34
dnephin pushed a commit that referenced this pull request May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Feature does not function as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants