You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-process WAL: a permanently unreadable record inside the published range stalls replay, checkpoints and truncation #220
A process catching up with the shared WAL replays [bookmark, SHM WalEndOffset). Since #202, a record it can't read (torn, corrupt, or past the end of the file) ends the catch-up as incomplete, and the bookmark stays put. That avoids skipping or truncating later records (#198). But if the record stays unreadable:
every catch-up (BeginTransaction, group commit, checkpoint) fails for every process whose bookmark is before it;
those processes' checkpoints write nothing, not even their own pages, and they never truncate the WAL;
their _walIndex and the WAL grow without bound, and their reads may miss other processes' commits.
The stall only ends if the record becomes readable again, or if a process whose bookmark is already past the record (e.g. the one that wrote it) checkpoints and truncates the WAL.
Since #202 the stall is visible. A trace warning gives the WAL path and the offset: the first time, then every power of two in a row, and from 16 in a row it says "stalled". Failed checkpoints are counted in MetricsSnapshot.CheckpointsFailedTotal. Nothing recovers from it automatically.
After a stall threshold, let a process that holds the writer lock and has checkpointed everything it can read trigger a recovery: replay the WAL up to the bad record, checkpoint, truncate, start a new generation. This deliberately gives up the records past the bad one, so it needs a decision on whether that's acceptable or whether to stop with an error.
Expose the stall as a metric (e.g. a consecutive-failed-catch-up gauge), not only as a trace warning.
Activity