{
  "slug": "sqlite-wal-end-mark",
  "term": "SQLite WAL end mark",
  "aliases": [
    "WAL reader end mark"
  ],
  "definition": "A SQLite WAL end mark is the committed WAL boundary that determines which page versions a read transaction may observe.",
  "note": "The transaction's snapshot does not advance when another connection commits. Ending the transaction and starting another permits a newer view. [sqlite-isolation] 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. [sqlite-wal-format] Complete-row comparisons check the retained generation and the newer state after release. [hesela-observation]\n\nA 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. [hesela-backup-view]\n\nSpace 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. [accounting-data] [dbstat] [sqlite-isolation]\n\nWAL 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. [accounting-data] [wal-reset]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "An open connection does not itself identify the lifetime or contents of an active read snapshot.",
      "citationIds": [
        "sqlite-isolation"
      ]
    }
  ],
  "related": [
    "write-ahead-log",
    "database-checkpoint",
    "checkpoint-starvation",
    "sqlite-busy-snapshot",
    "backup-verification",
    "sqlite-immutable",
    "sqlite-query-only",
    "sqlite-data-version",
    "sqlite-snapshot-handle"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "sqlite-isolation",
      "title": "SQLite: Isolation, WAL snapshots and transaction lifetime",
      "url": "https://www.sqlite.org/isolation.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "sqlite-wal-format",
      "title": "SQLite: WAL-mode File Format, WAL-index header and read marks",
      "url": "https://www.sqlite.org/walformat.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "hesela-readers",
      "title": "SQLite WAL checkpoint starvation: success is not completion",
      "url": "https://hesela.com/analyses/sqlite-wal-checkpoint-starvation/",
      "accessed": "2026-10-14"
    },
    {
      "id": "hesela-observation",
      "title": "Hesela: measured SQLite WAL-reader observations and limits",
      "url": "https://hesela.dev/research/sqlite-wal-readers.json",
      "accessed": "2026-10-14"
    },
    {
      "id": "hesela-backup-view",
      "title": "Hesela: SQLite backup source-snapshot observations",
      "url": "https://hesela.dev/research/sqlite-backup-source-snapshot.json",
      "accessed": "2026-10-17"
    },
    {
      "id": "accounting-data",
      "title": "Hesela: SQLite space accounting, 32 synthetic observations and method",
      "url": "https://hesela.dev/research/sqlite-space-accounting/summary.json",
      "accessed": "2026-11-03"
    },
    {
      "id": "accounting-package",
      "title": "Hesela: reproducible SQLite space-accounting code, tests and raw captures",
      "url": "https://hesela.dev/research/sqlite-space-accounting/package.zip",
      "accessed": "2026-11-03"
    },
    {
      "id": "dbstat",
      "title": "SQLite: DBSTAT populations and aggregate mode",
      "url": "https://www.sqlite.org/dbstat.html",
      "accessed": "2026-11-03"
    },
    {
      "id": "wal-reset",
      "title": "SQLite file format: WAL reset, salts and frame validity",
      "url": "https://sqlite.org/fileformat2.html#walreset",
      "accessed": "2026-11-03"
    }
  ],
  "updated": "2026-11-28",
  "provenance": [
    "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. [accounting-data]",
    "Reproduction code, all 64 primary main/WAL captures and the documented initial default mismatch are retained together. [accounting-package]"
  ]
}
