6Mk 10Mk
5Mk
4. How are log sequence numbers used by ARIES to reduce the amount of REDO work needed for recovery? Illustrate with an example using the information shown in following figure, [start_transaction , T1, A] [read_item, T1, D] [write_item, T1, D,20,25] [commit , T1] [checkpoint] [start_transaction, T2] [read_item, T2, B] [write_item, T2,B,12,18] [start_transaction, T4] [read_item, T4, D] [write_item, T4,D,25,15] [start_transaction, T3] [write_item,T3,C,30,40] [read_item,T4, A] [write_item,T4,A,30,20] [commit , T4] [read_item, T2,D] [write_item,T2,D,15,25] System crash Log Record LSN
LAST_LSN
TRAN_ID
PAGE_ID D -
B D C A D STATUS
T1
COMMIT
Dirty Page Table PAGE_ID D After Analysis Transaction Table TRANS_ID T1 T2 T3 T4 Dirty Page Table PAGE_ID D B C A
LSN 1
LAST LSN 2 10 7 9
LSN 1 5 7 8
Redo: Find minimum LSN from dirty page table, i.e. M=1 corresponds to page D. So, start REDO from LSN 1 of log table. REDO_SET={1,5,6,7,8,10} Undo: Start scanning backwards from end of log. Transactions to be undone T2, T3 UNDO_SET = {10,7,5}