pingqiuandClaude Opus 5.5 9473fc5f3a storage: clamp the v3 flusher checkpoint to the acknowledged W (row 5f)
A v3 checkpoint never exceeds W (DESIGN 2.2 item 5, 9.1 predicate 2:
CheckpointLSN <= mapCoveredCheckpoint <= W). The flusher may flush dirty
entries no Sync has acknowledged, so persistCheckpointV3 now clamps its
candidate to the acknowledged W; the unsynced records stay retained in the
WAL until a Sync covers them. (Raised by claude05's CkptUnsynced model
note; Claude01 ruled the v3 rule is CheckpointLSN <= W.)

The map candidate is prepared first, outside every lock, for the clamped
checkpoint. The publication is a W publisher, so it runs under the v3
leader role (syncMu -> s.mu -> descMu), like Sync, refreshW and SetWMode,
and cannot straddle a recovery; if a recovery lowered the acknowledged W
below the prepared candidate meanwhile, the cycle publishes nothing.

Control: an acknowledged LSN 1 and an unsynced dirty LSN 2 through a
flusher cycle (stub map candidate) give checkpoint = covered = 1, the tail
unchanged, and both LBAs readable after a crash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 03:42:42 -08:00
Languages
Go 84.6%
Rust 7.8%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%