CS FundamentalsVery hardGATE CS (PYQ pattern)

A system uses immediate database modification with a log. Log (oldest first): <T1 start>, <T1,A,10,20>, <T2 start>, <T2,B,5,6>, <T1 commit>, <checkpoint {T2}>, <T3 start>, <T3,C,1,2>, <T2,B,6,9>, <T2 commit>, <T4 start>, <T4,D,7,8>, <T3 commit>. A crash occurs after the last record. Which transactions are redone and which undone by the standard recovery procedure (redo committed transactions that are on the checkpoint list or started after it; undo the uncommitted ones)?

  1. A. Redo T1, T2, T3; undo T4
  2. B. Redo T2, T3; undo T4
  3. C. Redo T3 only; undo T2 and T4
  4. D. Redo T2, T3, T4; undo nobody

Correct answer: B. Redo T2, T3; undo T4

T1 committed before the checkpoint (its effects are already on disk), so it is ignored. T2 was active at the checkpoint and committed: redo. T3 started after it and committed: redo. T4 never committed: undo.

More DBMS and SQL questions

Exams that ask this topic