Repository navigation
fix(journal): flush replayed writes before moving the head and recheck the lease - #20
Merged
Merged
Conversation
…k the lease Replay advanced the journal head without a flush, so after power loss with a volatile device cache the head could persist ahead of unflushed replayed writes and a resume would skip them. Replay now syncs the device before each head write. Replay also checks the recovery lease before each head write, and a lease renewal re-reads the slot after 100ms like a takeover, so a recoverer that stalled inside a transaction cannot write its cached header over a journal another node has reset or initialized since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Oct 24, 2026
…ims are confirmed (#22) Taking a lock is still a read then a write, so two nodes that claim a free inode lock at the same moment can both hold it. The test does that for 20 files per run and loses one node's write in about 1 file in 150: 4 of 30 runs failed on main and 2 of 30 on #13 before #18 and #20 landed, so #18 is not the cause. CI runs integration with -short; full runs still include it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #15, from its review: two gaps in resumable journal replay.
New test:
TestRecoverCheckedLeavesHeaderAloneAfterLosingLease.Tests on .66 with ext4 images:
-race: pass.-short: 73 pass.TestJournalCrashDuringWritefails 5 of 5 runs on main before fix(journal): give each node registry slot its own journal region #15 (c312a28), on main now (a1957da) and on this branch alike, so the failure is not new. Mount-time replay waits about 15 s for the root directory lock still held by the crashed process (the lock-staleness rule), longer than the test's 10 s mount timeout. CI skips this test under-short. The fix would let a node free locks its own previous incarnation held once it takes back that slot, which is a lock-package change.🤖 Generated with Claude Code