- 2076 Chaitra · 3 marks
Short note: Three-phase commit
Short answer
Three-phase commit (3PC) extends 2PC with a pre-commit phase to prevent blocking on coordinator failure. Phases: canCommit (vote), preCommit (all know Yes votes), doCommit. If coordinator crashes, participants can elect a new coordinator; if any is in preCommit state, they commit, else abort. It avoids blocking but adds one message round.
Write a short note on three phase commit.
The three-phase commit protocol (3PC) is an extension of 2PC that avoids blocking when the coordinator crashes, by adding a pre-commit state between the vote and the commit. Its states satisfy two conditions: there is no state from which a process can move directly to both COMMIT and ABORT, and there is no state in which a process cannot yet make a final decision but can move directly to COMMIT.
Phases
- canCommit: the coordinator sends Prepare/canCommit?; participants reply Yes or No. If any No, or a timeout, the coordinator sends abort.
- preCommit: if all say Yes, the coordinator sends Pre-commit; participants acknowledge. Now everyone knows that all have voted Yes.
- doCommit: after all acknowledgements, the coordinator sends Commit; participants commit and reply.
Coordinator states:
INIT --canCommit?--> WAIT --all Yes--> PRECOMMIT --acks--> COMMIT
|any No/timeout
v
ABORT
Participant states:
INIT --Yes--> READY --preCommit--> PRECOMMIT --commit--> COMMIT
|No |abort/timeout
v v
ABORT ABORT
Recovery rule: if the coordinator fails, the participants elect a new one. If any participant is in PRECOMMIT, all can commit; if none is, all can abort. Timeouts drive transitions so the system never blocks indefinitely.
Compared with 2PC: 3PC is non-blocking under crash failures (not for network partitions), but needs one more round of messages, so it costs more and is less used in practice.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Cascading aborts; three-phase commit · Distributed System, chapter 8
- Short note: Two-phase commit · Distributed System, chapter 8 · asked 2×
- Distributed deadlock; two-phase commit · Distributed System, chapter 8
- Three phase system and transition zone · Concrete Technology and Masonry Structure, chapter 2 · asked 8×
- Output equation of three phase induction motor · Electric Machine Design, chapter 4 · asked 6×
- Three phase system and structure of hcp · Concrete Technology and Masonry Structure, chapter 2 · asked 6×
- Three-phase single-way thyristor rectifier: average and RMS · Power Electronics, chapter 3 · asked 5×