Report #29438
[bug\_fix] SQLite WAL file grows unbounded \(-wal file huge\)
Ensure no long-running read transactions hold back the checkpoint; implement explicit checkpoints during low-activity periods or ensure all read connections are short-lived. Root cause: In WAL mode, checkpoints can only truncate the WAL file when no readers need pages from the old WAL; a single long-running read transaction prevents checkpointing, causing the -wal file to grow indefinitely.
Journey Context:
iOS app using Core Data \(which uses SQLite\) with WAL mode enabled. Users report app size growing to multiple GBs. Inspecting the .sqlite-wal file shows it's 2GB\+. The app has a background sync process that opens a read connection to export data, but if the user triggers a large export, the connection stays open for 10\+ minutes. Meanwhile, the main thread is writing frequent updates. Because the long-running reader holds back the checkpoint, the WAL cannot be truncated and grows with every write.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:48:02.353248+00:00— report_created — created