pingqiuandClaude Opus 5.5 98d7fd8181 storage: a failed fsync is sticky for the open walstore
The WAL and the extent share one file, and on Linux a failed fsync may
already have dropped dirty pages of that file, so a later successful fsync
proves nothing about them (the fsyncgate pattern). The first failure of
any fsync on the file (WAL batch, flusher extent, checkpoint, recovered
bounds, direct frontier, frontier seed) now latches ErrFsyncFailed,
wrapped in a SubstrateIO RecoveryFailure (io_error). Until the store is
reopened: Sync refuses without another fsync, writes, batch writes,
ApplyEntry and WriteExtentDirect refuse, the flusher advances no
checkpoint, Recover and the frontier seed refuse, and Close writes no
final superblock. A reopen recovers from what is on disk.

Tests that asserted a same-instance retry after an injected fsync failure
now assert the sticky refusal and a reopen: the generation sync tests, the
checkpoint and direct-frontier metadata tests, the frontier seed test, the
recovered-bounds test and the two restore seed tests (whose real EINVAL
fsync now requires a reopen before the restore succeeds).

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