Distributed Atomic Commitment and Fail-Stop Two-Phase Commit Step #
This module specifies the distributed Atomic Commitment problem (AC1 Uniform Agreement across
all deciding processes including crashed ones, AC2 Abort Validity on any no vote, and AC3
failure-free Commit Nontriviality) and proves an intermediate fail-stop register-state Two-Phase
Commit (2PC) step toward [Gra78], §5.8.3.3.2 (pp. 466–469), [Ske81], §§1–3
(pp. 134–137), and [SS83], §§II–IV (pp. 220–223), not the cited crash-recovery
log-replay endpoint (#7289).
In this fail-stop 2PC step, a designated coordinator coord : P sends vote requests to all cohort
sites r ≠ coord in Phase 1. Each cohort casts its initial Vote (yes moving to .uncertain, or
no unilaterally deciding .aborted) and replies to coord. In Phase 2, coord decides
.committed and broadcasts .commit only if votes coord = .yes and every cohort replied .yes;
if votes coord = .no, any cohort replied .no, or a site crashed (timeout), coord decides
.aborted and broadcasts .abort. Stable undo/redo log forces ([Gra78], §5.8.3.3.2, p. 468)
are abstracted as persistent per-site TwoPCLocalState registers retained across permanent
fail-stop crashes rather than crash-recovery log-replay restarts (#7289).
Within this fail-stop model we prove two complementary step families:
- Fail-stop safety and fault-free completion: Across arbitrary fail-stop crashes and message
omissions, decisions are write-once (
twoPC_decision_stable_failStop) and every reachable configuration satisfiesUniformAgreement(twoPC_agreement_failStop,AC1) andAbortValidity(twoPC_abort_of_vote_no_failStop,AC2). When no faults occur and all processes voteyes,2PCreaches unanimous.commit(twoPC_failureFree_commit_failStop,AC3); when any process votesno, a fault-free run reaches unanimous.abort(twoPC_failureFree_abort_failStop). - Survivor uncertainty on coordinator crash (
2 ≤ Fintype.card P): Whenever at least two processes participate, there exist two reachable crash/omission configurationssAbortandsCommitwith the same surviving operational cohort{q}(q ≠ coord,votes q = .yes, local state.uncertain, empty survivor inbox) such thatcoordvoted.noand already decided.abortinsAbortwhereascoordalready decided.commitinsCommit(twoPC_uncertain_bivalent_failStop; on three or more sites, cohort-vote ambiguity withvotes coord = .yesalso arises). Consequently, no termination rule depending only on the surviving processes' states, votes, and inbox can safely decide forqwithout violatingUniformAgreement(twoPC_no_safe_survivor_termination_failStop).
Main definitions #
Cslib.Distributed.AtomicCommit.Vote: initial transaction vote (yesorno).Cslib.Distributed.AtomicCommit.Decision: irreversible outcome (commitorabort).Cslib.Distributed.AtomicCommit.UniformAgreement:AC1agreement across all deciding sites (operational or crashed).Cslib.Distributed.AtomicCommit.AbortValidity:AC2unilateral-abort validity ((∃ p, votes p = .no) → ∀ q, dec q ≠ some .commit).Cslib.Distributed.AtomicCommit.AllDecided,Cslib.Distributed.AtomicCommit.OperationalDecided: unanimous decision predicates.Cslib.Distributed.AtomicCommit.TwoPCLocalState,Cslib.Distributed.AtomicCommit.TwoPCMsg,Cslib.Distributed.AtomicCommit.TwoPCState,Cslib.Distributed.AtomicCommit.TwoPCAction: local states, network messages, global configurations, and transition labels of the fail-stop2PCstep.Cslib.Distributed.AtomicCommit.twoPCStep?,Cslib.Distributed.AtomicCommit.twoPCLts,Cslib.Distributed.AtomicCommit.TwoPCReachable: operationalCslib.LTSsemantics of the fail-stop2PCstep with crashes and message omissions.Cslib.Distributed.AtomicCommit.TwoPCSurvivorView: projection of a2PCglobal state visible to the surviving operational sites.
Main results #
Cslib.Distributed.AtomicCommit.twoPC_decision_stable_failStop: local2PCdecisions are irreversible along reachable executions in the fail-stop register-state step.Cslib.Distributed.AtomicCommit.twoPC_agreement_failStop: fail-stop2PCstep towardUniformAgreement(AC1) across arbitrary fail-stop crashes and message omissions.Cslib.Distributed.AtomicCommit.twoPC_abort_of_vote_no_failStop: fail-stop2PCstep towardAbortValidity(AC2) in every reachable state.Cslib.Distributed.AtomicCommit.twoPC_failureFree_commit_failStop: fault-free all-yesexecution of the fail-stop2PCmodel reachesAllDecided _ .commit(AC3).Cslib.Distributed.AtomicCommit.twoPC_failureFree_abort_failStop: fault-free execution of the fail-stop2PCmodel with at least onenovote reachesAllDecided _ .abort.Cslib.Distributed.AtomicCommit.twoPC_uncertain_bivalent_failStop: for2 ≤ Fintype.card P, exhibits reachablesAbortandsCommitwith identicalTwoPCSurvivorViewon a surviving.uncertaincohortq(votes q = .yes) wherecoordhas already decided.abortvs.commit.Cslib.Distributed.AtomicCommit.twoPC_no_safe_survivor_termination_failStop: for2 ≤ Fintype.card P, no survivor-only termination rule for the fail-stop2PCmodel preservesUniformAgreement.
References #
Atomic commitment specification #
Initial vote of a site on whether it is prepared to commit or unilaterally aborts.
Instances For
Irreversible transaction outcome decided by a site.
Instances For
Finite-process decidability of UniformAgreement.
Finite-process decidability of AbortValidity.
Finite-process decidability of AllDecided.
Decidability of OperationalDecided over alive : Finset P.
Under AbortValidity, if at least one site voted .no, any decided outcome is .abort.
Fail-stop register-state Two-Phase Commit (2PC) step #
Local automaton states of centralized Two-Phase Commit ([Ske81], Figure 2, p. 135; [Gra78], §5.8.3.3.2, p. 468).
- init : TwoPCLocalState
Initial state (
q_i) prior to Phase 1 voting or request broadcast. - waitVotes : TwoPCLocalState
Coordinator Phase 1 state (
w_1) awaiting cohort vote replies. - uncertain : TwoPCLocalState
Cohort Phase 1 state (
w_i) after voting.yesand forcing undo/redo logs, awaiting the coordinator's Phase 2 verdict. - committed : TwoPCLocalState
Final committed state (
c_i). - aborted : TwoPCLocalState
Final aborted state (
a_i).
Instances For
Decision recorded in a TwoPCLocalState (none until .committed or .aborted).
Final TwoPCLocalState corresponding to a Decision.
A TwoPCLocalState decides .commit iff it is .committed.
A TwoPCLocalState decides .abort iff it is .aborted.
Point-to-point protocol messages of centralized 2PC.
- voteRequest {P : Type u_1} (dest : P) : TwoPCMsg P
Phase 1
REQUEST_COMMITsent by the coordinator to cohortdest. - voteReply {P : Type u_1} (src : P) (vote : Vote) : TwoPCMsg P
Phase 1 vote reply sent by cohort
srcto the coordinator. - verdict {P : Type u_1} (dest : P) (dec : Decision) : TwoPCMsg P
Phase 2 final verdict (
COMMITorABORT) sent by the coordinator to cohortdest.
Instances For
Recipient process of a TwoPCMsg given the designated coordinator coord.
Global configuration of centralized 2PC under fail-stop crashes and message omissions.
- localState : P → TwoPCLocalState
Local automaton state of each process (retained permanently even if the process crashes).
- yesVotes : Finset P
Set of cohorts from which the coordinator has received
.yesreplies. - sawNo : Bool
Whether the coordinator has received at least one
.noreply. - alive : Finset P
Currently operational (non-crashed) processes.
Multiset of in-flight messages on the asynchronous network.
Decision vector of a global TwoPCState across all sites (operational or crashed).
Initial global configuration of 2PC: all processes operational in .init with empty
network.
Transition labels of the 2PC operational LTS.
- sendRequests {P : Type u_1} : TwoPCAction P
Coordinator initiates Phase 1 by broadcasting
voteRequestto all cohortsr ≠ coord. - recvRequest {P : Type u_1} (p : P) : TwoPCAction P
Cohort
p ≠ coordprocessesvoteRequest pand castsvotes p. - recvVote {P : Type u_1} (p : P) (v : Vote) : TwoPCAction P
- coordCommit {P : Type u_1} : TwoPCAction P
- coordAbort {P : Type u_1} : TwoPCAction P
- recvVerdict {P : Type u_1} (p : P) (d : Decision) : TwoPCAction P
Cohort
p ≠ coordprocessesverdict p dfrom the coordinator. - crash {P : Type u_1} (p : P) : TwoPCAction P
Fail-stop crash of operational site
p. - dropMsg {P : Type u_1} (m : TwoPCMsg P) : TwoPCAction P
Network omission (loss) of an in-flight message
m.
Instances For
Whether a TwoPCAction is a normal message-passing step without crashes or message drops.
Partial transition function of centralized 2PC for designated coordinator coord and initial
vote profile votes.
Operational Cslib.LTS of the fail-stop register-state 2PC step with crashes and message
omissions (after [Gra78], §5.8.3.3.2, pp. 466–469).
Reachability of a 2PC configuration from twoPCStart P in the fail-stop register-state
step.
Fail-stop safety (AC1 and AC2) and decision stability of 2PC #
Fail-stop register-state step toward [Gra78], §5.8.3.3.2 (p. 468), not the cited
crash-recovery log-replay result (#7289): once a site decides .commit or .abort in twoPCLts,
its decision is preserved along all subsequent transitions (including fail-stop crashes and message
drops).
Fail-stop register-state step toward [Gra78], §5.8.3.3.2 (p. 469) and [Ske81], §2
(p. 136), not the cited crash-recovery log-replay result (#7289): in every reachable configuration
of twoPCLts (across arbitrary fail-stop site crashes and message omissions), all decided
sites—operational or crashed—satisfy UniformAgreement (AC1).
Fail-stop register-state step toward [Gra78], §5.8.3.3.2 (p. 468) and [Ske81], §2
(p. 136), not the cited crash-recovery log-replay result (#7289): if any site voted .no, no site
decides .commit in any reachable configuration of twoPCLts (AC2).
Failure-free execution (AC3 and abort completion) #
Fail-stop register-state step toward [Gra78], §5.8.3.3.2 (pp. 467–468), not the cited
crash-recovery log-replay result (#7289): when all sites vote .yes, twoPCLts admits a
crash-free, omission-free execution from twoPCStart P reaching AllDecided s.decision .commit
with all sites operational and an empty network (AC3).
Fail-stop register-state step toward [Gra78], §5.8.3.3.2 (pp. 467–468), not the cited
crash-recovery log-replay result (#7289): when at least one site votes .no, twoPCLts admits a
crash-free, omission-free execution from twoPCStart P reaching AllDecided s.decision .abort.
Coordinator-crash uncertainty and inherent blocking of 2PC #
Projection of a 2PC global configuration visible to the surviving operational processes:
the operational survivor set alive, each survivor's local state (masked to .init outside
alive), each survivor's initial vote (masked to .yes outside alive), and all in-flight
messages addressed to survivors.
- alive : Finset P
Currently operational sites.
- survivorState : P → TwoPCLocalState
- survivorVote : P → Vote
In-flight messages addressed to operational sites.
Extract the survivor-visible projection of a 2PC configuration s.
Fail-stop register-state step toward [Ske81], §1 (p. 134) and [SS83],
§IV-C, Lemma 1 (p. 223), not the cited crash-recovery result (#7289): for 2 ≤ Fintype.card P and
any coordinator coord : P, there exist a surviving cohort q ≠ coord, vote profile votesAbort
(votesAbort coord = .no, votesAbort q = .yes), and twoPCLts-reachable configurations sAbort
and sCommit such that:
Fail-stop register-state step toward [Gra78], §5.8.3.3.2 (p. 469), [Ske81], §1
(p. 134), and [SS83], §IV-C, Lemma 1 (p. 223), not the cited crash-recovery result
(#7289): for 2 ≤ Fintype.card P, no termination rule term depending only on the surviving
processes' TwoPCSurvivorView can assign decisions to undecided survivors in a way that preserves
UniformAgreement across all reachable configurations of twoPCLts.