Cardinality-quorum multi-writer atomic register emulation #
This module formalizes abdProtocol, an independent cardinality-quorum point-to-point envelope
specialization after the two-phase multi-writer multi-reader (MWMR) construction of Lynch and
Shvartsman ([LS97], §4.1–4.2 in the December 2, 1996 manuscript) and the majority
read write-back discipline of Attiya, Bar-Noy, and Dolev ([ABND95], §4), as a step
toward full atomic-register emulation rather than the cited Theorem 4.5 or Theorem 4.9 endpoints:
[LS97] (§4.1–4.2, Theorem 4.5) parameterizes over separate fixed read and write quorum families, a quorum-acknowledged broadcast abstraction, and a per-processor client request queue, and Theorem 4.5 proves atomicity only (with conditional
4dtime and8nmessage bounds in §4.3 Theorem 4.6 and dynamic reconfiguration in §5).[ABND95] (§4, Theorem 4.9, p. 134) emulates an unbounded single-writer multi-reader (SWMR) register over ping-pong channels using one communication phase for writes and two phases (query + write-back) for reads with
O(n)message andO(1)time bounds, obtaining MWMR registers in §7 by composition (with bounded timestamps in §5 and dynamic links in §6).Here
abdProtocolinstead runs two uniform(n - t)-cardinality quorum phases over concrete unordered point-to-point envelopes (Envelope) with idle-only client invocations ((s.proc caller).pending = none) and lexicographic writer tagsTag P := ℕ ×ₗ WithBot P, proving both safety (Reachable s → Linearizable v₀ s.historyinabd_linearizable) and a separate fair-crash liveness property (abd_terminatesunderProtocol.Fair F) without cost bounds:Each replica
p : Pstores(repTag, repVal)initialized to(initTag P, v₀)whereinitTag P = toLex (0, ⊥), and updates its pair upon receivingABDMsg.store reqId inTag inValif and only ifrepTag < inTag.write vbycaller: Phase 1 broadcastsABDMsg.query reqIdand collects(rTag, rVal)responses fromn - tdistinct replicas, choosingchosenTag := nextWriteTag bestTag.seq caller(toLex (bestTag.seq + 1, ↑caller)). Phase 2 broadcastsABDMsg.store reqId chosenTag vand waits forn - tABDMsg.ack reqIdresponses before returning.readbycaller: Phase 1 queriesn - tdistinct replicas and picks(bestTag, bestVal)maximizingtaglexicographically. Phase 2 performs the write-back broadcastABDMsg.store reqId bestTag bestValand waits forn - tABDMsg.ack reqIdresponses before returningbestVal.
For 2 * t < Fintype.card P, any two quorums of size at least n - t intersect
(quorum_inter_nonempty), and replica tags never decrease (tr_repTag_mono). Consequently, every
operation invoked after a completed operation a observes a tag at least a's Phase-2 tag
(strictly greater when the later operation is a write), and sorting all completed operations
together with Phase-2 pending writes by (tag, isRead, opId) yields an explicit valid
linearization (abd_linearizable). Against any static faulty set F of size at most t,
n - F.card ≥ n - t non-faulty replicas respond in each phase, establishing wait-free termination
(abd_terminates) and implementsAtomicRegister_abd.
Main definitions #
Cslib.Distributed.ABD.Tag,Cslib.Distributed.ABD.initTag,Cslib.Distributed.ABD.nextWriteTag: lexicographic(seq, writer)version tags.Cslib.Distributed.ABD.ABDMsg,Cslib.Distributed.ABD.ClientPhase,Cslib.Distributed.ABD.ABDState: ABD messages and per-process replica/client state.Cslib.Distributed.ABD.abdOnInvoke,Cslib.Distributed.ABD.abdOnRecv,Cslib.Distributed.ABD.abdProtocol: two-phase fixed-(n - t)-quorum MWMR register emulation protocol.
Main results #
Cslib.Distributed.ABD.quorum_inter_nonempty,Cslib.Distributed.ABD.quorum_inter_notMem: quorum intersection for2 * t < Fintype.card P.Cslib.Distributed.ABD.tr_repTag_mono,Cslib.Distributed.ABD.mTr_repTag_mono: replica tag monotonicity across transitions and finite executions.Cslib.Distributed.ABD.abd_linearizable: every reachable state ofabdProtocolhas a linearizable execution history when2 * t < Fintype.card P.Cslib.Distributed.ABD.abd_terminates: every operation invoked by a non-faulty process completes in everyt-fault admissible run ofabdProtocolwhen2 * t < Fintype.card P.Cslib.Distributed.ABD.implementsAtomicRegister_abd:abdProtocolimplements at-resilient wait-free linearizable atomic register when2 * t < Fintype.card P.
References #
Lexicographic version tags #
Lexicographically ordered ABD version tag (seq, writer), where (0, ⊥) marks the initial
register value v₀ and (seq + 1, ↑w) marks a write by process w : P.
Initial ABD tag toLex (0, ⊥) associated with the initial register value v₀.
Every write tag nextWriteTag s w strictly exceeds initTag P.
Quorum intersection #
Quorum intersection: when 2 * t < Fintype.card P, any two subsets Q₁, Q₂ : Finset P of
cardinality at least Fintype.card P - t share at least one server.
When Q₁ consists of non-faulty servers (∀ q ∈ Q₁, q ∉ F), any two (n - t)-quorums
intersect in a live server outside F.
ABD protocol messages, state, and transitions #
Network messages exchanged by the two-phase ABD register emulation protocol.
- query {P : Type u_1} {V : Type u_2} (reqId : ℕ) : ABDMsg P V
Phase-1 query asking a replica for its current
(repTag, repVal). - queryResp {P : Type u_1} {V : Type u_2} (reqId : ℕ) (tag : Tag P) (val : V) : ABDMsg P V
Phase-1 reply reporting
(tag, val)forreqId. - store {P : Type u_1} {V : Type u_2} (reqId : ℕ) (tag : Tag P) (val : V) : ABDMsg P V
Phase-2 command asking a replica to store
(tag, val)iftagexceeds its current tag. - ack {P : Type u_1} {V : Type u_2} (reqId : ℕ) : ABDMsg P V
Phase-2 acknowledgment confirming processing of
store reqId.
Client-side phase state of a process in the ABD protocol.
- idle {P : Type u_1} {V : Type u_2} : ClientPhase P V
No client operation is currently active.
- phase1 {P : Type u_1} {V : Type u_2} (reqId : ℕ) (kind : OpKind V) (responses : Finset P) (bestTag : Tag P) (bestVal : V) : ClientPhase P V
Phase 1: collecting
(tag, val)replies fromn - tdistinct replicas. - phase2 {P : Type u_1} {V : Type u_2} (reqId : ℕ) (kind : OpKind V) (chosenTag : Tag P) (chosenVal : V) (acks : Finset P) : ClientPhase P V
Phase 2: broadcasting
store(chosenTag, chosenVal)(write or read write-back) and collectingn - tacknowledgments.
Local state of process p : P in the ABD protocol, combining its replica storage and its
client state machine.
- repTag : Tag P
Highest version tag stored at this replica.
- repVal : V
Value associated with
repTagat this replica. - nextReqId : ℕ
Counter generating fresh request nonces for this process's client invocations.
- phase : ClientPhase P V
Initial local state of each ABD process.
Message reception handler for the ABD protocol at recipient dest from sender src, using
quorum threshold Fintype.card P - t.
Uniform two-phase (n - t)-cardinality quorum multi-writer multi-reader register protocol over
unordered envelopes with idle-only invocations, lexicographic (seq, writer) tags, and Phase-2
read write-back (an independent cardinality-quorum specialization after
[LS97], §4.1 and [ABND95], §4, replacing separate read/write quorum
families, broadcast primitives, and per-processor request queues with concrete envelope steps).
Replica tag monotonicity #
Replica tag monotonicity (single transition): no replica's stored repTag ever decreases
across any transition of abdProtocol.
Replica tag monotonicity (finite execution): no replica's stored repTag ever decreases
along any finite execution of abdProtocol.
Global invariant for linearizability #
Explicit linearization order by (tag, isRead, opId) #
Independent cardinality-quorum envelope safety specialization (abd_linearizable), after
[LS97], §4.1–4.2 (and not the cited Theorem 4.5 or [ABND95]
Theorem 4.9 endpoint): when 2 * t < Fintype.card P, every state s reachable under
abdProtocol P V v₀ t satisfies Linearizable v₀ s.history. Whereas [LS97]
(§4.1–4.2, Theorem 4.5) proves atomicity over separate fixed read/write quorum families, a
broadcast abstraction, and a per-processor client request queue, this theorem proves
linearizability for Lean's concrete (n - t)-cardinality quorum envelope protocol with idle-only
client invocations.
Wait-free termination (abd_terminates) #
Fair-crash termination (abd_terminates) for the cardinality-quorum envelope protocol
abdProtocol: when 2 * t < Fintype.card P and F.card ≤ t, every operation invoked by a
non-faulty process (caller ∉ F) eventually completes in every Protocol.Fair F execution (a
separate envelope-liveness property accompanying abd_linearizable, without message or time cost
bounds).
Combined safety and fair-crash termination (implementsAtomicRegister_abd) for the
cardinality-quorum envelope specialization after [LS97], §4.1–4.2 (and not the
cited Theorem 4.5 or [ABND95] Theorem 4.9 endpoint): when 2 * t < Fintype.card P,
abdProtocol P V v₀ t satisfies ImplementsAtomicRegister v₀ t over concrete point-to-point
envelopes with (n - t)-cardinality quorums, idle-only invocations, and eventual delivery outside
F (pairing abd_linearizable with the separate liveness property abd_terminates, without
read/write quorum-family generality, per-processor request queues, or cost bounds).