Skip to main content

SynodMsg

Enum SynodMsg 

Source
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.

Fields

§ballot: Ballot
§

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.

Fields

§ballot: Ballot
§accepted: Vec<Pvalue<C>>
§collected: Slot
§

P2a

⟨p2a, λ, ⟨b, s, c⟩⟩ — phase two, from a commander.

Fields

§pvalue: Pvalue<C>
§

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.

Fields

§ballot: Ballot
§slot: Slot
§

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.

Fields

§slot: Slot
§command: C
§

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.

Fields

§from_slot: Slot
§

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.

Fields

§slot_out: Slot
§

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.

Fields

§slot: Slot
§command: C

Trait Implementations§

Source§

impl<C: Clone> Clone for SynodMsg<C>

Source§

fn clone(&self) -> SynodMsg<C>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug> Debug for SynodMsg<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, C> Deserialize<'de> for SynodMsg<C>
where C: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<C: Eq> Eq for SynodMsg<C>

Source§

impl<C: PartialEq> PartialEq for SynodMsg<C>

Source§

fn eq(&self, other: &SynodMsg<C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<C> Serialize for SynodMsg<C>
where C: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<C: PartialEq> StructuralPartialEq for SynodMsg<C>

Auto Trait Implementations§

§

impl<C> Freeze for SynodMsg<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for SynodMsg<C>
where C: RefUnwindSafe,

§

impl<C> Send for SynodMsg<C>
where C: Send,

§

impl<C> Sync for SynodMsg<C>
where C: Sync,

§

impl<C> Unpin for SynodMsg<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for SynodMsg<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for SynodMsg<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V