The GATE Grind

GATE 2015 CS (CS2) – Question 39

Databases · Transactions and Concurrency Control · 2 marks · Multiple choice

A simple-checkpoint recovery log contains:

(start,T4); (write,T4,y,2,3); (start,T1); (commit,T4);
(write,T1,z,5,7); (checkpoint);
(start,T2); (write,T2,x,1,9); (commit,T2);
(start,T3); (write,T3,z,7,2);

A crash occurs now. Choose the undo and redo lists.

  1. Undo T3,T1; redo T2
  2. Undo T3,T1; redo T2,T4
  3. Undo none; redo T2,T4,T3,T1
  4. Undo T3,T1,T4; redo T2

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) Undo T3,T1; redo T2

Explanation

T1 and T3 lack commit records, so their effects must be undone, including T1 even though it began before the checkpoint. T2 committed after the checkpoint and must be redone. T4 committed before the checkpoint, so its effects are already covered by the checkpoint. Thus A.

More Transactions and Concurrency Control questions

All Transactions and Concurrency Control questions →