-- Apr 4 In-Class Exercise Thread
⟨START T1⟩, I1(A), R1(A,t1), t1:=t1⋅2, ⟨START T2⟩,
⟨T1,A4⟩ W1(A,t1), ⟨START T3⟩, I2(B), R2(B,t2), t2:=t2⋅2,
⟨T2,B,12⟩, W2(B,t), ⟨T3,C,1⟩, W3(C,5), O1(A), ⟨COMMIT T1⟩, O2(B).
Adding a checkpoint right after R1(A, t1) would only include T1, so ⟨START CKPT(T1)⟩.
We can only end a checkpoint once we get a commit.
If the system crashes, then we have to undo everything not included in the checkpoint, so that would include all operations in T2 or T3.
The only operations that affect disk will be Output operations. Everything else is only changed in memory. The O1(A) is part of T1, so that has been checkpointed, but O2(B) is not checkpointed, which means the disk write will get undone.
⟨START T1⟩, I1(A), R1(A,t1), t1:=t1⋅2, ⟨START T2⟩,
⟨T1,A4⟩ W1(A,t1), ⟨START T3⟩, I2(B), R2(B,t2), t2:=t2⋅2,
⟨T2,B,12⟩, W2(B,t), ⟨T3,C,1⟩, W3(C,5), O1(A), ⟨COMMIT T1⟩, O2(B).
Adding a checkpoint right after R1(A, t1) would only include T1, so ⟨START CKPT(T1)⟩.
We can only end a checkpoint once we get a commit.
If the system crashes, then we have to undo everything not included in the checkpoint, so that would include all operations in T2 or T3.
The only operations that affect disk will be Output operations. Everything else is only changed in memory. The O1(A) is part of T1, so that has been checkpointed, but O2(B) is not checkpointed, which means the disk write will get undone.