Report #43633
[bug\_fix] WAL checkpoint starvation causing disk bloat
Ensure no long-running read transactions block checkpoint by setting query timeouts, use PRAGMA wal\_autocheckpoint to reduce threshold, or manually issue PRAGMA wal\_checkpoint\(TRUNCATE\) during maintenance windows.
Journey Context:
Deployed an SQLite-based analytics tool that generated large reports. The -wal file grew to 60GB while the actual database was only 2GB, eventually filling the disk. Investigated with PRAGMA wal\_checkpoint\(STATUS\) and found the checkpoint was blocked by a read transaction that had been open for 45 minutes \(the report generator\). SQLite cannot checkpoint past the oldest active read transaction. The fix involved setting a 5-minute query timeout on the reporting queries to ensure transactions close, enabling PRAGMA wal\_autocheckpoint=1000 to force more frequent checkpoints, and scheduling a manual checkpoint after large batch inserts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:42:48.066265+00:00— report_created — created