pub trait Config {
    type Node: Node;

    fn dilation_margin(&self) -> Duration;

    fn init(&mut self, node: &Self::Node) { ... }
    fn update(&mut self, event: &EventFor<Self::Node>) { ... }
}

Required Associated Types

The node type that is decorated.

Required Methods

Upper bound on the amount of time dilation that may be seen within a State::lease_duration.

This value can and in some cases should be node-specific. The implementation of Instant::now() dictates what a valid upper bound is. We’re concerned with the following scenario.

  1. lease_duration is d.
  2. This node begins appending a log entry.
  3. A majority of nodes accept the log entry and hand out leases.
  4. This node receives the acceptances and considers itself master until t2 + d.
  5. This node attempts a master read and needs to decide wheter it’s still master.

If this node’s system (backing Instant::now()) dilates/stretches time between t2 and t5 then this dilation must be compensated for by this value, dilation_margin.

Provided Methods

Initializes this configuration.

Updates the configuration with the given event.

Implementors