CS FundamentalsHardGATE CS (PYQ pattern)

A log (immediate modification, redo-undo recovery, checkpoint lists active transactions) reads: <T1 start>, <T1,A,1,2>, <T2 start>, <T2,B,3,4>, <T1 commit>, <T3 start>, <checkpoint {T2,T3}>, <T3,C,5,6>, <T2,D,7,8>, <T4 start>, <T4,E,9,10>, <T2 commit>, <T5 start>, <T5,F,11,12>, <T5 commit>. A crash occurs now. How many update records are REDONE and how many UNDONE during recovery (redo transactions that committed after the checkpoint or are on its list; undo uncommitted ones; ignore T1)?

  1. A. 4 redone, 2 undone
  2. B. 3 redone, 1 undone
  3. C. 3 redone, 2 undone
  4. D. 2 redone, 2 undone

Correct answer: C. 3 redone, 2 undone

T1 committed before the checkpoint, so ignore it. Redo: T2 (updates B and D, 2 records; it is on the checkpoint list and committed) and T5 (1 record) = 3 update records. Undo: T3 (C) and T4 (E), which never committed = 2 records.

More DBMS and SQL questions

Exams that ask this topic