1. Gyanastra
  2. Database Systems
  3. ARIES Analysis Pass, Crash During Undo, Redo-Only Logs and Media Recovery
  4. The three passes and the two log-driven tables
Free lesson, no account needed 4 min read

Database Systems · ARIES Analysis Pass, Crash During Undo, Redo-Only Logs and Media Recovery

The three passes and the two log-driven tables

This chapter assumes you already know ACID, schedules, and basic locking. Here we go inside the recovery manager: how a real system (ARIES, and the Silberschatz textbook variant) rebuilds state after a crash. The exam focus is narrow and mechanical: run the Analysis pass on a log, handle a crash during Undo, understand redo-only (compensation) log records, apply the WAL rules with pageLSN/flushedLSN, and sketch media recovery.


ARIES recovery has three phases, always in this order:

PhaseJobReadsWrites
AnalysisFind the winners (committed), losers (uncommitted at crash), and the dirty page table (DPT)Log from last checkpointTransaction Table (TT), DPT
RedoReplay all history (repeat history), starting from the smallest recLSN in the DPTLogPages (only if pageLSN < LSN)
UndoRoll back losers in reverse LSN order, writing CLRsLogPages + CLRs into log

Two tables are built during Analysis:

  • Transaction Table (TT): one row per active transaction: lastLSN (LSN of its most recent log record) and status (active / committed / aborting).
  • Dirty Page Table (DPT): one row per page that may have unflushed changes: recLSN = LSN of the first log record that dirtied the page since it was last written to disk.

1.1 The log record fields you must know

RecordFieldsMeaning
UpdateLSN, TID, pageID, redo, undo, prevLSNA data change; prevLSN chains a transaction's records
CommitLSN, TID, prevLSNTransaction committed
AbortLSN, TID, prevLSNTransaction begins rollback
EndLSN, TID, prevLSNTransaction fully finished (commit or abort complete)
CLRLSN, TID, pageID, redo, undoNextLSNCompensation Log Record: redo-only undo of one update
CheckpointLSN, TT snapshot, DPT snapshotFuzzy checkpoint (ARIES)

undoNextLSN in a CLR = the prevLSN of the update being undone, i.e. the next record to undo for that transaction. When it is 0/null, the transaction has nothing left to undo.


Pages 1–2 of 2