checkpoint-starvation · shipping · also SQLite WAL checkpoint starvation

Checkpoint starvation

Checkpoint starvation is sustained inability to finish or reset a database log checkpoint because the required progress conditions keep being obstructed.

Related Observatory article: Read on hesela.com

In SQLite WAL, retained reader snapshots can constrain backfill and recycling while later writes continue. [1] A two-case observation separates a pinned transaction from an idle open connection; it is not a production failure-rate study. [4] A PASSIVE result can report busy=0 with fewer checkpointed frames than current log frames. [2]

A completed or cancelled backup can leave a source read that the caller opened earlier. In 84 synthetic runs on two builds, that read retained WAL history after backup cleanup; a reader-only control did the same. BEGIN alone did not pin a read between steps. Per-schema transaction state distinguishes it from BEGIN plus SELECT. [5] [7]

journal_size_limit=0 did not cap the live WAL in those fixtures: required frames remained until the owned read ended. The setting controls retained file size around reset, not an unconditional quota. File length is not physical I/O or a timing measurement. [6] [8]

Ending starvation is not history erasure. In a separate SQLite 3.45.1 deletion fixture with core secure_delete ON, a pinned reader caused a busy TRUNCATE result. After reader release, FULL and RESTART completed but retained the deleted token in the WAL. Successful TRUNCATE shortened that logical file to zero; an earlier backup still returned the original row. These are stages of one controlled lifecycle, not independent trials or a media-sanitization test. [10]

RESTART prepares the log for reuse by the next writer; TRUNCATE additionally shortens it on success. Historical WAL bytes need not survive reuse indefinitely. Do not delete a live WAL manually. [9] [1]

close_v2 can retain a reader. [13]

Relations

related
Database checkpoint, Write-ahead log, SQLite WAL end mark, SQLite Online Backup API, SQLite transaction state, SQLite snapshot handle

Limitations

  • A large WAL file alone does not identify starvation; file length can remain high after progress. [1]
  • Checkpoint counters include earlier backfill, not just new work per call. [9]
  • WAL frame validity requires matching salts and cumulative checksums; stored residue alone does not establish replay eligibility. [12]
  • An unfinalized statement can delay destruction without pinning a snapshot: unstepped, drained and reset SELECT controls allowed TRUNCATE in the recorded fixtures. [14]

Citations

  1. SQLite: Write-Ahead Logging, sections 2, 6 and 11 (accessed 2026-10-14)
  2. SQLite: PRAGMA wal_checkpoint, three-column result (accessed 2026-10-14)
  3. Hesela: measured SQLite WAL-reader observations and limits (accessed 2026-10-14)
  4. Hesela: two-build source-read retention experiment, derived summary and receipt hashes (accessed 2026-10-21)
  5. SQLite: PRAGMA journal_size_limit, retained file size and reset (accessed 2026-10-21)
  6. SQLite: per-schema transaction state (accessed 2026-10-21)
  7. Hesela: source-read ownership after backup cleanup, method and limitations (accessed 2026-10-21)
  8. SQLite: checkpoint modes, completion and truncation (accessed 2026-10-30)
  9. Hesela: generated SQLite deletion observations, two retained runs and explicit limits (accessed 2026-10-30)
  10. SQLite Database File Format: WAL frame validity and reset (sections 4.1 and 4.4) (accessed 2026-10-30)
  11. SQLite C API: closing a connection and deferred destruction (accessed 2026-11-09)
  12. Hesela: twelve native close-lifecycle schedules on each of two SQLite builds (accessed 2026-11-09)
  13. Hesela: separate native C verification of the existing close-lifecycle schedules (accessed 2026-11-09)

Further reading

  1. SQLite WAL checkpoint starvation: success is not completion (accessed 2026-10-14)
  2. Hesela: standalone SQLite deletion evidence, code and 42 raw files (accessed 2026-10-30)
  3. Hesela: SQLite close-lifecycle sources, raw observations and replay code (accessed 2026-11-09)
  4. Hesela: both close-lifecycle observers, retained results and source snapshots (accessed 2026-11-09)
Sources & caveats
  • The deletion fixture does not run a subsequent writer/reset; residue after reuse was not measured. [10]
  • Twelve native C-API schedules per build on SQLite 3.45.1 and 3.54.1; an active SELECT prevented TRUNCATE completion after close_v2 returned OK. No crash, performance or failure-rate measurement. [14]
  • A separate C observer matched all 48 executions (12 schedules, two recorded engine binaries, two harness compiler modes). Same host and binaries, with the earlier packet visible; not external peer review, field samples or power-loss evidence. [16]

JSON: /data/terms/checkpoint-starvation.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Checkpoint starvation. Hesela. 2026-11-28. https://hesela.dev/terms/checkpoint-starvation/