Skip to content

fix(mount): make -skip-recovery name the slot whose journal it discards - #43

Merged
mattmattox merged 1 commit into
mainfrom
fix-skip-recovery-own-slot
Oct 25, 2026
Merged

mattmattox merged 1 commit into
mainfrom
fix-skip-recovery-own-slot

Conversation

@mattmattox

@mattmattox mattmattox commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Data-loss guard from the shepherd's review of #34.

-skip-recovery discarded the journal of whichever slot the mount took. While a peer held this host's damaged slot, a -skip-recovery mount could take another crashed node's slot and overwrite its unreplayed journal. An earlier version of this PR checked that the slot was this host's. That failed on a retry, because the failed mount had already stamped the slot with this host's name.

-skip-recovery=N now discards a journal only when the mount takes slot N, the slot named in the recovery error. A mount that takes any other slot logs ignoring -skip-recovery=N and replays that slot's journal as usual. The recovery error names the flag with its slot number.

Breaking change: a bare -skip-recovery is now a usage error. This is noted in CHANGELOG, README, API-CONFIG, OPERATIONS and TROUBLESHOOTING. cmd/mount changes by +11/−5.

Tests: TestSkipRecoveryDiscardsOnlyNamedSlot covers another host's crashed slot, a wrong N, and a retry after the slot was stamped. It fails on main and passes here, along with the other journal-slot tests. golangci-lint passes. In the integration -short run, 90 tests passed and TestSurvivorReleasesCrashedNodeLocks failed once on timing (node B wrote before it logged the takeover). It then passed 3× on this build; it doesn't touch this code path.

🤖 Generated with Claude Code

-skip-recovery discarded the journal of whichever slot the mount took.
While a peer held this host's damaged slot, the mount could take
another crashed node's slot and overwrite that node's unreplayed
journal. Checking that the slot was this host's did not help: a failed
mount stamps the slot with this host's name first, so a retry passed.

-skip-recovery=N now discards a journal only when the mount takes slot
N, the slot named in the recovery error. A mount that takes any other
slot logs that it ignores the flag and replays that slot's journal. A
bare -skip-recovery is a usage error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox force-pushed the fix-skip-recovery-own-slot branch from a360725 to a26e442 Compare October 24, 2026 23:54
@mattmattox mattmattox changed the title fix(mount): apply -skip-recovery only to this host's own slot fix(mount): make -skip-recovery name the slot whose journal it discards Oct 24, 2026
@mattmattox
mattmattox merged commit 51bffbe into main Oct 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant