MySQL 8.0.39
Source Code Documentation
|
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_progress & | operator= (Gcs_xcom_expels_in_progress const &)=default |
Gcs_xcom_expels_in_progress & | operator= (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 |
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.
|
default |
|
default |
|
default |
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
.
xcom_nodes | XCom view |
true | if all expels in progress are for members in xcom_nodes |
false | otherwise |
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
.
member | member to check |
synode | XCom configuration to check |
true | there is an expel in progress for member issued during the configuration identified by synode |
false | otherwise |
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
.
config_id_where_members_left | XCom configuration where the nodes left |
members_that_left | nodes that left |
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.
suspected_members | suspected nodes that are members in the current GCS view |
suspected_nonmembers | suspected nodes that are not yet members in the current GCS view |
|
default |
|
default |
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.
config_id_where_expels_were_issued | XCom configuration that triggered the expel |
expels_issued | members expelled |
std::size_t Gcs_xcom_expels_in_progress::size | ( | ) | const |
How many expels are in progress.
|
private |