Hot journal
A hot journal is a SQLite rollback journal that requires replay to recover an interrupted database transaction.
SQLite's rollback-mode checks require an existing journal larger than 512 bytes, a valid nonzero header, no RESERVED lock on the database, and either an existing named super-journal or no super-journal name. The lock check distinguishes recovery work from a current writer's journal. SQLite obtains recovery locks and replays a hot journal before reading the database. [1] A leftover journal whose named super-journal was deleted at group commit is not hot. [2] See the distinction between journal files and recovery decisions. [3] A disposable process-exit observation demonstrates journal retention after commit and rollback of unfinished writes; it is not a power-loss test. [4]
The normal recovery path differs from immutable access. A read-only connection can fail with SQLITE_READONLY_ROLLBACK (776) when rollback is required. [7] Bypassing that path with immutable=1 is not recovery: on two tested builds, constructed quiescent copies exposed uncommitted main-file records that still passed integrity_check. Normal recovery restored the committed records. Journal presence, structural validity and committed-state validity are separate checks. [5]
Relations
- related
- Rollback journal, SQLite super-journal, Crash consistency, Write-ahead log, fsync, Persistence ordering
Advantages
- Lets SQLite identify unfinished rollback-mode work and recover before serving database reads. [1]
Limitations
- A journal filename alone does not establish hotness; its header, lock state and super-journal relationship matter. [1]
- Deleting or separating a hot journal from its database can remove information needed for recovery. [1]
Citations
- SQLite: File Locking And Concurrency In SQLite Version 3
- SQLite: Atomic Commit In SQLite
- Hesela: WAL, checkpoints and torn pages, SQLite commit scope
- Hesela: SQLite journal-lifecycle observations, measured synthetic workload and explicit limits
- Hesela: two-build frozen SQLite crash-copy reader matrix, 400 constructed observations
- SQLite: SQLITE_READONLY_ROLLBACK (776)