Try
↑ ↓ move↵ openesc close
In this lesson · topic 5 of 7
  1. 1. Half of a transfer
  2. 2. Prepare, then commit
  3. 3. Crash a coordinator and count the locks
  4. 4. The coordinator that does not come back
  5. 5. Which timeout is safe
  6. 6. Three phases, and why teams skip them
  7. 7. Votes, blocking and timeouts

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

All participants are prepared and none has heard a decision. They ask each other. What do they learn?

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms