pingqiuandClaude Opus 5.5 40b7614faf storage: v3 store core, W modes C/A, R<W* recovery and the drop fence (format bump row 5)
DESIGN r15 sections 6.1 to 6.6 (f2122d66), PLAN row 5 (b870a569). Dark:
the only constructor is createWALStoreV3ForTest; the v2 path is unchanged.

- recovery_v3.go (pure): scan start max(BaseCursor, retainedTail) (G2),
  floor F, contiguous prefix R and its end E over the row-4 trusted chain,
  the R < W* decision (wal_corrupt when serving; ErrBaseIncomplete, plus
  ErrInstallSuffixDamaged and WALIntegrity when damaged, while installing),
  and the exact fence ranges over [E, floor+WALSize), split at the wrap.
- walstore_v3.go: open selects a slot, scans (row 4), decides, replays the
  records <= R last-writer-wins, fences and fsyncs the exact ranges through
  the leaf, publishes retainedHead = E, restores the writer to E, and only
  then admits. Sync mode C publishes the previous batch's W, so one fsync
  covers WAL and slot; mode A fsyncs the WAL, then publishes W = H.
  refreshW, and SetWMode under the group-commit leader role, publish
  W = Wack. An append pwrite error latches the store-global fault.
- Tests: I1 across reopen in both modes; the C window (newest batch
  truncated in C, wal_corrupt in A; second-newest wal_corrupt in both);
  refresh and SetWMode(A) close it; a torn unsynced tail is never corrupt;
  the G1 resurrection schedule (and its no-fence counterexample); a
  byte-exact fence at an unaligned E; the append write-error latch.
- invariants.md: INV-WAL-V3-W-001 and INV-WAL-V3-FENCE-001 (STUB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:10:55 -08:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%