Labs 9 - Recovery algorithm. ============================ Exercises ========= (1) With the starting values A=100, B=200, C=300, write the log file for the following schedule. What happens during the recovery according to the recovery algorithm? Specify the resulting compensation log records. T1: T2: T3: start start start read(C) read(B) read(A) A:=A-20 C:=C+40 write(C) B:=B-80 write(A) write(B) commit ------------CRASH--------------- (2) [Ex. 16.18 from textbook] Consider the following log. What happens during the recovery according to the recovery algorithm? Mark the start and end points of the redo and undo phases. Specify the transactions in the undo list. --------CRASH--------- (3) With the starting values A=3, B=100, write the log file for the following schedule. What happens during the recovery according to the recovery algorithm when the system crashes (a) after commit of T3, (b) after write(B) of T1? Mark the start and end points of the redo and undo phases. Specify the resulting compensation log records. T1: T2: T3: start read(A) A:=A+1 start read(B) B:=B+10 write(A) commit start read(A) read(B) A:=A+B write(A) commit ------------CHECKPOINT---------- read(A) A:=A+B write(B) commit