Report #17951
[bug\_fix] WAL mode writer starvation \(progressive write latency\)
Increase the wal\_autocheckpoint threshold \(PRAGMA wal\_autocheckpoint=N\) or manually checkpoint during maintenance windows; ensure long-running read transactions are not holding back checkpoints.
Journey Context:
You have a high-read SQLite application \(analytics dashboard\) with occasional writes. Over time, write latency spikes from 10ms to 5 seconds and the WAL file grows to 2GB. You check PRAGMA journal\_mode; it's WAL. You analyze the checkpoint status with PRAGMA wal\_checkpoint\(PRAGMA wal\_checkpoint\); and see a large log and 0 frames checkpointed. You realize that the app has a long-running read transaction \(an uncommitted SELECT\) holding back the checkpoint. Because readers block the checkpoint in WAL mode, and you have a constant stream of new read transactions starting before the old ones finish, the writer is starved. You increase PRAGMA wal\_autocheckpoint from 1000 to 4000 to reduce checkpoint frequency during high load, but more importantly, you refactor the analytics queries to commit immediately or use read-uncommitted if acceptable, ensuring checkpoints can proceed. You also schedule a manual PRAGMA wal\_checkpoint\(TRUNCATE\) during low-traffic windows. Write latency returns to normal because the WAL is prevented from growing unbounded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:50:46.098500+00:00— report_created — created