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:
| Phase | Job | Reads | Writes |
|---|---|---|---|
| Analysis | Find the winners (committed), losers (uncommitted at crash), and the dirty page table (DPT) | Log from last checkpoint | Transaction Table (TT), DPT |
| Redo | Replay all history (repeat history), starting from the smallest recLSN in the DPT | Log | Pages (only if pageLSN < LSN) |
| Undo | Roll back losers in reverse LSN order, writing CLRs | Log | Pages + 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) andstatus(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
| Record | Fields | Meaning |
|---|---|---|
Update | LSN, TID, pageID, redo, undo, prevLSN | A data change; prevLSN chains a transaction's records |
Commit | LSN, TID, prevLSN | Transaction committed |
Abort | LSN, TID, prevLSN | Transaction begins rollback |
End | LSN, TID, prevLSN | Transaction fully finished (commit or abort complete) |
CLR | LSN, TID, pageID, redo, undoNextLSN | Compensation Log Record: redo-only undo of one update |
Checkpoint | LSN, TT snapshot, DPT snapshot | Fuzzy 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.