Repository navigation
fix(journal): refuse to mount over a damaged journal slot - #34
Merged
Merged
Conversation
ScanAndRecover treated any journal it could not open as "nothing to recover", so mount started a new journal over a slot whose header had a bad checksum, bad magic or bad geometry, and dropped any committed transactions in it. Only an all-zero header, which format writes, now means never initialized. Anything else fails the mount with the slot number; -skip-recovery still mounts and starts a new journal. ReplayJournal used invalid magic as its "no journal" signal; it now uses the same all-zero check, so a peer reports a damaged slot instead of skipping it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mount with -skip-recovery on the same host before it reboots. A slot whose owner rebooted or never returns stays taken; nothing frees it yet. Also fail the test helper on a bad offset instead of damaging offset 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
mattmattox
added a commit
that referenced
this pull request
Oct 24, 2026
* docs: sync operator guides with current flags and behavior OPERATIONS, DEPLOYMENT and TROUBLESHOOTING still used the old goclusterfs binary name, a -format without -mount, a .snapshots directory and snapshot API that never existed, lost+found, a -fuse-debug flag, a mount -version flag, pprof, and read-only mounts. They now match the code at e31fa92: format v2 and per-node journals, -skip-recovery and damaged journal slots (#34), fsck exit codes and -repair (#32), -attr-timeout (#24), lock renewal and takeover (#13, #23), xattr snapshots and clones (#16), and the real log lines. OPERATIONS.md gains a Security Model section: trust in the shared device, single-user mounts with no permission checks, lock limits, and unauthenticated broadcast unless -broadcast-secret is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: lock waits have no time limit ErrLockTimeout only fires when the request context is cancelled; lock.DefaultTimeout is never used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: make damaged-journal recovery safe and fix review findings -skip-recovery discards the journal of whichever slot the mount takes, which is not the damaged slot once a peer holds its recovery lease. The steps now say when to run it and how to check the slot, and only use it for a damaged header, not for I/O or replay errors. Also quote the real legacy-layout and superblock errors, cover a v2 device with a wiped superblock, state that there is no HTTP API, and correct peer-announce, replay, unicast fallback and cache lag claims. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- 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.
From the #10 review. A journal slot whose header had a bad checksum, bad magic or bad geometry counted as "nothing to recover", so mount started a new journal over it and dropped any committed transactions. Now only an all-zero header, which format writes, counts as fresh. Anything else fails the mount:
Journal recovery for slot 0 failed: journal at offset …: failed to read journal superblock: journal superblock checksum mismatch (mount with -skip-recovery to discard this journal)-skip-recoverystill mounts and starts a new journal. Thecmd/mountchange is that one log line.Behavior change for peers:
ReplayJournalused to skip a slot with bad magic. It now returns an error, so the registry logs it and retries after the recovery lease instead of skipping the slot.Tests (the new ones fail on main): journal unit tests,
TestMountRefusesDamagedJournal, unit-race, integration-short(84 pass, 16 skip), 30 s ofFuzzJournalSuperblock/FuzzJournalScan, and golangci-lint v2.🤖 Generated with Claude Code