You are on page 1of 7

The following is a sequence of log records (deferred DB modification) written by two transactions T and U:

<START T>; <T,A,10>; <START U>; <U,B,20>; <T,C,30>; <U,D,40>; <COMMIT U> <T,E,50>; <COMMIT T>;

Describe the action of the recovery manager, including changes to both disk and log, if there is a crash and the last log record to appear on disk is: a. <START U> b. <COMMIT U> c. <T,E,50> d. <COMMIT T>

<START T>; <T,A,10>; <START U>; CRASH!!! Since no commit record <U,B,20>; <COMMIT T> and <T,C,30>; <COMMIT U> appears in the log, no redo action is <U,D,40>; taken. <COMMIT U> No change in the disk. <T,E,50>; <COMMIT T>;

<START T>; <T,A,10>; <START U>; <U,B,20>; <T,C,30>; <U,D,40>; <COMMIT U> CRASH!!! <T,E,50>; <COMMIT T>;

redo(U) is performed since both <START U> and <COMMIT U> exists in the log No redo for T since no <COMMIT T> appears New values in the disk after redo(U): B=20 D=40

<START T>; <T,A,10>; <START U>; <U,B,20>; <T,C,30>; <U,D,40>; <COMMIT U> CRASH!!! <T,E,50>; <COMMIT T>;

redo(U) is performed since both <START U> and <COMMIT U> exists in the log No redo for T since no <COMMIT T> appears New values in the disk after redo(U): B=20 D=40

<START T>; <T,A,10>; <START U>; <U,B,20>; <T,C,30>; <U,D,40>; <COMMIT U> <T,E,50>; <COMMIT T>;

Two redo operations, redo(T) and redo(U) are performed since both START and COMMIT exists in each of the transactions New values in the disk: A=10 B=20 C=30 D=40 E=50 CRASH!!!

You might also like