MySQL 8.0.40
Source Code Documentation
|
#include <gcs_xcom_proxy.h>
Public Member Functions | |
Gcs_xcom_proxy_impl () | |
Gcs_xcom_proxy_impl (unsigned int wt) | |
~Gcs_xcom_proxy_impl () override | |
node_address * | new_node_address_uuid (unsigned int n, char const *names[], blob uuids[]) override |
This is an utility member function that is used to call into XCom for creating list with node's addresses and their associated UUIDs. More... | |
void | delete_node_address (unsigned int n, node_address *na) override |
This function is responsible to delete the list of nodes that had been previously created by new_node_address . More... | |
bool | xcom_client_add_node (connection_descriptor *fd, node_list *nl, uint32_t group_id) override |
This member function is responsible to call into XCom consensus and add a node to the group. More... | |
bool | xcom_client_remove_node (node_list *nl, uint32_t group_id) override |
This member function is responsible for triggering the removal of a node from the XCom configuration. More... | |
bool | xcom_client_remove_node (connection_descriptor *fd, node_list *nl, uint32_t group_id) override |
This member function is responsible for triggering the removal of a node from the XCom configuration. More... | |
bool | xcom_client_get_event_horizon (uint32_t group_id, xcom_event_horizon &event_horizon) override |
This member function is responsible for retrieving the event horizon of the XCom configuration. More... | |
bool | xcom_client_set_event_horizon (uint32_t group_id, xcom_event_horizon event_horizon) override |
This member function is responsible for triggering the reconfiguration of the event horizon of the XCom configuration. More... | |
bool | xcom_client_set_leaders (uint32_t gid, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders) override |
This member function is responsible for triggering the reconfiguration of the leaders of the XCom configuration. More... | |
bool | xcom_client_get_leaders (uint32_t gid, leader_info_data &leaders) override |
This member function is responsible for retrieving the leaders of the XCom configuration. More... | |
bool | xcom_client_get_synode_app_data (connection_descriptor *con, uint32_t group_id_hash, synode_no_array &synodes, synode_app_data_array &reply) override |
This member function is responsible for retrieving the application payloads decided in the synodes in synodes , from the XCom instance connected to via fd . More... | |
bool | xcom_client_set_cache_size (uint64_t size) override |
This member function is responsible for setting a new value for the maximum size of the XCom cache. More... | |
bool | xcom_client_boot (node_list *nl, uint32_t group_id) override |
This member function boots XCom. More... | |
connection_descriptor * | xcom_client_open_connection (std::string, xcom_port port) override |
This member function opens a connection to an XCom instance. More... | |
bool | xcom_client_close_connection (connection_descriptor *fd) override |
This member function closes the connection to an XCom instance. More... | |
bool | xcom_client_send_data (unsigned long long size, char *data) override |
This member function is responsible for pushing data into consensus on XCom. More... | |
void | xcom_init (xcom_port listen_port) override |
This member function initializes XCom. More... | |
void | xcom_exit () override |
This member function finishes the XCom thread. More... | |
int | xcom_get_ssl_mode (const char *mode) override |
int | xcom_get_ssl_fips_mode (const char *mode) override |
int | xcom_set_ssl_fips_mode (int mode) override |
int | xcom_set_ssl_mode (int mode) override |
bool | xcom_init_ssl () override |
Initialize the SSL. More... | |
void | xcom_destroy_ssl () override |
bool | xcom_use_ssl () override |
Return whether the SSL will be used to encrypt data or not. More... | |
void | xcom_set_ssl_parameters (ssl_parameters ssl, tls_parameters tls) override |
site_def const * | find_site_def (synode_no synode) override |
enum_gcs_error | xcom_wait_ready () override |
This member waits for XCom to be initialized. More... | |
bool | xcom_is_ready () override |
void | xcom_set_ready (bool value) override |
void | xcom_signal_ready () override |
void | xcom_wait_for_xcom_comms_status_change (int &status) override |
Call this method to wait for XCom communications to be initialized. More... | |
bool | xcom_has_comms_status_changed () override |
void | xcom_set_comms_status (int status) override |
void | xcom_signal_comms_status_changed (int status) override |
enum_gcs_error | xcom_wait_exit () override |
Call this method to wait for XCom to exit. More... | |
bool | xcom_is_exit () override |
This verifies if XCom has finished or not. More... | |
void | xcom_set_exit (bool value) override |
This sets whether XCom has finished or not. More... | |
void | xcom_signal_exit () override |
This modifies the internal cached status and signals all threads that might be waiting on xcom_wait_exit. More... | |
void | xcom_set_cleanup () override |
Clean up variables used to notify states in the XCOM's state machine. More... | |
bool | xcom_client_force_config (node_list *nl, uint32_t group_id) override |
This method forces XCom to inject a new configuration in the group, even if it does not contain a majority of members. More... | |
bool | get_should_exit () override |
Function that retrieves the value that signals that XCom must be forcefully stopped. More... | |
void | set_should_exit (bool should_exit) override |
Function that sets the value that signals that XCom must be forcefully stopped. More... | |
bool | xcom_input_connect (std::string const &address, xcom_port port) override |
Opens the input channel to XCom. More... | |
void | xcom_input_disconnect () override |
Closes the input channel to XCom. More... | |
bool | xcom_input_try_push (app_data_ptr data) override |
Attempts to send the command data to XCom. More... | |
Gcs_xcom_input_queue::future_reply | xcom_input_try_push_and_get_reply (app_data_ptr data) override |
Attempts to send the command data to XCom, and returns a future to XCom's reply. More... | |
xcom_input_request_ptr | xcom_input_try_pop () override |
Attempts to retrieve incoming commands. More... | |
Public Member Functions inherited from Gcs_xcom_proxy_base | |
Gcs_xcom_proxy_base ()=default | |
~Gcs_xcom_proxy_base () override=default | |
bool | xcom_boot_node (Gcs_xcom_node_information &node, uint32_t group_id_hash) override |
Function used to boot a node in XCOM. More... | |
bool | xcom_remove_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override |
Function to remove a set of nodes from XCOM. More... | |
bool | xcom_remove_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override |
Function to remove a set of nodes from XCOM. More... | |
bool | xcom_remove_node (const Gcs_xcom_node_information &node, uint32_t group_id_hash) override |
Function to remove a node from XCOM. More... | |
bool | xcom_add_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override |
Function to add a set of nodes to XCOM. More... | |
bool | xcom_add_node (connection_descriptor &con, const Gcs_xcom_node_information &node, uint32_t group_id_hash) override |
Function to add a node to XCOM. More... | |
xcom_event_horizon | xcom_get_minimum_event_horizon () override |
Function to retrieve XCOM's minimum supported event horizon value. More... | |
xcom_event_horizon | xcom_get_maximum_event_horizon () override |
Function to retrieve XCOM's maximum supported event horizon value. More... | |
bool | xcom_get_event_horizon (uint32_t group_id_hash, xcom_event_horizon &event_horizon) override |
Function to retrieve XCOM's event horizon. More... | |
bool | xcom_set_event_horizon (uint32_t group_id_hash, xcom_event_horizon event_horizon) override |
Function to reconfigure XCOM's event horizon. More... | |
bool | xcom_set_leaders (uint32_t group_id_hash, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders) override |
bool | xcom_get_leaders (uint32_t group_id_hash, leader_info_data &leaders) override |
bool | xcom_get_synode_app_data (Gcs_xcom_node_information const &xcom_instance, uint32_t group_id_hash, const std::unordered_set< Gcs_xcom_synode > &synode_set, synode_app_data_array &reply) override |
Function to retrieve the application payloads decided on a set of synodes. More... | |
bool | xcom_set_cache_size (uint64_t size) override |
Function to reconfigure the maximum size of the XCom cache. More... | |
bool | xcom_force_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override |
bool | initialize_network_manager () override |
Initializes XCom's Network Manager. More... | |
bool | finalize_network_manager () override |
Finalizes XCom's Network Manager. More... | |
bool | set_network_manager_active_provider (enum_transport_protocol new_value) override |
Set XCom's network manager active provider. More... | |
Public Member Functions inherited from Gcs_xcom_proxy | |
Gcs_xcom_proxy ()=default | |
virtual | ~Gcs_xcom_proxy ()=default |
The destructor. More... | |
virtual bool | xcom_force_nodes (Gcs_xcom_nodes &nodes, unsigned int group_id_hash)=0 |
Function to force the set of nodes in XCOM's configuration. More... | |
Private Member Functions | |
enum_gcs_error | xcom_wait_for_condition (My_xp_cond_impl &condition, My_xp_mutex_impl &condition_lock, std::function< bool(void)> need_to_wait, std::function< const std::string(int res)> condition_event) |
Gcs_xcom_proxy_impl (Gcs_xcom_proxy_impl const &) | |
Gcs_xcom_proxy_impl & | operator= (Gcs_xcom_proxy_impl const &) |
Private Attributes | |
unsigned int | m_wait_time |
My_xp_mutex_impl | m_lock_xcom_ready |
My_xp_cond_impl | m_cond_xcom_ready |
bool | m_is_xcom_ready |
My_xp_mutex_impl | m_lock_xcom_comms_status |
My_xp_cond_impl | m_cond_xcom_comms_status |
int | m_xcom_comms_status |
My_xp_mutex_impl | m_lock_xcom_exit |
My_xp_cond_impl | m_cond_xcom_exit |
bool | m_is_xcom_exit |
My_xp_socket_util * | m_socket_util |
int | m_ssl_mode |
const char * | m_server_key_file |
const char * | m_server_cert_file |
const char * | m_client_key_file |
const char * | m_client_cert_file |
const char * | m_ca_file |
const char * | m_ca_path |
const char * | m_crl_file |
const char * | m_crl_path |
const char * | m_cipher |
const char * | m_tls_version |
const char * | m_tls_ciphersuites |
std::atomic_bool | m_should_exit |
Gcs_xcom_input_queue | m_xcom_input_queue |
|
explicit |
Gcs_xcom_proxy_impl::Gcs_xcom_proxy_impl | ( | unsigned int | wt | ) |
|
override |
|
private |
|
overridevirtual |
This function is responsible to delete the list of nodes that had been previously created by new_node_address
.
n | the length of the list |
na | the list to delete |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Function that retrieves the value that signals that XCom must be forcefully stopped.
Implements Gcs_xcom_proxy.
|
overridevirtual |
This is an utility member function that is used to call into XCom for creating list with node's addresses and their associated UUIDs.
Note that callers must provide the UUID.
n | The number of elements in the list |
names | The names to be put on the list |
uuids | The UUIDs to be put on the list |
delete_node_address
Implements Gcs_xcom_proxy.
|
private |
|
overridevirtual |
Function that sets the value that signals that XCom must be forcefully stopped.
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible to call into XCom consensus and add a node to the group.
The caller is responsible for ensuring that the session has been opened before open_session
and also that the node is not yet in the configuration.
The callee must have opened an XCom connection before calling this function. xcom_client_open_connection
.
fd | the file descriptor to the XCom connection established earlier |
nl | The node list containing the list of peers to add |
group_id | the identifier of the group to which the nodes should be added |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function boots XCom.
nl | List with a single member - the one that boots the group |
group_id | the Group identifier to which the member belongs to |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function closes the connection to an XCom instance.
fd | The connection file descriptor |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This method forces XCom to inject a new configuration in the group, even if it does not contain a majority of members.
nl | The list of nodes that will belong to this new configuration |
group_id | The identifier of the group from which the nodes will belong |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for retrieving the event horizon of the XCom configuration.
This function REQUIRES a prior call to xcom_open_handlers
to establish a connection to XCom.
[in] | group_id | The identifier of the group from which the event horizon will be retrieved |
[out] | event_horizon | A reference to where the group's event horizon value will be written to |
true | if successful and event_horizon was written to |
false | otherwise |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for retrieving the leaders of the XCom configuration.
[in] | group_id | The identifier of the group |
[out] | leaders | A reference to where the group's leaders will be written to |
true | if successful and leaders was written to |
false | otherwise |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for retrieving the application payloads decided in the synodes in synodes
, from the XCom instance connected to via fd
.
[in] | fd | The file descriptor to the XCom connection established earlier |
[in] | group_id | The identifier of the group from which the payloads will be retrieved |
[in] | synodes | The desired synodes |
[out] | reply | Where the requested payloads will be written to |
reply
. Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function opens a connection to an XCom instance.
addr | The XCom instance address |
port | The XCom instance port |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for triggering the removal of a node from the XCom configuration.
This function is asynchronous, so you need to wait for the view change to actually validate that the removal was successful.
The caller is responsible for making sure that the server to be removed is in the group.
The callee must have opened an XCom connection before calling this function. xcom_client_open_connection
.
fd | the file descriptor to the XCom connection established earlier |
nl | The list of nodes to remove from the group |
group_id | The identifier of the group from which the nodes will be removed |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for triggering the removal of a node from the XCom configuration.
This function is asynchronous, so you need to wait for the view change to actually validate that the removal was successful.
The caller is responsible for making sure that the server to be removed is in the group.
This function MUST be called after opening the local XCom session xcom_input_connect
.
nl | The list of nodes to remove from the group |
group_id | The identifier of the group from which the nodes will be removed |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for pushing data into consensus on XCom.
The caller is responsible to making sure that there is an open XCom session xcom_input_connect
and also that the server is part of the XCom configuration before sending data to it.
data
must have been allocated by one of the functions of the malloc family, because data
will be passed on to XCom. XCom is implemented in C and will use free
to dispose of data
when it is finished with data
.
This function takes ownership of data
. This means that this function becomes responsible for the lifetime of data
. Since this function takes ownership of data
, the caller must not interact with data
after passing it to this function.
size | the size of the payload |
data | the payload |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for setting a new value for the maximum size of the XCom cache.
This function is asynchronous, so the return value indicates only whether the request to change the value was successfully pushed to XCom or not. However, since the cache size is set only for the local node, and makes no further verifications on the value, if XCom processes the request, it will accept the new value. The callers of this function must validate that the value set is within the limits set to the maximum size of the XCom cache.
This function REQUIRES a prior call to xcom_open_handlers
to establish a connection to XCom.
size | The new value for the maximum size of the XCom cache. |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for triggering the reconfiguration of the event horizon of the XCom configuration.
This function is asynchronous, so you need to poll xcom_get_event_horizon
to actually validate that the reconfiguration was successful.
This function REQUIRES a prior call to xcom_open_handlers
to establish a connection to XCom.
event_horizon | The desired event horizon value |
group_id | The identifier of the group from which the nodes will be removed |
xcom_client_get_event_horizon
to validate that the event horizon was modified. Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function is responsible for triggering the reconfiguration of the leaders of the XCom configuration.
This function is asynchronous, so you need to poll xcom_get_leaders
to actually validate that the reconfiguration was successful.
group_id | The identifier of the group |
nr_preferred_leaders | Number of preferred leaders, i.e. elements in preferred_leaders |
preferred_leaders | The "host:port" of the preferred leaders |
max_nr_leaders | Maximum number of active leaders |
xcom_client_get_leaders
to validate that the leaders were modified. Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function finishes the XCom thread.
This function must be called when the XCOM thread was started but the node has not joined a group.
There could be errors later in the process of exiting XCom. Since this is basically an asynchronous function, one needs to wait for the XCom thread to to ensure that XCom terminated.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member function initializes XCom.
This function must be called before anything else and from within the XCom thread. It will eventually call the main loop inside XCom.
listen_port | the port that the local XCom is to be listening on. |
Implements Gcs_xcom_proxy.
|
overridevirtual |
|
overridevirtual |
Opens the input channel to XCom.
address | address to connect to |
port | port to connect to |
true | if successful |
false | otherwise |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Closes the input channel to XCom.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Attempts to retrieve incoming commands.
(Called by XCom.)
xcom_input_connect
app_data_ptr | linked list of the queued commands if the queue is not empty |
nullptr | if the queue is empty |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Attempts to send the command data
to XCom.
(Called by GCS.)
The function takes ownership of data
.
xcom_input_connect
data | the command to send to XCom |
true | if the command was sent to XCom |
false | if the command was not sent to XCom |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Attempts to send the command data
to XCom, and returns a future to XCom's reply.
(Called by GCS.)
The function takes ownership of data
.
xcom_input_connect
data | the command to send to XCom |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This verifies if XCom has finished or not.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Clean up variables used to notify states in the XCOM's state machine.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This sets whether XCom has finished or not.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This modifies the internal cached status and signals all threads that might be waiting on xcom_wait_exit.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Implements Gcs_xcom_proxy.
|
overridevirtual |
Return whether the SSL will be used to encrypt data or not.
Implements Gcs_xcom_proxy.
|
overridevirtual |
Call this method to wait for XCom to exit.
Call this method to wait for XCom to exit. It will block until XCom has exit or an error occurs.
Implements Gcs_xcom_proxy.
|
private |
|
overridevirtual |
Call this method to wait for XCom communications to be initialized.
Call this method to wait for XCom communications to be initialized. It will block until XCom communications are either OK or error out. The value of the status (XCOM_COMMS_OK or XCOM_COMMS_ERROR) is written into the status out parameters.
[out] | status | value of the XCom communication layer status. It can be either XCOM_COMMS_OK or XCOM_COMMS_ERROR |
Implements Gcs_xcom_proxy.
|
overridevirtual |
This member waits for XCom to be initialized.
Implements Gcs_xcom_proxy.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |