The coordinator crashes after every participant voted yes. What state are the participants in, and what can they do?
Sketch your own answer first, then compare it with the one below.
A strong answer
They are in doubt. Each one promised to commit and is holding locks, but none knows the decision. If it commits, another participant may have been told to abort. If it aborts, the coordinator may have decided commit.
A participant cannot choose on its own. It must wait for the coordinator to recover and read its log, or learn the decision from a peer that heard it. Until then, the locks stay held and other transactions that need those rows wait behind them.
This is why two-phase commit is called blocking. A good answer names the lock holding, and says that a longer outage means a longer block.
Sources
- Jim Gray, Leslie Lamport (2006). Consensus on Transaction Commit.
- Philip A. Bernstein, Vassos Hadzilacos, Nathan Goodman (1987). Concurrency Control and Recovery in Database Systems.
- C. Mohan, Bruce Lindsay, Ron Obermarck (1986). Transaction management in the R* distributed database management system.