Skip to main content

Module checkpointer

Module checkpointer 

Source
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§

Checkpointer 🔒

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 🔒