MySQL 26.10.0
Source Code Documentation
gcs_xcom_control_interface.cc File Reference

Classes

struct  Gcs_member_identifier_pointer_comparator
 

Functions

static void set_terminate_suspicion_thread (bool val)
 
static bool is_terminate_suspicion_thread ()
 
static void * suspicions_processing_thread (void *ptr)
 
static void * xcom_taskmain_startup (void *ptr)
 
void do_function_join (Gcs_control_interface *control_if)
 
static bool skip_own_peer_address (std::string const &peer_address, int peer_port)
 Check whether a peer endpoint should be skipped because it identifies this node itself. More...
 
static bool has_configured_xcom_identity ()
 Check whether an explicit XCom identity is currently configured. More...
 
static bool get_self_addresses (Gcs_sock_probe_interface &sock_probe_interface, int local_port, std::set< std::string > &self_addresses)
 Prepare this node's cached self-addresses once for the join path. More...
 
static bool skip_own_peer_address (std::set< std::string > const &self_addresses, int local_port, std::string const &peer_address, int peer_port)
 Check whether a peer endpoint should be skipped during join. More...
 
static constexpr const char * get_signaling_error ()
 
static std::string get_connection_test_error (const std::string &address, int port)
 
void do_function_leave (Gcs_control_interface *control_if)
 

Variables

static const uint64_t NON_MEMBER_EXPEL_TIMEOUT = 60 * 10000000
 
static const unsigned int SUSPICION_PROCESSING_THREAD_PERIOD = 15
 
static bool terminate_suspicion_thread = false
 

Function Documentation

◆ do_function_join()

void do_function_join ( Gcs_control_interface *  control_if)

◆ do_function_leave()

void do_function_leave ( Gcs_control_interface *  control_if)

◆ get_connection_test_error()

static std::string get_connection_test_error ( const std::string &  address,
int  port 
)
static

◆ get_self_addresses()

static bool get_self_addresses ( Gcs_sock_probe_interface &  sock_probe_interface,
int  local_port,
std::set< std::string > &  self_addresses 
)
static

Prepare this node's cached self-addresses once for the join path.

This helper follows the configured-identity branch used by the patch:

  • when an explicit XCom identity exists, only that endpoint is parsed and prepared, and local interfaces are not inspected;
  • otherwise, local interface addresses are collected once through the existing networking helper.

The work is performed after switching to the configured network namespace, if any.

When the configured identity cannot be parsed, or its configured port does not match local_port, the helper returns with self_addresses still empty. When parsing succeeds but hostname resolution fails, the helper keeps the configured textual host/IP in self_addresses and simply omits any additional resolved aliases.

Parameters
[in]sock_probe_interfaceInterface used to enumerate local addresses when no XCom identity is configured.
[in]local_portLocal XCom port for this join attempt.
[out]self_addressesCached textual self-addresses for join-time own-peer filtering.
Return values
falseSelf-address preparation completed.
trueLocal-interface enumeration failed in the no-identity branch.

◆ get_signaling_error()

static constexpr const char * get_signaling_error ( )
staticconstexpr

◆ has_configured_xcom_identity()

static bool has_configured_xcom_identity ( )
inlinestatic

Check whether an explicit XCom identity is currently configured.

Return values
trueXCom identity is configured and contains an address.
falseXCom identity is not configured or does not contain an address.

◆ is_terminate_suspicion_thread()

static bool is_terminate_suspicion_thread ( )
static

◆ set_terminate_suspicion_thread()

static void set_terminate_suspicion_thread ( bool  val)
static

◆ skip_own_peer_address() [1/2]

static bool skip_own_peer_address ( std::set< std::string > const &  self_addresses,
int  local_port,
std::string const &  peer_address,
int  peer_port 
)
static

Check whether a peer endpoint should be skipped during join.

This preserves the pre-patch join behavior:

  • if the peer address cannot be resolved, emit a warning and skip it;
  • otherwise, classify the peer as self only when its port matches the local port and one of its resolved aliases matches the cached self-address set.
Parameters
[in]self_addressesCached textual self-addresses for the current join attempt.
[in]local_portLocal XCom port for this join attempt.
[in]peer_addressPeer host/IP text to classify.
[in]peer_portPeer XCom port to classify.
Return values
trueThe peer should be skipped either because it could not be resolved or because it matches this node itself.
falseThe peer should not be skipped.

◆ skip_own_peer_address() [2/2]

static bool skip_own_peer_address ( std::string const &  peer_address,
int  peer_port 
)
static

Check whether a peer endpoint should be skipped because it identifies this node itself.

This helper delegates the self-classification decision to xcom_mynode_match() using the peer host/IP and port.

Parameters
[in]peer_addressThe peer host or IP address to classify.
[in]peer_portThe peer XCom port to classify.
Return values
trueThe peer endpoint was classified as this node itself and should be skipped.
falseThe peer endpoint was not classified as this node itself and should not be skipped.

◆ suspicions_processing_thread()

static void * suspicions_processing_thread ( void *  ptr)
static

◆ xcom_taskmain_startup()

static void * xcom_taskmain_startup ( void *  ptr)
static

Variable Documentation

◆ NON_MEMBER_EXPEL_TIMEOUT

const uint64_t NON_MEMBER_EXPEL_TIMEOUT = 60 * 10000000
static

◆ SUSPICION_PROCESSING_THREAD_PERIOD

const unsigned int SUSPICION_PROCESSING_THREAD_PERIOD = 15
static

◆ terminate_suspicion_thread

bool terminate_suspicion_thread = false
static