Expand description
Background WAL checkpoints for a file-backed [FileStore] (Phase 5a-3,
SPEC_AGENT_PANE_BOUNDED_LIVE_WINDOW_MIGRATION_2026_09_23.md §6.3.7 item 5).
With SQLite’s automatic checkpoint, whichever write crosses the WAL
threshold (1000 pages) runs the checkpoint itself — and every transcript
append rewrites a whole 64 KB part, so that happens about every 60 lines,
holding that line’s event (which since 5a-3 waits for its write) for the
checkpoint’s duration: the p99 tail. Store connections therefore run with
wal_autocheckpoint=0, and this thread checkpoints instead, on its own
connection: in WAL mode a PASSIVE checkpoint runs alongside writers and
readers, taking no lock they wait on.
PASSIVE copies what it can and never blocks; pages a reader still needs
stay in the WAL until a later pass. The srv’s 30-minute TRUNCATE loop
(bootstrap::spawn_wal_checkpoint_loop) still resets the file.
Structs§
Constants§
- POLL 🔒
- How often the WAL size is looked at.
- WAL_
THRESHOLD_ 🔒BYTES - Checkpoint once the WAL file is at least this large (SQLite’s default automatic threshold is 1000 pages of 4 KB).
Functions§
- wal_
path 🔒