CS FundamentalsHardGATE CS · PSU (ISRO/BARC)

The system crashes after the last record of this log (immediate database modification; <Ti, X> denotes an update with old and new values; the checkpoint lists the transactions active at that moment and all dirty pages were flushed when it was taken): <T2 start>, <T4 start>, <T2, A>, <T3 start>, <T1 start>, <T4, B>, <T1, C>, <T3, D>, <T5 start>, <T3 commit>, <T5, E>, <checkpoint {T1, T2, T4, T5}>, <T5, F>, <T4, G>, <T1, H>, <T5 commit>, <T2, I>, <T1 commit> Which transactions must be undone and which redone?

  1. A. Undo {T1, T5}; redo {T2, T4}
  2. B. Undo {T2, T4}; redo {T1, T3, T5}
  3. C. Undo {T2, T4}; redo {T1, T5}
  4. D. Undo {T2, T4}; redo {T1}

Correct answer: C. Undo {T2, T4}; redo {T1, T5}

Transactions that committed before the checkpoint (T3) are already on disk and need nothing. Those that committed after it (T1, T5) are redone, whether they started before or after it. Those with no commit record (T2, T4) are undone, including any that were active at the checkpoint.

More DBMS and SQL questions

Exams that ask this topic