pub enum SynodMsg<C> {
P1a {
ballot: Ballot,
},
P1b {
ballot: Ballot,
accepted: Vec<Pvalue<C>>,
collected: Slot,
},
P2a {
pvalue: Pvalue<C>,
},
P2b {
ballot: Ballot,
slot: Slot,
},
Decision {
slot: Slot,
command: C,
},
CatchUp {
from_slot: Slot,
},
Applied {
slot_out: Slot,
},
Propose {
slot: Slot,
command: C,
},
}Expand description
What this layer puts on the wire, beneath the link.
Figures 4 and 6: the acceptor’s two requests, its two replies, and the commander’s decision.
adopted and preempted are not here — each is a thread reporting to the leader that owns it,
which is a function call once the thread is a field.
SynodMsg::Propose is not on any figure. It is §4.4’s colocation: a replica hands its
proposal to the leader on its own machine, and a leader that cannot act on it passes it to the
one that can. See the module documentation.
Variants§
P1a
⟨p1a, λ, b⟩ — phase one, from a scout.
P1b
⟨p1b, α, ballot_num, accepted⟩ — an acceptor’s answer, carrying one pvalue per slot it
has accepted for rather than everything it has ever accepted. §4.1; see the module
documentation. This message is what grew fastest in the book’s version, because it grew with
the ballots the run had seen as well as with the slots.
P2a
⟨p2a, λ, ⟨b, s, c⟩⟩ — phase two, from a commander.
P2b
⟨p2b, α, ballot_num⟩, plus the slot it answers for. Figure 4 has no slot, because the
reply goes to a thread whose identity supplies it; a leader holding its commanders as fields
needs it in the message. See the module documentation.
Decision
⟨decision, s, c⟩ — Figure 6(a)’s last line, sent by a commander that has counted a
majority, so that every process learns what was chosen rather than only the one that
counted.
Also the answer to a SynodMsg::Propose for a slot already decided, sent to the asker
alone. A decision is announced once and its commander then exits, so a process the
announcement never reached has no other way back; asking is the way, and this is the answer.
CatchUp
A request for the decisions from from_slot onwards, from a process that has fallen behind
and whose consensus layer has collected them. §4.2’s replica-to-replica transfer; see
Cmd::CatchUp.
Applied
⟨applied, ρ, s⟩ — how far the replica on the sending machine has applied. Not on any
figure; §4.2’s periodic update, which is what makes collection possible at all.
Propose
A proposal for a slot, from a replica on this machine or from a leader that could not act on it. Not on any figure — §4.4’s colocation; see the module documentation.
A Propose that arrived is never forwarded again. Two processes whose detectors
disagree would otherwise pass one back and forth for as long as they disagree.