Documentation

Docs / Reference

ADR 0049 - SQLite WAL journal mode

Status: Accepted (delegated review, 2026-11-04)

Context

ADR 0043 gave SQLite read connections a 3 s busy timeout and recorded a known gap: the store uses rollback journaling, so a commit (or an earlier page-cache spill) of graphvein index holds an EXCLUSIVE lock that blocks every reader. A full rewrite of this repository held it for about 5 s at commit (T016g fact 3), longer than the bound, so graphvein serve answers 500 store_error or freshness unknown then. ADR 0043 also recorded two writer defects: sqlite.Open set foreign_keys and busy_timeout with ExecContext on one pooled connection only, and passed the raw path to the driver, which cuts it at the first ? on macOS and Linux.

Task T016h verified the semantics. The driver is modernc.org/sqlite v1.60.1, SQLite 3.53.4 transpiled to Go (not cgo, not WASM; ADR 0002 does not apply). Sources: the SQLite documentation (www.sqlite.org: wal.html, pragma.html, uri.html, lockingv3.html, c3ref/wal_checkpoint_v2.html, c3ref/open.html, c3ref/wal_autocheckpoint.html, releaselog/3_53_4.html), the SQLite 3.53.4 source and the driver source, and experiments against the driver in scratch (the T016h task record (internal), the investigation).

Options considered

Decision

synchronous stays FULL (D-2). The read bound of ADR 0043 (3 s) is unchanged and now covers only the W3 waits and rollback-mode fallbacks.

This closes ADR 0043's large-rewrite known gap and its two writer review notes (per-connection pragmas, ? in paths).

Consequences

Known gaps

Review notes (2026-11-04)

Delegated review, 2026-11-04. Records: the T016h task records (internal).

Report a problem with this pageSource: docs/adr/0049-sqlite-wal-journal-mode.md