Compensation log record
A compensation log record is a redo-only log record that describes an action taken to undo an update and points to where rollback should continue.
Compensation records are redo-only: recovery may redo a compensation but never undoes it. PrevLSN follows the transaction log chain, while the UndoNxtLSN field of a compensation record points to the predecessor of the update being undone. A rollback interrupted by a crash, or a nested rollback, therefore resumes there and bypasses work already compensated. [2]
In the original method each update record is matched with at most 1 compensation record, regardless of how many times restart recovery runs, which bounds logging during rollback. A durable compensation record can survive while its page update does not; the redo pass, one of 3 restart passes, restores that update before rollback continues. If the record was volatile and is lost, that progress is not preserved. [1]
Because the record describes the action actually performed, an undo need not touch the page of the original update: a B+-tree key inserted on page 10 may be removed from page 20 after another transaction moved it. These are original repeating-history semantics, not a claim that every write-ahead log uses compensation records. [2]
Relations
- related
- Write-ahead log, Log sequence number, Page LSN, Fuzzy checkpoint, Point-in-time recovery, Physiological logging
Advantages
- Compensation records carry only redo information, so on average a rollback consumes about half the log space of the forward processing it reverses. [1]
- A dummy compensation record closing a nested top action lets a later rollback skip a completed structure change, such as a page split, while that change stays durable. [2]
Limitations
- Rollback still writes log records, so a system short of log space must reserve enough space to roll back every running transaction. [1]
Citations
- Mohan, Haderle, Lindsay, Pirahesh and Schwarz. ARIES. ACM TODS 17(1), 1992, sections 3, 5.2 and 6.2-6.3.
- C. Mohan. Repeating History Beyond ARIES. VLDB 1999, sections 3.2.1-3.2.3.
Further reading
Sources & caveats
- aries re-read 2026-10-23 for the one-record-per-update bound, the restart passes, the half-space rollback estimate and log-space reservation.
- aries-beyond re-read 2026-10-23, sections 3.2.1-3.2.3, for UndoNxtLSN chaining, logical undo and nested top actions.
- A companion analysis with a synthetic rollback trace is listed but not used in prose.