A stable publication is committed once a quorum's acknowledgements are counted
ProvedOpenSearchProgress.publication_committedFor every payload type V, cluster parameters P with P.InitCompatible and P.strategy = ElectionStrategy.DEFAULT_INSTANCE, every cluster W with Reachable P W, every node c, term t and list Q of cluster-manager-eligible node ids, such that c has won the election and is in term t, every cluster state s, term pt and version pv with W.sent (.publishRequest c s pt pv), s.term = t and s.version = (W.node c).lastPublishedVersion, such that moreover
Qis a quorum of four configurations:c's last committed and last accepted configurations ((W.node c).lastCommittedConfiguration.hasQuorum Q = true,(W.node c).lastAcceptedConfiguration.hasQuorum Q = true) and the published state's (s.lastCommittedConfiguration.hasQuorum Q = true,s.lastAcceptedConfiguration.hasQuorum Q = true);chas counted no acknowledgement yet:(W.node c).publishVotes.nodes = [], as right afterhandleClientValue, which empties the publish votes;
and every cluster W' with PublicationExec P c t Q W W' in which every member of Q is among c's publish votes (q ∈ (W'.node c).publishVotes.nodes for every q ∈ Q): Committed W' t s.version, that is, an ApplyCommitRequest for term t and version s.version has been sent.
handlePublishResponse sends the commit when the votes are a quorum of c's current last committed configuration and of the configuration being published (isPublishQuorum, CoordinationState.java:156-158). During the period c's last committed configuration can change: applying the commit of its accepted state makes it c's last accepted configuration (Java's handleCommit allows this while a publication is in flight), and accepting its own publication makes it s's last committed configuration, which can move it backwards. Q must therefore be a quorum of every configuration c may be using when the acknowledgement that completes Q arrives; otherwise all of Q could be counted without a commit.
import Definitions.Def_OpenSearchProgress open OpenSearchCoordination OpenSearchSafety OpenSearchProgress
theorem OpenSearchProgress.publication_committed {V : Type} (P : Params) (hP : P.InitCompatible)
(hes : P.strategy = ElectionStrategy.DEFAULT_INSTANCE) (W : Cluster V) (hW : Reachable P W)
(c : NodeId) (t : Nat) (Q : List NodeId) (hQ : ∀ q ∈ Q, P.eligible q = true)
(hwon : (W.node c).electionWon = true) (hct : (W.node c).currentTerm = t)
(s : ClusterState V) (pt : Nat) (pv : Int) (hs : W.sent (.publishRequest c s pt pv)) (hst : s.term = t)
(hsv : s.version = (W.node c).lastPublishedVersion)
(hquorum : (W.node c).lastCommittedConfiguration.hasQuorum Q = true ∧
(W.node c).lastAcceptedConfiguration.hasQuorum Q = true ∧
s.lastCommittedConfiguration.hasQuorum Q = true ∧ s.lastAcceptedConfiguration.hasQuorum Q = true)
(hpv : (W.node c).publishVotes.nodes = [])
(W' : Cluster V) (hE : PublicationExec P c t Q W W') (hacks : ∀ q ∈ Q, q ∈ (W'.node c).publishVotes.nodes) :
Committed W' t s.version := by sorryRead-back
What the Lean code literally says, in plain math · claude-opus-5-5 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back: OpenSearchProgress.publication_committed
Notions used
The full expansions are in readback_Def_OpenSearchProgress.md.
Node-state notation. For a node state :
- is the current term;
- and are the last committed and last accepted configurations of its accepted state;
- is
lastPublishedConfiguration; - is
electionWon; - is
lastPublishedVersion; - is the list of ids in the publish votes.
For a cluster state , and are its two configurations. means strictly more than half of the ids of configuration occur in the list . It is false for an empty and for , and it is monotone in .
The publication period is a finite, possibly empty, sequence of Steps from to . Compared with arbitrary steps, the period imposes exactly three restrictions:
- no start-join at or at a member of to a term above ;
- no new publication (
clientValue) by ; - no
restartof .
Everything else is allowed: bootstraps, other nodes' start-joins and publications, every join, publish, respond and commit step, restarts of members of , and restartAny of non-eligible nodes.
How publish votes and commits arise. Publish votes are cleared by handleClientValue, handleStartJoin and restarts, and grow only in handlePublishResponse. That handler requires , a matching term, and a version equal to . It adds the responder's id if the responder is flagged cluster-manager. If the new votes satisfy , it returns an apply-commit request , which the respond step sends.
Committed. means some apply-commit request , from any source , is in .
1. Declaration
The universally quantified variables and hypotheses, in order:
| Name | Type / statement |
|---|---|
V (implicit) | Type |
P | Params |
hP | |
hes | |
W | Cluster V (start of the period) |
hW | |
c | node id (the cluster-manager) |
t | |
Q | list of node ids (acknowledging nodes) |
hQ | |
hwon | |
hct | |
s | ClusterState V |
pt | |
pv | |
hs | |
hst | |
hsv | |
hquorum | |
hpv | |
W' | Cluster V |
hE | |
hacks |
Conclusion. , that is,
In words: if starts the period holding no publish votes and ends it holding publish votes from every member of , then an apply-commit request for term and version has been sent by some node.
2. What is not constrained
-
hpvnarrows the start of the period. The period must start while holds no publish votes, for example right after published and before it counted any acknowledgement from an eligible node. A period starting after some acknowledgements have been counted is not covered by this statement as written. -
Every member of must have acknowledged.
hacksrequires every member of to be among 's publish votes at , not just a quorum's worth. It does not say directly that the votes acknowledge . Publish votes are added only when an acknowledgement's version equals , and cannot publish again during the period. -
Four configurations.
hquorumrequires to be a majority of four configurations: 's last committed and last accepted configurations at , and 's two configurations. It thereby forces and all four configurations non-empty. Which configurations compares against when it counts the last vote ( at that moment, and ) is not stated. The theorem implicitly claims they are among those covered. -
Model-relative. In the model, the commit is sent as soon as the counted votes form a quorum. In Java,
handlePreCommit(), the remote-store write atCoordinationState.java:510, runs first and may throw. The Coordination file abstracts this away; see G5 in the definitions read-back. -
The conclusion is weak. It says only that a commit has been sent. It does not say that any node, included, has applied it. The source of the commit is existential.
-
No term hypothesis on . Members of may be in any term at .
-
Implicit reliance on 's flags. This is derived by me, not stated.
- During the period, 's publish votes are never cleared: cannot publish, cannot start-join (it is in term and the period forbids terms above ), and cannot be restarted.
- So they reach through successful
handlePublishResponsecalls, and the last of these returns the commit if 's configurations at that moment are covered. - That commit carries the version at that moment. The conclusion therefore needs still to be .
- Within the period, can change only through
handleJoin's "newly won" branch, which sets when goes from false to true. That branch requires to have lostelectionWonfirst. The LeanhandleJoindoes not exclude losing it; Java only asserts that it cannot happen (CS:323).
So the theorem relies on this being impossible, or harmless, in reachable clusters under the default strategy (
hes). -
's eligibility. It is not assumed. It follows from
hwonin a reachable cluster, because only eligible nodes receive joins. -
Empty execution. It is excluded. With ,
hacksandhpvwould force , contradictinghquorum. So at least one respond step at occurs in the period. -
Vacuity. The hypotheses are satisfiable. Single-node example:
- Node 1 is eligible, the bootstrap configuration is only, and the strategy is the default.
- Node 1 bootstraps, start-joins on its own request for term 1, handles its own join (and wins), and publishes (term 1, version 1, both configurations ). Publishing clears its publish votes. is the cluster at this point, with , , .
- In the period, node 1 accepts its own publication, sending itself the acknowledgement , then counts it. Its votes are a quorum of , so the commit is sent.
3. Plain-language summary
Suppose that, in a reachable cluster under the default strategy:
- has won term and has just sent as its latest publication;
- has not yet counted any acknowledgement;
- is a majority of 's configurations and of 's configurations.
If, during a stable publication period, comes to hold acknowledgements from every member of , then a commit for has been sent. It is the "the acknowledgements suffice" half of publication progress. It assumes the acknowledgements rather than deriving them, and it claims only that the commit was sent, not that it was applied.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.