Questions: Crash Recovery: Undo and Redo Logging

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A transaction uses REDO logging to change page A from value 5 to value 8. The system writes the commit record to the log, but crashes before flushing page A to disk. What happens during recovery?

ARecovery rolls back the transaction because the page was never written to disk before the crash
BRecovery replays the redo log entry forward, writing value 8 to page A to restore the committed state
CRecovery scans backward and restores A to value 5 using the old value stored in the log
DRecovery cannot restore this transaction because the page was not on disk at crash time
Question 2 Multiple Choice

During ARIES recovery after a crash, the analysis pass identifies two transactions: T1 (committed, with some dirty pages flushed to disk) and T2 (uncommitted, also with dirty pages flushed). In the redo pass, which logged changes are replayed?

AOnly T1's changes — T2 was uncommitted and should never be redone
BOnly T2's changes — T2's pages on disk are wrong and must be overwritten first
CBoth T1's and T2's logged changes are redone to restore the exact pre-crash disk state; then the undo pass rolls back T2
DNeither — ARIES always starts recovery from a clean checkpoint and redoes nothing before the checkpoint
Question 3 True / False

Undo logging requires all dirty pages to be written to disk *before* a transaction commits, while redo logging requires that dirty pages *not* be written to disk until after the commit record is in the log.

TTrue
FFalse
Question 4 True / False

In ARIES, the redo pass primarily replays changes from committed transactions, since replaying uncommitted changes would violate transaction isolation.

TTrue
FFalse
Question 5 Short Answer

Why does ARIES redo *all* changes — including those from uncommitted transactions — before undoing anything, rather than simply replaying only committed work and skipping uncommitted changes?

Think about your answer, then reveal below.