CS FundamentalsVery hardGATE CS

The system crashes after the last record of this log (immediate modification; <Ti, X, old, new>; at the checkpoint all dirty pages were flushed and T2, T3 were active): <T1 start> <T1, A, 10, 20> <T2 start> <T2, B, 5, 15> <T1 commit> <T3 start> <T3, A, 20, 30> <checkpoint {T2, T3}> <T2, C, 1, 2> <T2 commit> <T3, B, 15, 25> After undo/redo recovery, what are A, B and C?

  1. A. A = 30, B = 25, C = 2
  2. B. A = 20, B = 5, C = 1
  3. C. A = 20, B = 15, C = 2
  4. D. A = 10, B = 15, C = 2

Correct answer: C. A = 20, B = 15, C = 2

T2 committed after the checkpoint, so it is redone (B = 15, C = 2); T3 never committed, so its writes are undone in reverse: B back to 15, A back to 20. T1 committed before the checkpoint and needs nothing, so A is not rolled back to 10.

More DBMS and SQL questions

Exams that ask this topic