In this problem, you need to simulate the actions taken by the logging and recovery manager discussed in the class. Consider the following log records and buffer actions:
time | LSN | Log | Buffer Actions |
0 |
00 |
update: T1 updates P7 |
P7 brought in to the buffer |
1 |
10 |
update: T1 updates P8 |
P8 brought into the buffer |
2 |
20 |
begin_checkpoint |
|
3 |
30 |
end_checkpoint |
|
4 |
40 |
update: T2 updates P7 |
|
5 |
|
CRASH RESTART |
|
a) For the actions listed above, show Transaction Table (XT) and Dirty Page Table (DPT) after each action. Assume that DPT holds pageID and recLSN, and XT contains transID and lastLSN.
b) Simulate Analysis phase to reconstruct XT and DPT after crash. Identify the point where the Analysis phase starts scanning log records and show XT and DPT after each action.
c) Simulate Redo phase: first identify where the Redo phase starts scanning the log records.Then, for each action identify whether it needs to be redone or not.
d) Simulate Undo phase: identify all actions that need to be undone. In what order will they be undone?