Course: Data Science and Database Technologies
Source: Reliability Management / Recovery Management, local path 18-Recovery.pdf, 53 PDF pages. The source displays the Data Base and Data Mining Group (DBMG) mark; no individual lecturer name is printed on the slides. Lecture number 18 follows the supplied filename identifier.

Lecture summary

The Reliability Manager interacts directly with the Buffer Manager to guarantee the atomicity and durability ACID properties. Because active data pages live in volatile main memory, crashes can leave partial uncommitted updates on disk or wipe committed updates that had not yet been flushed. The Reliability Manager handles begin (B, usually implicit), commit (C), and rollback/abort (A), prepares recovery metadata via checkpoints (CK(L)) and dumps, and records all interleaved transaction and system activity sequentially in a log file stored on stable memory (approximated through redundancy and robust write protocols). Data modification records (I(T, O, AS), D(T, O, BS), U(T, O, BS, AS)) store full Before States (BS) and After States (AS), making both UNDO and REDO idempotent so restarting recovery after a mid-recovery crash remains safe.

To prevent crashes from leaving the database unrecoverable, the DBMS enforces two log-ordering rules: Write-Ahead Log (WAL) writes BS to stable memory before modified database pages reach disk (enabling UNDO), while Commit Precedence writes AS to stable memory before commit (enabling REDO). Practically, the log is written synchronously (force) before database disk writes and on commit, whereas abort records (A(T)) can be written asynchronously because the commit record C(T) acts as the borderline (any transaction lacking C(T) in the log is undone upon failure anyway). Depending on whether database disk writes occur strictly before commit, strictly after commit, or both (mixed), recovery requires UNDO-only, REDO-only, or both UNDO and REDO—with real systems adopting the mixed approach alongside log optimizations such as compact format, parallelism, and group commit.

When a failure halts the system under the fail-stop model, recovery depends on what survived: system failures lose main memory while keeping disk data and the log, triggering a warm restart, whereas media failures damage the database on disk while keeping the log in stable storage, triggering a cold restart. A warm restart scans backwards to the last checkpoint CK(L), initializes UNDO = L and REDO = {}, scans forward to build the final UNDO and REDO lists (keeping aborted A(T) transactions in UNDO), executes UNDO backwards to the oldest B(T) in UNDO, and executes REDO forwards from the oldest B(T) in REDO. A cold restart restores the damaged portion from the last dump, replays the log forward from the dump record, and runs a warm restart—or uses the 2-pass alternative to detect committed transactions first and redo only their actions.

Learning route

  1. Revisit prerequisites: Transactions and ACID Properties and Buffer Manager and Page Replacement.
  2. Read Reliability Manager Log Records Undo Redo and Checkpoints for Reliability Manager responsibilities, stable memory, log record types, UNDO/REDO idempotency, checkpoints, and dumps.
  3. Read Write-Ahead Logging Commit Precedence and Disk-Write Protocols for WAL, Commit Precedence, synchronous vs. asynchronous log writes, and the three disk-write protocols.
  4. Read Warm Restart Problem Solving and Cold Restart for system vs. media failures, fail-stop recovery, the 4-step Warm Restart algorithm, full worked log traces, and Cold Restart (standard 3-step and 2-pass alternative).

Source map

PDF pagesMaterial
1–5Title, DBMS architecture placement (Reliability Manager ↔ Buffer Manager), transactional commands, and stable memory abstraction
6–10Log file structure, transaction delimiters (B, C, A), data modification records (I, D, U with BS/AS), system records (Dump, CK(L)), and log timeline example
11–12UNDO and REDO action tables and the idempotency property (UNDO(UNDO(action)) = UNDO(action))
13–16Checkpoints (3-step execution, post-checkpoint guarantees vs. unknown active pages) and Dumps (complete/incremental offline backups)
17–22Log-writing rules: WAL (BS before disk), Commit Precedence (AS before commit), synchronous vs. asynchronous log writes, and C(T) as borderline
23–26Three DB-vs-commit disk-write protocols (before commit, after commit, mixed) and log-writing optimizations (compact format, parallelism, group commit)
27–30Recovery Management overview, System failure vs. Media failure, fail-stop state diagram, and Warm vs. Cold restart
31–43Warm Restart: 5 transaction categories (t_C, t_F), checkpoint role, and 4-step Warm Restart algorithm (checkpoint scan, list building, backward UNDO, forward REDO)
44–50Worked Warm Restart log snippet example (T1–T5), step-by-step UNDO/REDO table, UNDO/REDO action traces, and timeline
51–53Cold Restart (3-step dump + log replay + warm restart) and 2-pass committed-only alternative

Worked examples from the source

1. Log timeline with interleaved records (Slide 10)

──|────|────────|──────|─────|─────────|──────────|─────────|──────────|──► time
DUMP  B(T1)         B(T2)   CK      U(T2,O2,   I(T1,O1,   C(T1)   D(T2,O3,
                                    BS2,AS2)   AS1)               BS3)   ▲
                                                                   Top of the log

Records from T1 and T2 are interleaved chronologically, with the newest entry at the top of the log.

2. The three DB-vs-commit protocols (Slides 23–25)

Protocol (Slides)When W(x), W(y) hit diskRecovery requiredKey consequence
Before commit (23)All writes before C(T)UNDO only (no REDO)Commits stall on scattered disk writes
After commit (24)All writes after C(T)REDO only (no UNDO)Dirty pages fill RAM for long transactions
Mixed (25)Both before and after C(T)UNDO + REDOUsed in real systems for best runtime speed

3. Five transaction categories at a crash (Slides 32–41)

With last checkpoint and failure :

  • T1 (begins and finishes before ): forced at checkpoint → no action.
  • T2 (begins before , commits after ) and T4 (begins and commits between and ): committed → REDO (starting from B(T2) for T2, even before ).
  • T3 (begins before , active at ) and T5 (begins after , active at ): uncommitted → UNDO (all the way back to B(T3)).

4. Warm Restart trace on the source log snippet (Slides 44–50)

For B(T1) B(T2) U(T2,O1,B1,A1) I(T1,O2,A2) B(T3) C(T1) B(T4) U(T3,O2,B3,A3) U(T4,O3,B4,A4) CK(T2,T3,T4) C(T4) B(T5) U(T3,O3,B5,A5) U(T5,O4,B6,A6) D(T3,O3,B7) A(T3) C(T5) I(T2,O6,A8) failure:

  • At CK(T2, T3, T4): UNDO = {T2, T3, T4}, REDO = { } (T1 finished before CK and is ignored).
  • Forward scan after CK: C(T4) moves T4 to REDO; B(T5) adds T5 to UNDO; A(T3) keeps T3 in UNDO; C(T5) moves T5 to REDO → final UNDO = {T2, T3}, REDO = {T4, T5}.
  • UNDO backwards (to B(T2)): DELETE O6 → INSERT O3 = B7 → O3 = B5 → O2 = B3 → O1 = B1.
  • REDO forwards (from B(T4)): O3 = A4 → O4 = A6.

See Warm Restart Problem Solving and Cold Restart for the full line-by-line trace table plus an added practice trace from the study session (explicitly labeled as added outside the PDF).

Revision prompts

  • Explain why UNDO and REDO are idempotent in this logging model, and what fails if a log instead records relative deltas.
  • Distinguish what a checkpoint guarantees on disk for concluded transactions versus active transactions (L), and explain why UNDO may still scan before CK(L).
  • Compare WAL and Commit Precedence, and explain why Commit (C(T)) must be forced synchronously while Abort (A(T)) can be written asynchronously.
  • Compare the three DB-vs-commit disk-write protocols on UNDO/REDO requirements and runtime tradeoffs.
  • Trace a Warm Restart log snippet from scratch without notes, including an aborted transaction A(T) after CK(L) and a transaction in REDO that started before CK(L).
  • Contrast System failure vs. Media failure, and compare the 3-step Cold Restart against its 2-pass alternative.

Source and scope

Data Base and Data Mining Group (DBMG), Reliability Management / Recovery Management, local path 18-Recovery.pdf, 53 PDF pages. This note paraphrases and organizes the source material; added study examples in the linked concept notes are labeled explicitly.