Repository navigation
fix(exl3): make scoped frontier discard restart-safe - #3715
Merged
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TL;DR
Make scoped EXL3 capture-frontier discard restart-safe. A committed frontier is now atomically renamed to a recognized tombstone before any payload deletion, and interrupted tombstones are pruned on restart.
1. The problem
The old
discard_throughrecursively deleted the committed directory in place. A crash could leave a committed-looking directory withoutmanifest.json; scoped resume then failed while_prune_incompleteignored that state.stateDiagram-v2 state "Committed frontier" as Committed state "Partial committed directory" as Partial state "Resume blocked" as Blocked Committed --> Partial: "shutil.rmtree starts" Partial --> Blocked: "manifest missing on restart" style Partial fill:#fee,stroke:#b22 style Blocked fill:#fee,stroke:#b222. The new flow
stateDiagram-v2 state "Committed frontier" as Committed state "Discard tombstone" as Tombstone state "Deleted" as Deleted [*] --> Committed Committed --> Tombstone: "os.rename and fsync root" Tombstone --> Deleted: "shutil.rmtree" Tombstone --> Tombstone: "process stops" Tombstone --> Deleted: "_prune_incomplete on restart"The new flow and before/after table are committed in
docs/exl3-capture-frontiers.md.3. Failure contract
.discard-*.tmptombstone remains_prune_incompletefinishes deleting the tombstoneEXL3CaptureFrontierErrorTests
test_scoped_discard_uses_restart_safe_tombstoneValidation