Consider the following set of operations in the log. (start, T0); (write, T0,…

Consider the following set of operations in the log.

(start, T0);

(write, T0, A, 500, 200);

(write, T0, A, 100, 110);

(start, T1);

(commit, T0);

(write, T1, B, 400, 200);

(commit, T1);

(start, T2);

(write, T2, A, 200, 1800);

If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?

Answer: C. Undo: T2 then redo: T0 then Redo: T1Solution : (c) Undo: T2 then redo: T0 then Redo: T1 Undo: using log records it set the data item specified in log record to add value. Redo: using log records…

  1. A.

    Undo: T2 then undo: T0 then Redo: T1

  2. B.

    Redo: T2 then undo: T0 then undo: T1

  3. C.

    Undo: T2 then redo: T0 then Redo: T1

  4. D.

    Redo: T2 then undo: T0 then Redo: T1

Attempted by 71 students.

Show answer & explanation

Correct answer: C

Solution : (c) Undo: T2 then redo: T0 then Redo: T1
Undo: using log records it set the data item specified in log record to add value.
Redo: using log records it sets the data item specified in log records to new value.
In the above log records transections T0 and T1 are commited before the crash. So redo of T0 and T1 will be done and T2 is not commited before the crash so undo (T2 ) will be done.

Explore the full course: Niacl Ao It Specialist

Loading lesson…