pub struct DysfunctionDetection {
    pub communication_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub dkg_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub probe_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub knowledge_issues: BTreeMap<XorName, VecDeque<Instant>>,
    pub unfulfilled_ops: BTreeMap<XorName, Vec<(OperationId, Instant)>>,
    /* private fields */
}
Expand description

Dysfunctional node 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.

§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.

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

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

§unfulfilled_ops: BTreeMap<XorName, Vec<(OperationId, Instant)>>

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

Implementations§

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.

Get a list of nodes whose score is DYSFUNCTION_SCORE_THRESHOLD TODO: order these to act upon most dysfunctional first (the nodes must all ProposeOffline over a dysfunctional 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.)

Set up a new Dysfunctional Node Tracker.

Adds an issue to the dysfunction tracker.

The op_id only applies when adding an operational issue.

Removes a pending_operation from the node liveness records. Returns true if a record was removed

Removes a DKG session from the node liveness records.

Removes a probe tracker from the node liveness records.

Gets the unfulfilled operation IDs for a given node.

This is for convenience, to wrap reading the concurrent data structure that stores the values.

If there are no unfulfilled operations tracked, an empty list will be returned.

List all current tracked nodes

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

Removes tracked nodes not present in current_members.

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

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more