DATABASE SYSTEM Following is the schedule A for transactions T1, T2, and T3: 1)
ID: 3720105 • Letter: D
Question
DATABASE SYSTEM
Following is the schedule A for transactions T1, T2, and T3:
1) Assume that the system crashes at time 8, what should be done to recover the system?
2) Assume a checkpoint is made at time 7, what should be done to the three transactions when the crash happens at time 8?
Note: We assume a transaction will be committed immediately after all the read/write operations of it are done.
Schedule A Time-ransaction T2 T3 read X read(Z) read(X) write read(Z) read(Z) read 9 write read(X) 10 read(Y)Explanation / Answer
Answer)
Schedule A consists of transactions T1, T2, T3.
Here we have assumed that after each of the read/write operations are done transactions are committed immediately.
1) When the system crashes at Time 8, we have no hit any checkpoint but all the operations write and read in the transactions T1, T2, T3 from 1 to 7 are committed. Even though, when the system crashes they are at risk as we have not hit a checkpoint.
So serially, we have to redo the operations in transactions in each of T1, T2, T3. The order will be:
(Redo, T1, read(X)), (Redo, T3, read(Z)), (Redo, T2, read(X)), (Redo, T1, read(Z)), (Redo, T2, read(Z)), (Redo, T3, read(Y)).
Ideally these operations with redo should be performed to recover the system.
2) If we assume that a system checkpoint is made at 7, then if a crash occurs at 8, then it means that at 7 we have stored it into a stable storage medium. So all the transactions done before tome 8 are committed and saved and checkpointed and no further actions are necessary. The next transactions after the crash will execute as is as: read(X) for T3 and read(Y) for T1.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.