-
Notifications
You must be signed in to change notification settings - Fork 224
Fix empty committed snapshots: Restore behaviour of writing to temporary uncommitted file and renaming #7029
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
Merged
eddyashton
merged 12 commits into
microsoft:main
from
eddyashton:restore_snapshot_rename
Jun 3, 2025
Merged
Fix empty committed snapshots: Restore behaviour of writing to temporary uncommitted file and renaming #7029
eddyashton
merged 12 commits into
microsoft:main
from
eddyashton:restore_snapshot_rename
Jun 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxtropets
approved these changes
Jun 2, 2025
maxtropets
reviewed
Jun 2, 2025
achamayou
reviewed
Jun 2, 2025
achamayou
approved these changes
Jun 2, 2025
achamayou
reviewed
Jun 2, 2025
Co-authored-by: Amaury Chamayou <[email protected]>
eddyashton
added a commit
to eddyashton/CCF
that referenced
this pull request
Jun 3, 2025
…ary uncommitted file and renaming (microsoft#7029) Co-authored-by: Amaury Chamayou <[email protected]> (cherry picked from commit d950184) # Conflicts: # CHANGELOG.md # python/src/ccf/ledger.py # tests/e2e_operations.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
5.x-todo
PRs which should be backported to 5.x
auto-backport
Automatically backport this PR to LTS branch
backported
This PR was successfully backported to LTS branch
run-long-test
Run Long Test job
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#5273 introduced an unnoticed break from our documented behaviour - snapshots were written directly to a
.committed
file (in multiplefwrite()
calls), rather than being renamed from an intermediate file. This means any consumer of.committed
snapshots could read invalid files (incomplete, perhaps entirely empty, depending how they interleaved with thefwrite()
calls and implicit flushing), and could not distinguish these from correct files without attempting to parse the file.This PR modifies an existing e2e test to reproduce this behaviour - aggressively reading snapshots directly from the node's output directory, as they are being written. It also includes the fix of restoring the intermediate file - CCF will again (as documented) write to a temporary file
snapshot_X-Y
file, and then rename it tosnapshot_X-Y.committed
file once it is complete and ready for reading.