sqlite-busy-snapshot · shipping · also SQLite stale snapshot upgrade

SQLITE_BUSY_SNAPSHOT

SQLITE_BUSY_SNAPSHOT is SQLite's extended result code for a WAL read transaction that cannot become a writer because its snapshot is obsolete.

Related Observatory article: SQLITE_BUSY_SNAPSHOT on hesela.com

Code 517 belongs to the SQLITE_BUSY (5) primary family; retain the extended result when diagnosing an upgrade failure. [1] In Hesela's constructed schedules, repeating the UPDATE failed even after the other writer had committed, including when it changed a different row; ending the transaction and rereading succeeded. [4] BEGIN IMMEDIATE moves writer acquisition before the reads but may itself fail to acquire the writer position. [2] A new transaction does not invalidate values cached by the application: Hesela's separate retry experiment committed an obsolete bound value successfully after rollback, overwriting the other increment. Rereading and recomputing preserved both increments; a revision predicate rejected the stale write with zero affected rows. [6]

Relations

related
sqlite-wal-end-mark, checkpoint-starvation, serializability

Limitations

Citations

  1. SQLite: result and error codes, SQLITE_BUSY_SNAPSHOT (517) and SQLITE_BUSY (5) (accessed 2026-10-16)
  2. SQLite: DEFERRED, IMMEDIATE and EXCLUSIVE transactions (accessed 2026-10-16)
  3. SQLite: isolation and stale read-to-write upgrades (accessed 2026-10-16)
  4. Hesela: measured six-case SQLite snapshot-upgrade experiment (accessed 2026-10-16)
  5. SQLite WAL checkpoint starvation: success is not completion (accessed 2026-10-16)
  6. Hesela: measured retry-value boundaries, cached binding versus recomputation (accessed 2026-10-16)

JSON: /data/terms/sqlite-busy-snapshot.json