sqlite-wal-end-mark · shipping · also WAL reader end mark

SQLite WAL end mark

A SQLite WAL end mark is the committed WAL boundary that determines which page versions a read transaction may observe.

Related Observatory article: Read on hesela.com

The transaction's snapshot does not advance when another connection commits. Ending the transaction and starting another permits a newer view. [1] Distinguish this logical snapshot boundary from the shared WAL-index read-mark slots and locks used by checkpoint coordination. They are related mechanisms, not interchangeable counters. [2] Complete-row comparisons check the retained generation and the newer state after release. [4]

A source connection's retained read view can also bound an online backup. Hesela measured a completed generation-1 copy after generation 2 had committed; releasing the old snapshot allowed the current generation in the tested schedule. Backup completion and integrity did not establish freshness. [5]

Space accounting also follows the read view. In a synthetic 512-byte-page control, an old transaction saw 96 rows and 300 dbstat pages while the current one saw 24 rows and 77 pages against identical main/WAL captures. dbstat excludes freelist, pointer-map and lock-byte pages. Aggregate mode emits one row per B-tree: count(*) then counts trees, while sum(pageno) counts their pages. In normal mode pageno is a page identifier, not an additive page count. A monitoring transaction should be short because its own retained read view can delay checkpoint progress. [6] [8] [1]

WAL file length does not identify its current generation. In the 4,096-byte control, reuse left a 412,032-byte WAL with 100 physical frame slots but only one valid committed frame. Header salts and cumulative checksums delimit valid frames; the reader end mark then bounds visibility within that generation. [6] [9]

Relations

related
Write-ahead log, Database checkpoint, Checkpoint starvation, SQLITE_BUSY_SNAPSHOT, Backup verification, SQLite immutable connection, SQLite query_only, SQLite data_version, SQLite snapshot handle

Limitations

  • An open connection does not itself identify the lifetime or contents of an active read snapshot. [1]

Citations

  1. SQLite: Isolation, WAL snapshots and transaction lifetime (accessed 2026-10-14)
  2. SQLite: WAL-mode File Format, WAL-index header and read marks (accessed 2026-10-14)
  3. Hesela: measured SQLite WAL-reader observations and limits (accessed 2026-10-14)
  4. Hesela: SQLite backup source-snapshot observations (accessed 2026-10-17)
  5. Hesela: SQLite space accounting, 32 synthetic observations and method (accessed 2026-11-03)
  6. Hesela: reproducible SQLite space-accounting code, tests and raw captures (accessed 2026-11-03)
  7. SQLite: DBSTAT populations and aggregate mode (accessed 2026-11-03)
  8. SQLite file format: WAL reset, salts and frame validity (accessed 2026-11-03)

Further reading

  1. SQLite WAL checkpoint starvation: success is not completion (accessed 2026-10-14)
Sources & caveats
  • Four serialized synthetic configurations, eight states each; not independent field samples. Explicit secure_delete=ON aligns recorded 3.45.1 and 3.53.1 semantic/format rows. File lengths do not measure physical writes. [6]
  • Reproduction code, all 64 primary main/WAL captures and the documented initial default mismatch are retained together. [7]

JSON: /data/terms/sqlite-wal-end-mark.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. SQLite WAL end mark. Hesela. 2026-11-28. https://hesela.dev/terms/sqlite-wal-end-mark/