pub struct LoggedLeaderDrivenConsensus<V: Clone> { /* private fields */ }Expand description
Paxos in the fail-recovery model.
Implementations§
Source§impl<V: Clone + PartialEq> LoggedLeaderDrivenConsensus<V>
impl<V: Clone + PartialEq> LoggedLeaderDrivenConsensus<V>
Sourcepub fn new(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
timing: Timing,
) -> Self
pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, timing: Timing, ) -> Self
Paxos among peers, over stable storage.
Trait Implementations§
Source§impl<V: Clone + PartialEq> Protocol for LoggedLeaderDrivenConsensus<V>
impl<V: Clone + PartialEq> Protocol for LoggedLeaderDrivenConsensus<V>
Source§type Entry = Infallible
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>)
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>)
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>)
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 Scope = Infallible
type Scope = Infallible
Scopes whose boundaries this protocol’s guarantees depend on, and which it can observe. Read more
Source§type Meta = Durable<V>
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>)
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>)
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>,
)
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§
impl<V> Freeze for LoggedLeaderDrivenConsensus<V>where
V: Freeze,
impl<V> RefUnwindSafe for LoggedLeaderDrivenConsensus<V>where
V: RefUnwindSafe,
impl<V> Send for LoggedLeaderDrivenConsensus<V>where
V: Send,
impl<V> Sync for LoggedLeaderDrivenConsensus<V>where
V: Sync,
impl<V> Unpin for LoggedLeaderDrivenConsensus<V>where
V: Unpin,
impl<V> UnsafeUnpin for LoggedLeaderDrivenConsensus<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for LoggedLeaderDrivenConsensus<V>where
V: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more