pingqiuandClaude Opus 5.5 d6bf9aa03a storage: the WAL flusher reclaims in bounded cycles
A flusher cycle drained the whole dirty map before one fsync and one
checkpoint, so on a slow disk no WAL byte was freed until the cycle ended
and a write waiting for space timed out while reclaim was running. A
cycle now takes the LSN prefix of the synced entries that fits in a
sixteenth of the WAL, cut at a record boundary (a native batch's blocks
stay together), and checkpoints at its last LSN; the run loop starts the
next cycle at once while entries remain. A pass position moves each
cycle past the previous batch, so a checkpoint held below a batch does
not repeat it, and it is trusted only within one recovery lifetime. A
full drain runs cycles until its first frontier is drained.

The durable status's checkpoint persistence gains the reclaim counters
(ReclaimedBytes, BoundedCycles, FlusherPhase, CycleStarted,
CycleExtentBytes, LastExtentWrite), and WALStore.ReclaimProgress reads
them without a store lock for a write's hold path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:22:57 -08:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%