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
impl FaultDetection
Sourcepub fn calculate_scores(
&self,
nodes_in_question: &BTreeSet<XorName>,
) -> ScoreResults
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.
Sourcepub fn get_faulty_nodes(&mut self) -> Vec<XorName>
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
impl FaultDetection
Sourcepub fn new(
non_elder_nodes: BTreeSet<XorName>,
elders: BTreeSet<XorName>,
) -> Self
pub fn new( non_elder_nodes: BTreeSet<XorName>, elders: BTreeSet<XorName>, ) -> Self
Set up a new tracker.
Sourcepub fn track_issue(&mut self, node_id: XorName, issue_type: IssueType)
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.
Sourcepub fn dkg_ack_fulfilled(&mut self, node_id: &XorName)
pub fn dkg_ack_fulfilled(&mut self, node_id: &XorName)
Removes a DKG session from the node liveness records.
Sourcepub fn elder_vote_received(&mut self, node_id: &XorName)
pub fn elder_vote_received(&mut self, node_id: &XorName)
Removes a Knowledge issue from the node liveness records.
Sourcepub fn ae_update_msg_received(&mut self, node_id: &XorName)
pub fn ae_update_msg_received(&mut self, node_id: &XorName)
Removes a probe tracker from the node liveness records.
Sourcepub fn add_new_node(&mut self, node: XorName)
pub fn add_new_node(&mut self, node: XorName)
Add a new node to the tracker and recompute closest nodes.
Trait Implementations§
Source§impl Clone for FaultDetection
impl Clone for FaultDetection
Source§fn clone(&self) -> FaultDetection
fn clone(&self) -> FaultDetection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FaultDetection
impl RefUnwindSafe for FaultDetection
impl Send for FaultDetection
impl Sync for FaultDetection
impl Unpin for FaultDetection
impl UnwindSafe for FaultDetection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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