You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Background TRUNCATE checkpoint blocks live state writes behind old readers #1275
On v3.5.3-beta.1 (8650c58), Store.CheckpointWAL uses wal_checkpoint(TRUNCATE) against state.db and cache.db after hourly maintenance. TRUNCATE waits for old read snapshots while holding SQLite's writer lock. The five-second busy timeout is long enough to delay durable charging goals and model saves.
Local reproduction uses a temporary SQLite database: hold a read transaction, commit a newer config value from another connection, then call CheckpointWAL. TestCheckpointWALDoesNotWaitForReaders fails on the release code because the checkpoint does not return within one second. The reader stays open throughout the test; no hardware or household data is needed.
Use bounded PASSIVE checkpoints for the running service. Preserve synchronous durability and let SQLite reuse WAL pages after readers finish. Test that the checkpoint returns while the reader remains open and that a durable config write still succeeds. Keep offline truncation separate.
Related: #1149, #1246. This proves a lock problem in code, not the sole cause of every observed storage timeout. Fix before promoting this beta line to stable.
This is in the code that v0.132.0-beta.1 is running.
CheckpointWAL uses PRAGMA wal_checkpoint(PASSIVE) with a one-second budget, and truncation stays on the offline VACUUM path. TestCheckpointWALDoesNotWaitForReaders passes: the checkpoint returns while a read transaction is still open, and a durable config write succeeds after it.
Closing. The separate Pi measurement for backup IO is #1246.
Activity
frahlg commentedon Sep 24, 2026
This is in the code that
v0.132.0-beta.1is running.CheckpointWALusesPRAGMA wal_checkpoint(PASSIVE)with a one-second budget, and truncation stays on the offline VACUUM path.TestCheckpointWALDoesNotWaitForReaderspasses: the checkpoint returns while a read transaction is still open, and a durable config write succeeds after it.Closing. The separate Pi measurement for backup IO is #1246.