{
  "slug": "compensation-log-record",
  "term": "Compensation log record",
  "aliases": [
    "CLR"
  ],
  "definition": "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.",
  "note": "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. [aries-beyond]\n\nIn 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. [aries]\n\nBecause 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. [aries-beyond]",
  "related": [
    "write-ahead-log",
    "log-sequence-number",
    "page-lsn",
    "fuzzy-checkpoint",
    "point-in-time-recovery",
    "physiological-logging"
  ],
  "status": "shipping",
  "advantages": [
    {
      "text": "Compensation records carry only redo information, so on average a rollback consumes about half the log space of the forward processing it reverses.",
      "citationIds": [
        "aries"
      ]
    },
    {
      "text": "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.",
      "citationIds": [
        "aries-beyond"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Rollback still writes log records, so a system short of log space must reserve enough space to roll back every running transaction.",
      "citationIds": [
        "aries"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "aries",
      "title": "Mohan, Haderle, Lindsay, Pirahesh and Schwarz. ARIES. ACM TODS 17(1), 1992, sections 3, 5.2 and 6.2-6.3.",
      "url": "https://www.cs.cmu.edu/~15849g/readings/mohan92.pdf",
      "accessed": "2026-10-23"
    },
    {
      "id": "aries-beyond",
      "title": "C. Mohan. Repeating History Beyond ARIES. VLDB 1999, sections 3.2.1-3.2.3.",
      "url": "https://www.vldb.org/conf/1999/P1.pdf",
      "accessed": "2026-10-23"
    },
    {
      "id": "hesela-wal",
      "title": "Hesela: ARIES rollback progress, with a synthetic executable trace",
      "url": "https://hesela.com/analyses/wal-checkpoints-torn-pages/#aries-rollback",
      "accessed": "2026-10-15"
    }
  ],
  "updated": "2026-10-30",
  "provenance": [
    "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."
  ]
}
