Skip to main content

LoggedLeaderDrivenConsensus

Struct LoggedLeaderDrivenConsensus 

Source
pub struct LoggedLeaderDrivenConsensus<V: Clone> { /* private fields */ }
Expand description

Paxos in the fail-recovery model.

Implementations§

Source§

impl<V: Clone + PartialEq> LoggedLeaderDrivenConsensus<V>

Source

pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, timing: Timing, ) -> Self

Paxos among peers, over stable storage.

Source

pub fn epoch(&self) -> u64

The epoch now live at this process.

Source

pub fn leader(&self) -> NodeId

Who leads the epoch now live.

Source

pub fn decision(&self) -> Option<&V>

What this process decided, if it has.

Source

pub fn state(&self) -> &State<V>

(valts, val) as the epoch now live holds it — what the abort handshake carries forward.

Trait Implementations§

Source§

impl<V: Clone + PartialEq> Protocol for LoggedLeaderDrivenConsensus<V>

Source§

type Entry = Infallible

Nothing accumulates: one epoch, one leader, one decision, and one record per child.

Source§

fn on_cmd(&mut self, Cmd::Propose: Cmd<V>, cx: &mut ProtoCx<'_, Self>)

upon event ⟨ luc, Propose | v ⟩ do val := v.

Source§

fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)

upon event ⟨ luc, Init ⟩ … store(ets, ℓ, decision).

This process’s own record goes down first, then each child’s, so the record exists before anything writes into a slot of it.

Source§

fn on_recovery(&mut self, cx: &mut ProtoCx<'_, Self>)

upon event ⟨ luc, Recovery ⟩.

The book reads its children’s records by name — retrieve(startts, start) of instance lec, retrieve(epochdecision) of instance lep.ets. Here each child reads its own slot in its own Recovery, which is the same statement in the direction the composition runs.

Source§

type Cmd = Cmd<V>

Requests from the layer above.
Source§

type Ind = Ind<V>

Indications to the layer above — this protocol delivering on its guarantee.
Source§

type Msg = Wire<V>

What crosses the wire to a peer running the same protocol.
Source§

type Scope = Infallible

Scopes whose boundaries this protocol’s guarantees depend on, and which it can observe. Read more
Source§

type Note = Note

The vocabulary in which this protocol narrates its decisions. Read more
Source§

type Meta = Durable<V>

The durable value this protocol rewrites: a position, a count, an epoch. Small enough that rewriting it costs nothing. Read more
Source§

fn on_msg(&mut self, from: NodeId, msg: Wire<V>, cx: &mut ProtoCx<'_, Self>)

Handle a message received from from.
Source§

fn on_timer(&mut self, id: TimerId, cx: &mut ProtoCx<'_, Self>)

Handle a timer that fired somewhere in this protocol or in what it composes. Read more
§

fn on_scope_event( &mut self, _scope: Self::Scope, _cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>, )

Handle a boundary of a scope this protocol’s guarantees depend on — its end, or the beginning of the one that succeeds it. Read more

Auto Trait Implementations§

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> 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, 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