MySQL 8.3.0
Source Code Documentation
Gcs_suspicions_manager Class Reference

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_nodesget_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_manageroperator= (Gcs_suspicions_manager const &)
 

Private Attributes

Gcs_xcom_proxym_proxy
 
Gcs_xcom_controlm_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_informationm_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Gcs_suspicions_manager() [1/2]

Gcs_suspicions_manager::Gcs_suspicions_manager ( Gcs_xcom_proxy proxy,
Gcs_xcom_control ctrl 
)
explicit

Constructor for Gcs_suspicions_manager, which sets m_proxy with the received pointer parameter.

Parameters
[in]proxyPointer to Gcs_xcom_proxy
[in]ctrlPointer to Gcs_xcom_control

◆ ~Gcs_suspicions_manager()

Gcs_suspicions_manager::~Gcs_suspicions_manager ( )

Destructor for Gcs_suspicions_manager.

◆ Gcs_suspicions_manager() [2/2]

Gcs_suspicions_manager::Gcs_suspicions_manager ( Gcs_suspicions_manager const &  )
private

Member Function Documentation

◆ add_suspicions()

bool Gcs_suspicions_manager::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 
)
private

Invoked by Gcs_suspicions_manager::process_view, it adds suspicions for the nodes received as argument if they aren't already suspects.

Parameters
[in]xcom_nodesList of all nodes (i.e. alive or dead) with low level information such as timestamp, unique identifier, etc
[in]non_member_suspect_nodesList of joining nodes to add to m_suspicions
[in]member_suspect_nodesList of previously active nodes to add to m_suspicions
[in]max_synodeXCom max synode
Returns
Indicates if new suspicions were added

◆ clear_suspicions()

void Gcs_suspicions_manager::clear_suspicions ( )

Clear all suspicions.

Invoked when node is leaving the group.

◆ get_member_expel_timeout()

uint64_t Gcs_suspicions_manager::get_member_expel_timeout ( )

Retrieves member expel timeout in 100s of nanoseconds.

Returns
Member expel timeout

◆ get_non_member_expel_timeout()

uint64_t Gcs_suspicions_manager::get_non_member_expel_timeout ( )

Retrieves non-member expel timeout in 100s of nanoseconds.

Returns
Non-member expel timeout

◆ get_suspicions()

const Gcs_xcom_nodes & Gcs_suspicions_manager::get_suspicions ( ) const

Retrieves current list of suspicions.

◆ get_suspicions_processing_period()

unsigned int Gcs_suspicions_manager::get_suspicions_processing_period ( )

Retrieves suspicion thread period in seconds.

◆ has_majority()

bool Gcs_suspicions_manager::has_majority ( )

Auxiliary method to retrieve if the suspicions manager has the majority enabled.

Returns
majority

◆ inform_on_majority()

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.

Parameters
[in]majoritySignals if the group has the majority of the nodes alive

◆ operator=()

Gcs_suspicions_manager & Gcs_suspicions_manager::operator= ( Gcs_suspicions_manager const &  )
private

◆ process_suspicions()

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.

◆ process_view()

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.

Parameters
[in]config_idConfiguration ID of the subsequent node information
[in]xcom_nodesList of all nodes (i.e. alive or dead) with low level information such as timestamp, unique identifier, etc
[in]alive_nodesList of the nodes that currently belong to the group
[in]left_nodesList of the nodes that have left the group
[in]non_member_suspect_nodesList of joining nodes to add to m_suspicions
[in]member_suspect_nodesList of previously active nodes to add to m_suspicions
[in]is_killer_nodeIndicates if node should remove suspect members from the group
[in]max_synodeXCom max synode

◆ remove_suspicions()

void Gcs_suspicions_manager::remove_suspicions ( std::vector< Gcs_member_identifier * >  nodes)
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.

Parameters
[in]nodesList of nodes to remove from m_suspicions

◆ run_process_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.

Parameters
[in]lockWhether lock should be acquired or not

◆ set_groupid_hash()

void Gcs_suspicions_manager::set_groupid_hash ( unsigned int  gid_h)

Sets the hash for the current group identifier.

Parameters
[in]gid_hGroup ID hash

◆ set_member_expel_timeout_seconds()

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.

Parameters
[in]secExpel suspicions timeout in seconds

◆ set_my_info()

void Gcs_suspicions_manager::set_my_info ( Gcs_xcom_node_information node_info)

Sets the information for this node.

Parameters
[in]node_infoInformation on this node

◆ set_non_member_expel_timeout_seconds()

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.

Parameters
[in]secSuspicions timeout in seconds

◆ set_suspicions_processing_period()

void Gcs_suspicions_manager::set_suspicions_processing_period ( unsigned int  sec)

Sets the period or sleep time, between iterations, for the suspicion thread.

Parameters
[in]secSuspicion thread period

◆ update_last_removed()

void Gcs_suspicions_manager::update_last_removed ( synode_no  last_removed)

◆ wake_suspicions_processing_thread()

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.

Parameters
[in]terminateSignals if thread should terminate

Member Data Documentation

◆ m_cache_last_removed

synode_no Gcs_suspicions_manager::m_cache_last_removed
private

◆ m_config_id

synode_no Gcs_suspicions_manager::m_config_id
private

◆ m_control_if

Gcs_xcom_control* Gcs_suspicions_manager::m_control_if
private

◆ m_expels_in_progress

Gcs_xcom_expels_in_progress Gcs_suspicions_manager::m_expels_in_progress
private

◆ m_gid_hash

unsigned int Gcs_suspicions_manager::m_gid_hash
private

◆ m_has_majority

bool Gcs_suspicions_manager::m_has_majority
private

◆ m_is_killer_node

bool Gcs_suspicions_manager::m_is_killer_node
private

◆ m_member_expel_timeout

uint64_t Gcs_suspicions_manager::m_member_expel_timeout
private

◆ m_my_info

Gcs_xcom_node_information* Gcs_suspicions_manager::m_my_info
private

◆ m_non_member_expel_timeout

uint64_t Gcs_suspicions_manager::m_non_member_expel_timeout
private

◆ m_proxy

Gcs_xcom_proxy* Gcs_suspicions_manager::m_proxy
private

◆ m_suspicions

Gcs_xcom_nodes Gcs_suspicions_manager::m_suspicions
private

◆ m_suspicions_cond

My_xp_cond_impl Gcs_suspicions_manager::m_suspicions_cond
private

◆ m_suspicions_mutex

My_xp_mutex_impl Gcs_suspicions_manager::m_suspicions_mutex
private

◆ m_suspicions_parameters_mutex

My_xp_mutex_impl Gcs_suspicions_manager::m_suspicions_parameters_mutex
private

◆ m_suspicions_processing_period

unsigned int Gcs_suspicions_manager::m_suspicions_processing_period
private

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