ARIES Recovery: Log, Checkpoints, and Transaction Management in Databases

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

What is Write-Ahead Logging (WAL)?

Before a dirty page is written to disk, the log record describing the change must be flushed first.

Intuition: "Write the receipt before doing the action."

Example: If X changes from 10 → 20, the log entry must be written before the page with X is written.

Why it matters: WAL is the core rule that guarantees atomicity + durability. Exam loves this.

2
New cards

What is the purpose of the log in ARIES?

A sequential record of all updates, including before- and after-images.

Intuition: A journal of everything the DB does.

Example: Log entry: "T1 updated Page 7: old=5, new=9."

Why it matters: Used for redo (repeat history) and undo (reverse uncommitted work).

3
New cards

What is a LSN (Log Sequence Number)?

A unique ID for each log entry; strictly increasing.

Intuition: Like page numbers for the log.

Example: LSNs 100, 101, 102 mark the order of operations.

Why it matters: Used to track redo position and recovery order.

4
New cards

What is a checkpoint?

A fuzzy snapshot storing the active transaction table + dirty page table at a point in time.

Intuition: A "bookmark" to speed up recovery.

Example: Checkpoint lists T1 active, T2 active, Dirty pages P3 at LSN 80.

Why it matters: ARIES recovery starts at the last checkpoint, not from the beginning.

5
New cards

What is the Dirty Page Table (DPT)?

Lists dirty pages and the earliest LSN that dirtied them (RecLSN).

Intuition: "Which pages were changed and when did we first dirty them?"

Example: Page 7 has RecLSN=120 means first dirtied at log entry 120.

Why it matters: Determines how far back REDO must start.

6
New cards

What is the Transaction Table in ARIES?

Tracks all active transactions and their lastLSN.

Intuition: A list of unfinished business at crash time.

Example: T3 lastLSN=140 means its latest action is at 140.

Why it matters: Tells recovery which transactions are "losers" and need undo.

7
New cards

What are the 3 phases of ARIES recovery?

Analysis, Redo, Undo.

Intuition: "Figure out what happened → repeat history → roll back losers."

Example: Crash → read checkpoint → redo all logged updates → undo T3.

Why it matters: The structure of ARIES is a guaranteed exam question.

8
New cards

What happens in the Analysis phase?

Reconstruct DPT and transaction table by scanning forward from last checkpoint.

Intuition: Who was active? What pages were dirty?

Example: Analysis sees T1 hasn't committed → marks it as loser.

Why it matters: Sets up redo and undo phases.

9
New cards

What happens in the Redo phase?

Repeats history: reapplies all logged updates starting from the earliest RecLSN.

Intuition: Pretend the crash never happened — redo everything.

Example: If log says "write X=10 at LSN 90," redo writes X=10 again.

Why it matters: Exam tests REDO skipping rules.

10
New cards

When can REDO skip a log record?

Skip if BOTH: Page is not dirty, OR Page's RecLSN > LSN of the log record.

Intuition: "If the page doesn't need you, ignore it."

Example: If page's RecLSN=120, and log record is LSN=110, skip it.

Why it matters: This is an extremely common multiple-choice question.

11
New cards

Why is REDO idempotent?

Reapplying the same update multiple times yields the same result.

Intuition: "Doing it twice doesn't break anything."

Example: Setting X=10 again after writing X=10.

Why it matters: Allows system to redo forward safely; no double updates.

12
New cards

What happens in the Undo phase?

Rollback all loser transactions using UndoNextLSN pointers.

Intuition: Walk backward through each transaction's log and undo each action.

Example: Undo writes X back to old value and logs a CLR.

Why it matters: Key part of atomicity; exam tests UndoNextLSN.

13
New cards

What is a loser transaction?

A transaction active at the time of crash (meaning it didn't commit).

Intuition: "Unfinished, uncommitted → must undo."

Example: If T2 didn't write a COMMIT log, it's a loser.

Why it matters: Losers = transactions undone in recovery.

14
New cards

What is a winner transaction?

A transaction that has written a COMMIT record before the crash.

Intuition: "Already done — redo their writes if needed."

Example: T1 committed at LSN=200 → winner.

Why it matters: Winners are NOT undone, only redone.

15
New cards

What is a Compensation Log Record (CLR)?

A special log record that records an undo operation.

Intuition: A "receipt" proving an undo was performed.

Example: CLR: Undo T3's write to page 5.

Why it matters: If crash happens during recovery, CLRs ensure undo doesn't run twice

16
New cards

What is UndoNextLSN?

A pointer inside the log that indicates where to continue undoing.

Intuition: A linked-list pointer for rollback steps.

Example: UndoNextLSN=120 → next undo is log entry 120.

Why it matters: Exam questions often give you a log and ask the undo order.

17
New cards

Why does ARIES redo changes from the log instead of from the buffer?

Because the buffer may have lost dirty pages during crash, but the log is durable.

Intuition: The log is the single source of truth.

Example: If page wasn't flushed, redo ensures its updates are applied.

Why it matters: Key reasoning for WAL + redo.

18
New cards

Why can ARIES handle multiple crashes during recovery?

CLRs ensure undo operations are themselves logged safely.

Intuition: Recovery itself is recoverable.

Example: Crash during undo → redo CLRs → continue undo.

Why it matters: Another popular conceptual exam question.

19
New cards

What is fuzzy checkpointing?

A checkpoint that does NOT require stopping or flushing pages.

Intuition: "Take a snapshot without pausing the database."

Example: Checkpoint logs lists of active TXNs and dirty pages, but pages remain dirty.

Why it matters: Exam will contrast fuzzy vs force checkpoint.

20
New cards

Why must commit records be forced to disk?

To guarantee durability: once commit is written, transaction is considered permanent.

Intuition: "Your deposit receipt must be printed before the bank says 'Done!'."

Example: T1 commit → flush commit log record → safe.

Why it matters: If commit isn't forced, system may lose committed updates.

Explore top flashcards