Three-Phase Commit (3PC) protocol — concept page. Adds PreCommit phase between Vote and DoCommit to fix 2PC blocking problem when coordinator fails. Three scenarios: (1) happy path through CanCommit/PreCommit/DoCommit, (2) coordinator failure after PreCommit with non-blocking termination via participant election, (3) network partition causing split-brain (3PC only correct in synchronous crash-stop model). Includes ADRs explaining why 3PC is rarely used in production (Spanner Paxos commit, Saga, Outbox patterns are preferred).
Three-phase commit is an atomic-commit protocol for crash failures under synchronous timing/failure-detector assumptions. It separates canCommit, preCommit, and doCommit so no covered protocol state is adjacent to both abort and commit decisions. Participants durably record states and hold conflicting work while prepared/precommitted.
Its non-blocking claim is conditional: arbitrary delay or network partition destroys the knowledge needed for safe autonomous timeout decisions. Classic 3PC coordinates every participant rather than using a majority quorum. Paxos Commit is a different construction that uses consensus acceptors for transaction votes/decisions.
two-pc-blocks-after-prepare): A 2PC participant prepared before coordinator crash cannot safely infer commit versus abort.can-commit-vote): All required participants durably vote yes before the coordinator advances.precommit-state): Coordinator and participants persist precommit before final doCommit.coordinator-crash-recovery): Under no-partition bounded-delay assumptions, a fenced recovery coordinator can finish from durable states.network-partition): Separated participants cannot know whether unseen peers reached precommit, so autonomous timeout choices may diverge.duplicate-phase-message): Retries use transaction id and coordinator epoch; terminal state cannot be reversed.paxos-commit-contrast): Consensus acceptors replicate participant votes/decision under a different progress model.Two-phase commit is an explore diagram.
Saga orchestration and saga choreography model compensating workflows rather than atomic commit.
Введите числа или выберите пресет