pub struct LoggedUniformReliableBroadcast<P: Clone + Ord> { /* private fields */ }Expand description
Uniform agreement over log-delivery, in the fail-recovery model.
Implementations§
Source§impl<P: Clone + Ord> LoggedUniformReliableBroadcast<P>
impl<P: Clone + Ord> LoggedUniformReliableBroadcast<P>
Sourcepub fn new(
me: NodeId,
members: impl IntoIterator<Item = NodeId>,
interval: Duration,
) -> Self
pub fn new( me: NodeId, members: impl IntoIterator<Item = NodeId>, interval: Duration, ) -> Self
Broadcast among members, which must include me, retransmitting every interval.
Sourcepub fn majority(&self) -> usize
pub fn majority(&self) -> usize
How many processes must have re-broadcast a message before it is log-delivered.
Sourcepub fn acknowledged_by(
&self,
id: BroadcastId,
) -> impl Iterator<Item = NodeId> + '_
pub fn acknowledged_by( &self, id: BroadcastId, ) -> impl Iterator<Item = NodeId> + '_
Which processes have been seen to re-broadcast id. Volatile, and rebuilt on recovery.
Trait Implementations§
Source§impl<P: Clone + Ord> Protocol for LoggedUniformReliableBroadcast<P>
impl<P: Clone + Ord> Protocol for LoggedUniformReliableBroadcast<P>
Source§type Meta = ()
type Meta = ()
Nothing is rewritten; the metadata is written once so a restart finds something.
Source§type Entry = Record<P>
type Entry = Record<P>
One record per message seen or log-delivered. ack is not among them, by design.
Source§fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
⟨ lurb, Init ⟩ do delivered := ∅; pending := ∅; ...; store(pending, delivered).
Source§fn on_recovery(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_recovery(&mut self, cx: &mut ProtoCx<'_, Self>)
upon event ⟨ lurb, Recovery ⟩.
Re-announce the log, then re-broadcast everything pending — which is what rebuilds ack,
and why it need not be durable. The replay also restores the send counter, so a process
that goes on to broadcast something new does not reuse an identifier.
Source§type Scope = Infallible
type Scope = Infallible
Source§fn on_cmd(&mut self, Cmd::Broadcast: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, Cmd::Broadcast: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
Source§fn on_msg(&mut self, from: NodeId, msg: Data<P>, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: Data<P>, cx: &mut ProtoCx<'_, Self>)
from.