FaultDetection

Struct FaultDetection 

Source
pub struct FaultDetection {
    pub communication_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub dkg_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub elder_voting_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub probe_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub network_knowledge_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub unfulfilled_ops: BTreeMap<XorName, VecDeque<Instant>>,
    /* private fields */
}
Expand description

Faulty nodes tracking. Allows various potential issues to be tracked and weighted, with unresposive or suspect nodes being noted on request, against which action can then be taken.

Fields§

§communication_issues: BTreeMap<XorName, VecDeque<Instant>>

The communication issues logged against a node, along with a timestamp.

§dkg_issues: BTreeMap<XorName, VecDeque<Instant>>

The dkg issues logged against a node, along with a timestamp to expire after some time.

§elder_voting_issues: BTreeMap<XorName, VecDeque<Instant>>

The elder voting issues logged against a node, along with a timestamp to expire after some time.

§probe_issues: BTreeMap<XorName, VecDeque<Instant>>

The probe issues logged against a node and as yet unfulfilled, along with a timestamp to expire after some time.

§network_knowledge_issues: BTreeMap<XorName, VecDeque<Instant>>

The network knowledge issues logged against a node, along with a timestamp.

§unfulfilled_ops: BTreeMap<XorName, VecDeque<Instant>>

The unfulfilled pending request operation issues logged against a node, along with an operation ID.

Implementations§

Source§

impl FaultDetection

Source

pub fn calculate_scores( &self, nodes_in_question: &BTreeSet<XorName>, ) -> ScoreResults

Calculate the scores of all nodes being tracked and return them in a node -> score map. There is a map for each type of issue.

The ‘score’ for a node is the number of issues logged against that node, minus the average of the number of issues at all the other nodes.

These scores can then be used to highlight nodes that have a higher score than some particular ratio.

Source

pub fn get_faulty_nodes(&mut self) -> Vec<XorName>

Get a list of nodes that are faulty (the nodes must all ProposeOffline over a faulty node and then immediately vote it off. So any other membershipn changes in flight could block this. thus, we need to be callling this function often until nodes are removed.)

The vec is ordered from fauliest to least faulty (returning faulty elders first)

Source§

impl FaultDetection

Source

pub fn new( non_elder_nodes: BTreeSet<XorName>, elders: BTreeSet<XorName>, ) -> Self

Set up a new tracker.

Source

pub fn track_issue(&mut self, node_id: XorName, issue_type: IssueType)

Adds an issue to the fault tracker.

The op_id only applies when adding an operational issue.

Source

pub fn dkg_ack_fulfilled(&mut self, node_id: &XorName)

Removes a DKG session from the node liveness records.

Source

pub fn elder_vote_received(&mut self, node_id: &XorName)

Removes a Knowledge issue from the node liveness records.

Source

pub fn ae_update_msg_received(&mut self, node_id: &XorName)

Removes a probe tracker from the node liveness records.

Source

pub fn add_new_node(&mut self, node: XorName)

Add a new node to the tracker and recompute closest nodes.

Source

pub fn update_and_only_retain_members( &mut self, non_elder_nodes: BTreeSet<XorName>, elders: BTreeSet<XorName>, )

Removes tracked nodes not present in current_members.

Tracked issues related to nodes that were removed will also be removed.

Trait Implementations§

Source§

impl Clone for FaultDetection

Source§

fn clone(&self) -> FaultDetection

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FaultDetection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more