Imagine you're managing a bank transfer across three servers: one in New York, one in London, one in Tokyo. Every server must either all commit the transaction or all abort it â partial success is a disaster. The standard solution is Two-Phase Commit (2PC): a coordinator asks every participant "are you ready?", collects votes, then broadcasts the final decision.
2PC is elegant and widely deployed. But it has one fatal flaw: if the coordinator crashes after collecting votes but before broadcasting the decision, every participant is stuck. They each voted "yes" and locked their resources, but they have no idea whether the coordinator said "commit" or "abort." They cannot decide on their own without risking disagreement with survivors elsewhere. They must wait â potentially forever.
Three-Phase Commit (3PC), introduced by Dale Skeen in 1981, adds a single extra round called pre-commit. That one extra message is enough to break the deadlock: before the coordinator sends the final "commit", it first tells everyone "I'm about to commit." Armed with that knowledge, surviving participants can always figure out the right answer â even if the coordinator vanishes mid-protocol.
Comments
Loading comments...