In this lesson · topic 5 of 7
Topic 5
Which timeout is safe
5 min read
Before the vote and after it
A timeout means different things at different moments.
Before a participant votes, it may abort on its own. No one can have committed without its yes. The coordinator may also abort if a vote is missing, for the same reason.
After a participant votes yes, a timeout proves nothing. The coordinator may have decided commit and told someone else.
Aborting alone breaks atomicity
The lab can make a prepared participant abort after 5 ticksmeasured. The coordinator had logged commit, so each of these aborts disagrees with it. In the run, 38 transactionsmeasured ended with split outcomes. With the safe policy, which waits, it was 0measured.
Locks are freed sooner. The price is that the two commits are no longer tied together, which is the problem the protocol was built to solve.
Asking the others
A better move is to ask the other participants. If the coordinator got the decision to one of them before it crashed, that participant can tell the rest. In the lab this cut the transactions turned away from 128measured to 81measured. It did not remove the block. When no participant heard, all of them are in doubt, and the longest hold was still 30 ticksmeasured.
Predict first