MySQL 9.1.0
Source Code Documentation
Gcs_xcom_expels_in_progress Class Reference

The set of expels we have issued but that have not yet taken effect. More...

#include <gcs_xcom_expels_in_progress.h>

Public Member Functions

 Gcs_xcom_expels_in_progress ()=default
 
 Gcs_xcom_expels_in_progress (Gcs_xcom_expels_in_progress const &)=default
 
 Gcs_xcom_expels_in_progress (Gcs_xcom_expels_in_progress &&)=default
 
Gcs_xcom_expels_in_progressoperator= (Gcs_xcom_expels_in_progress const &)=default
 
Gcs_xcom_expels_in_progressoperator= (Gcs_xcom_expels_in_progress &&)=default
 
void remember_expels_issued (synode_no const config_id_where_expels_were_issued, Gcs_xcom_nodes const &expels_issued)
 Keep track of members we expelled expels_issued together with the XCom configuration config_id_where_expels_were_issued that triggered the expel. More...
 
void forget_expels_that_have_taken_effect (synode_no const config_id_where_members_left, std::vector< Gcs_member_identifier * > const &members_that_left)
 Forget about any expel we issued for the nodes in members_that_left that have taken effect in the XCom configuration identified by config_id_where_members_left. More...
 
std::size_t number_of_expels_not_about_suspects (std::vector< Gcs_member_identifier * > const &suspected_members, std::vector< Gcs_member_identifier * > const &suspected_nonmembers) const
 How many of the expels in progress do not pertain to suspected nodes. More...
 
bool all_still_in_view (Gcs_xcom_nodes const &xcom_nodes) const
 Whether all expels in progress are for members in xcom_nodes. More...
 
std::size_t size () const
 How many expels are in progress. More...
 
bool contains (Gcs_member_identifier const &member, synode_no const synode) const
 Whether there is an expel in progress for member issued during the XCom configuration identified by synode. More...
 

Private Attributes

std::vector< std::pair< Gcs_member_identifier, synode_no > > m_expels_in_progress
 

Detailed Description

The set of expels we have issued but that have not yet taken effect.

An expel is identified as the pair (m, c), which means that we expelled the member m based on view(s) pertaining to the XCom configuration/membership c.

Whenever we issue the expel of some member m, we take note in this structure; see remember_expels_issued.

Whenever we process a view where some member m that we have expelled is no longer present, we remove m from this structure; see forget_expels_that_have_taken_effect.

Please note that we keep track of the configuration ID c where we expelled m to guard against the possibility of removing m from this structure due to receiving a view "from the past," e.g. receiving a view from configuration b < c where m is not a member, after having expelled m due to views from configuration c. It is unclear whether XCom can sometimes deliver views "from the past," so we account for this situation by only removing m from this structure if we receive a view from a configuration d > c where m is no longer present.

Constructor & Destructor Documentation

◆ Gcs_xcom_expels_in_progress() [1/3]

Gcs_xcom_expels_in_progress::Gcs_xcom_expels_in_progress ( )
default

◆ Gcs_xcom_expels_in_progress() [2/3]

Gcs_xcom_expels_in_progress::Gcs_xcom_expels_in_progress ( Gcs_xcom_expels_in_progress const &  )
default

◆ Gcs_xcom_expels_in_progress() [3/3]

Gcs_xcom_expels_in_progress::Gcs_xcom_expels_in_progress ( Gcs_xcom_expels_in_progress &&  )
default

Member Function Documentation

◆ all_still_in_view()

bool Gcs_xcom_expels_in_progress::all_still_in_view ( Gcs_xcom_nodes const &  xcom_nodes) const

Whether all expels in progress are for members in xcom_nodes.

Parameters
xcom_nodesXCom view
Return values
trueif all expels in progress are for members in xcom_nodes
falseotherwise

◆ contains()

bool Gcs_xcom_expels_in_progress::contains ( Gcs_member_identifier const &  member,
synode_no const  synode 
) const

Whether there is an expel in progress for member issued during the XCom configuration identified by synode.

Parameters
membermember to check
synodeXCom configuration to check
Return values
truethere is an expel in progress for member issued during the configuration identified by synode
falseotherwise

◆ forget_expels_that_have_taken_effect()

void Gcs_xcom_expels_in_progress::forget_expels_that_have_taken_effect ( synode_no const  config_id_where_members_left,
std::vector< Gcs_member_identifier * > const &  members_that_left 
)

Forget about any expel we issued for the nodes in members_that_left that have taken effect in the XCom configuration identified by config_id_where_members_left.

Parameters
config_id_where_members_leftXCom configuration where the nodes left
members_that_leftnodes that left

◆ number_of_expels_not_about_suspects()

std::size_t Gcs_xcom_expels_in_progress::number_of_expels_not_about_suspects ( std::vector< Gcs_member_identifier * > const &  suspected_members,
std::vector< Gcs_member_identifier * > const &  suspected_nonmembers 
) const

How many of the expels in progress do not pertain to suspected nodes.

Parameters
suspected_memberssuspected nodes that are members in the current GCS view
suspected_nonmemberssuspected nodes that are not yet members in the current GCS view
Returns
how many of the expels in progress do not pertain to suspected nodes

◆ operator=() [1/2]

Gcs_xcom_expels_in_progress & Gcs_xcom_expels_in_progress::operator= ( Gcs_xcom_expels_in_progress &&  )
default

◆ operator=() [2/2]

Gcs_xcom_expels_in_progress & Gcs_xcom_expels_in_progress::operator= ( Gcs_xcom_expels_in_progress const &  )
default

◆ remember_expels_issued()

void Gcs_xcom_expels_in_progress::remember_expels_issued ( synode_no const  config_id_where_expels_were_issued,
Gcs_xcom_nodes const &  expels_issued 
)

Keep track of members we expelled expels_issued together with the XCom configuration config_id_where_expels_were_issued that triggered the expel.

Parameters
config_id_where_expels_were_issuedXCom configuration that triggered the expel
expels_issuedmembers expelled

◆ size()

std::size_t Gcs_xcom_expels_in_progress::size ( ) const

How many expels are in progress.

Returns
how many expels are in progress

Member Data Documentation

◆ m_expels_in_progress

std::vector<std::pair<Gcs_member_identifier, synode_no> > Gcs_xcom_expels_in_progress::m_expels_in_progress
private

The documentation for this class was generated from the following files: