Skip to main content

Coherent

Trait Coherent 

Source
pub trait Coherent<ID, Other>
where ID: PartialOrd + Ord + 'static, Self: QuorumSet<Id = ID>, Other: QuorumSet<Id = ID>,
{ // Required method fn is_coherent_with(&self, other: &Other) -> bool; }
Expand description

Relation between quorum sets whose quorums always intersect.

Coherent quorum set A and B is defined as: ∀ qᵢ ∈ A, ∀ qⱼ ∈ B: qᵢ ∩ qⱼ != ø, i.e., A ~ B. In words, every quorum in A intersects every quorum in B. Consensus protocols use this relation to make membership changes without losing overlap between old and new decisions.

In a Raft-style membership change, coherence is one safety requirement. The protocol also has to prevent an old, smaller candidate from being elected during the transition.

Required Methods§

Source

fn is_coherent_with(&self, other: &Other) -> bool

Return true if this quorum set is coherent with the other quorum set.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<NID> Coherent<NID, Vec<BTreeSet<NID>>> for Vec<BTreeSet<NID>>
where NID: PartialOrd + Ord + Clone + 'static,

Two joint configs are coherent iff they share at least one config: then every quorum of one intersects every quorum of the other.

Source§

fn is_coherent_with(&self, other: &Vec<BTreeSet<NID>>) -> bool

Return true when two joint quorum sets share a config.

Read more about extended membership change in OpenRaft: https://docs.rs/openraft/latest/openraft/docs/data/extended_membership/index.html

Implementors§