Questions: Write-Ahead Logging and Database Recovery

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A database crashes immediately after a transaction commits and its log record is flushed to disk, but before the data pages are written to disk. What happens during recovery?

AThe committed data is lost — it never reached disk
BThe REDO phase replays the log to apply the committed changes to data pages
CThe UNDO phase rolls back the transaction since data pages were never updated
DNothing is needed — the commit acknowledgment guarantees data was written to disk
Question 2 Multiple Choice

Which statement best describes the 'write-ahead' rule in WAL?

AData pages must be written to disk before the transaction can commit
BLog records must be flushed to stable storage before the corresponding data pages are modified on disk
CThe client must be acknowledged before any log records are written
DA checkpoint must be recorded before any data modification is allowed
Question 3 True / False

A WAL checkpoint serves as a backup point: if a crash occurs after the checkpoint, the database can restore to the exact state captured at checkpoint time.

TTrue
FFalse
Question 4 True / False

After WAL-based crash recovery completes, every transaction that had committed before the crash will have all its changes reflected in the data files.

TTrue
FFalse
Question 5 Short Answer

Why must WAL crash recovery include an UNDO phase, and what problem would occur if it were skipped?

Think about your answer, then reveal below.