MySQL 8.0.39
Source Code Documentation
|
This class stores all node suspicions, as well as the timeout and period parameters used by the thread that processes the suspicions. More...
#include <gcs_xcom_control_interface.h>
Public Member Functions | |
Gcs_suspicions_manager (Gcs_xcom_proxy *proxy, Gcs_xcom_control *ctrl) | |
Constructor for Gcs_suspicions_manager, which sets m_proxy with the received pointer parameter. More... | |
~Gcs_suspicions_manager () | |
Destructor for Gcs_suspicions_manager. More... | |
void | process_view (synode_no const config_id, Gcs_xcom_nodes *xcom_nodes, std::vector< Gcs_member_identifier * > alive_nodes, std::vector< Gcs_member_identifier * > left_nodes, std::vector< Gcs_member_identifier * > member_suspect_nodes, std::vector< Gcs_member_identifier * > non_member_suspect_nodes, bool is_killer_node, synode_no max_synode) |
Invoked by Gcs_xcom_control::xcom_receive_global_view, it invokes the remove_suspicions method for the alive_nodes and left_nodes parameters, if they're not empty, neither m_suspicions. More... | |
void | process_suspicions () |
Invoked periodically by the suspicions processing thread, it picks a timestamp and verifies which suspect nodes should be removed as they have timed out. More... | |
void | clear_suspicions () |
Clear all suspicions. More... | |
void | run_process_suspicions (bool lock) |
Invoked periodically by the suspicions processing thread, it picks a timestamp and verifies which suspect nodes should be removed as they have timed out. More... | |
const Gcs_xcom_nodes & | get_suspicions () const |
Retrieves current list of suspicions. More... | |
unsigned int | get_suspicions_processing_period () |
Retrieves suspicion thread period in seconds. More... | |
void | set_suspicions_processing_period (unsigned int sec) |
Sets the period or sleep time, between iterations, for the suspicion thread. More... | |
uint64_t | get_non_member_expel_timeout () |
Retrieves non-member expel timeout in 100s of nanoseconds. More... | |
void | set_non_member_expel_timeout_seconds (unsigned long sec) |
Sets the time interval to wait before removing non-member nodes marked to be expelled from the cluster. More... | |
uint64_t | get_member_expel_timeout () |
Retrieves member expel timeout in 100s of nanoseconds. More... | |
void | set_member_expel_timeout_seconds (unsigned long sec) |
Sets the time interval to wait before removing member nodes marked to be expelled from the cluster. More... | |
void | set_groupid_hash (unsigned int gid_h) |
Sets the hash for the current group identifier. More... | |
void | set_my_info (Gcs_xcom_node_information *node_info) |
Sets the information for this node. More... | |
void | wake_suspicions_processing_thread (bool terminate) |
Auxiliary method to wake the suspicions processing thread and set if it should terminate or not. More... | |
void | inform_on_majority (bool majority) |
Auxiliary method to inform the suspicions manager that this node is in a group with the majority of the configured nodes. More... | |
bool | has_majority () |
Auxiliary method to retrieve if the suspicions manager has the majority enabled. More... | |
void | update_last_removed (synode_no last_removed) |
Private Member Functions | |
void | remove_suspicions (std::vector< Gcs_member_identifier * > nodes) |
Invoked by Gcs_suspicions_manager::process_view, it verifies if any of the nodes in the received list was a suspect and removes it from m_suspicions. More... | |
bool | add_suspicions (Gcs_xcom_nodes *xcom_nodes, std::vector< Gcs_member_identifier * > non_member_suspect_nodes, std::vector< Gcs_member_identifier * > member_suspect_nodes, synode_no max_synode) |
Invoked by Gcs_suspicions_manager::process_view, it adds suspicions for the nodes received as argument if they aren't already suspects. More... | |
Gcs_suspicions_manager (Gcs_suspicions_manager const &) | |
Gcs_suspicions_manager & | operator= (Gcs_suspicions_manager const &) |
Private Attributes | |
Gcs_xcom_proxy * | m_proxy |
Gcs_xcom_control * | m_control_if |
unsigned int | m_suspicions_processing_period |
uint64_t | m_non_member_expel_timeout |
uint64_t | m_member_expel_timeout |
unsigned int | m_gid_hash |
Gcs_xcom_nodes | m_suspicions |
My_xp_mutex_impl | m_suspicions_mutex |
My_xp_cond_impl | m_suspicions_cond |
My_xp_mutex_impl | m_suspicions_parameters_mutex |
bool | m_is_killer_node |
Gcs_xcom_node_information * | m_my_info |
bool | m_has_majority |
synode_no | m_cache_last_removed |
Gcs_xcom_expels_in_progress | m_expels_in_progress |
synode_no | m_config_id |
This class stores all node suspicions, as well as the timeout and period parameters used by the thread that processes the suspicions.
Suspicions are added and removed upon reception of a new global view.
|
explicit |
Constructor for Gcs_suspicions_manager, which sets m_proxy with the received pointer parameter.
[in] | proxy | Pointer to Gcs_xcom_proxy |
[in] | ctrl | Pointer to Gcs_xcom_control |
Gcs_suspicions_manager::~Gcs_suspicions_manager | ( | ) |
Destructor for Gcs_suspicions_manager.
|
private |
|
private |
Invoked by Gcs_suspicions_manager::process_view, it adds suspicions for the nodes received as argument if they aren't already suspects.
[in] | xcom_nodes | List of all nodes (i.e. alive or dead) with low level information such as timestamp, unique identifier, etc |
[in] | non_member_suspect_nodes | List of joining nodes to add to m_suspicions |
[in] | member_suspect_nodes | List of previously active nodes to add to m_suspicions |
[in] | max_synode | XCom max synode |
void Gcs_suspicions_manager::clear_suspicions | ( | ) |
Clear all suspicions.
Invoked when node is leaving the group.
uint64_t Gcs_suspicions_manager::get_member_expel_timeout | ( | ) |
Retrieves member expel timeout in 100s of nanoseconds.
uint64_t Gcs_suspicions_manager::get_non_member_expel_timeout | ( | ) |
Retrieves non-member expel timeout in 100s of nanoseconds.
const Gcs_xcom_nodes & Gcs_suspicions_manager::get_suspicions | ( | ) | const |
Retrieves current list of suspicions.
unsigned int Gcs_suspicions_manager::get_suspicions_processing_period | ( | ) |
Retrieves suspicion thread period in seconds.
bool Gcs_suspicions_manager::has_majority | ( | ) |
Auxiliary method to retrieve if the suspicions manager has the majority enabled.
void Gcs_suspicions_manager::inform_on_majority | ( | bool | majority | ) |
Auxiliary method to inform the suspicions manager that this node is in a group with the majority of the configured nodes.
[in] | majority | Signals if the group has the majority of the nodes alive |
|
private |
void Gcs_suspicions_manager::process_suspicions | ( | ) |
Invoked periodically by the suspicions processing thread, it picks a timestamp and verifies which suspect nodes should be removed as they have timed out.
void Gcs_suspicions_manager::process_view | ( | synode_no const | config_id, |
Gcs_xcom_nodes * | xcom_nodes, | ||
std::vector< Gcs_member_identifier * > | alive_nodes, | ||
std::vector< Gcs_member_identifier * > | left_nodes, | ||
std::vector< Gcs_member_identifier * > | member_suspect_nodes, | ||
std::vector< Gcs_member_identifier * > | non_member_suspect_nodes, | ||
bool | is_killer_node, | ||
synode_no | max_synode | ||
) |
Invoked by Gcs_xcom_control::xcom_receive_global_view, it invokes the remove_suspicions method for the alive_nodes and left_nodes parameters, if they're not empty, neither m_suspicions.
It also invokes the add_suspicions method if the non_member_suspect_nodes and member_suspect_nodes parameter aren't empty.
[in] | config_id | Configuration ID of the subsequent node information |
[in] | xcom_nodes | List of all nodes (i.e. alive or dead) with low level information such as timestamp, unique identifier, etc |
[in] | alive_nodes | List of the nodes that currently belong to the group |
[in] | left_nodes | List of the nodes that have left the group |
[in] | non_member_suspect_nodes | List of joining nodes to add to m_suspicions |
[in] | member_suspect_nodes | List of previously active nodes to add to m_suspicions |
[in] | is_killer_node | Indicates if node should remove suspect members from the group |
[in] | max_synode | XCom max synode |
|
private |
Invoked by Gcs_suspicions_manager::process_view, it verifies if any of the nodes in the received list was a suspect and removes it from m_suspicions.
[in] | nodes | List of nodes to remove from m_suspicions |
void Gcs_suspicions_manager::run_process_suspicions | ( | bool | lock | ) |
Invoked periodically by the suspicions processing thread, it picks a timestamp and verifies which suspect nodes should be removed as they have timed out.
[in] | lock | Whether lock should be acquired or not |
void Gcs_suspicions_manager::set_groupid_hash | ( | unsigned int | gid_h | ) |
Sets the hash for the current group identifier.
[in] | gid_h | Group ID hash |
void Gcs_suspicions_manager::set_member_expel_timeout_seconds | ( | unsigned long | sec | ) |
Sets the time interval to wait before removing member nodes marked to be expelled from the cluster.
[in] | sec | Expel suspicions timeout in seconds |
void Gcs_suspicions_manager::set_my_info | ( | Gcs_xcom_node_information * | node_info | ) |
Sets the information for this node.
[in] | node_info | Information on this node |
void Gcs_suspicions_manager::set_non_member_expel_timeout_seconds | ( | unsigned long | sec | ) |
Sets the time interval to wait before removing non-member nodes marked to be expelled from the cluster.
[in] | sec | Suspicions timeout in seconds |
void Gcs_suspicions_manager::set_suspicions_processing_period | ( | unsigned int | sec | ) |
Sets the period or sleep time, between iterations, for the suspicion thread.
[in] | sec | Suspicion thread period |
void Gcs_suspicions_manager::update_last_removed | ( | synode_no | last_removed | ) |
void Gcs_suspicions_manager::wake_suspicions_processing_thread | ( | bool | terminate | ) |
Auxiliary method to wake the suspicions processing thread and set if it should terminate or not.
[in] | terminate | Signals if thread should terminate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |