MySQL 8.0.40
Source Code Documentation
|
Implementation of the gcs_xcom_state_exchange_interface. More...
#include <gcs_xcom_state_exchange.h>
Public Member Functions | |
Gcs_xcom_state_exchange (Gcs_communication_interface *comm) | |
State Exchange constructor. More... | |
~Gcs_xcom_state_exchange () override | |
void | init () override |
Accomplishes all necessary initialization steps. More... | |
void | reset () override |
If messages were buffered during its processing, they are discarded and internal structures needed are cleaned up. More... | |
void | reset_with_flush () override |
Has the same behavior as the reset but additionally flushes buffered messages. More... | |
void | end () override |
If messages were buffered during its processing, they are delivered to upper layers and internal structures needed are cleaned up. More... | |
bool | state_exchange (synode_no configuration_id, std::vector< Gcs_member_identifier * > &total, std::vector< Gcs_member_identifier * > &left, std::vector< Gcs_member_identifier * > &joined, std::vector< std::unique_ptr< Gcs_message_data > > &exchangeable_data, Gcs_view *current_view, std::string *group, const Gcs_member_identifier &local_info, const Gcs_xcom_nodes &xcom_nodes) override |
Signals the module to start a State Exchange. More... | |
bool | process_member_state (Xcom_member_state *ms_info, const Gcs_member_identifier &p_id, Gcs_protocol_version maximum_supported_protocol_version, Gcs_protocol_version used_protocol_version) override |
Processes a member state message on an ongoing State Exchange round. More... | |
std::vector< Gcs_xcom_node_information > | compute_incompatible_members () override |
Compute the set of incompatible members after the state exchange has finished. More... | |
bool | process_recovery_state () override |
Recovers any missing packets required for the member to join the group. More... | |
Gcs_xcom_view_identifier * | get_new_view_id () override |
Retrieves the new view identifier after a State Exchange. More... | |
std::set< Gcs_member_identifier * > * | get_joined () override |
std::set< Gcs_member_identifier * > * | get_left () override |
std::set< Gcs_member_identifier * > * | get_total () override |
std::map< Gcs_member_identifier, Xcom_member_state * > * | get_member_states () override |
std::string * | get_group () override |
void | compute_maximum_supported_protocol_version () override |
Computes the maximum protocol version supported by the group. More... | |
Public Member Functions inherited from Gcs_xcom_state_exchange_interface | |
virtual | ~Gcs_xcom_state_exchange_interface ()=default |
Private Member Functions | |
bool | is_leaving () |
Computes if the local member is leaving. More... | |
bool | is_joining () |
Computes if the local member is joining. More... | |
void | update_communication_channel (const Gcs_xcom_nodes &xcom_nodes) |
Update the communication system with information on membership. More... | |
enum_gcs_error | broadcast_state (const Gcs_xcom_view_identifier &proposed_view, std::vector< std::unique_ptr< Gcs_message_data > > &exchangeable_data) |
Broadcasts the local state to all nodes in the Cluster. More... | |
void | update_awaited_vector () |
Updates the structure that waits for State Exchanges. More... | |
void | fill_member_set (std::vector< Gcs_member_identifier * > &in, std::set< Gcs_member_identifier * > &pset) |
Converts xcom data to a set of internal representation. More... | |
void | save_member_state (Xcom_member_state *ms_info, const Gcs_member_identifier &p_id, Gcs_protocol_version maximum_supported_protocol_version, Gcs_protocol_version used_protocol_version) |
Stores the member's state and protocol version. More... | |
bool | snapshot_is_enough (Gcs_xcom_synode_set const &snapshot_to_recover) const |
Auxiliary method that checks whether snapshot_to_recover contains all the synodes required. More... | |
std::pair< bool, Gcs_protocol_version > | members_announce_same_version () const |
Checks whether all the existing group members, myself excluded, announce the same protocol version. More... | |
bool | incompatible_with_group () const |
Checks whether this server is incompatible with the group. More... | |
std::vector< Gcs_xcom_node_information > | compute_incompatible_joiners () |
Computes the set of incompatible nodes that are trying to join the group. More... | |
Gcs_xcom_state_exchange (Gcs_xcom_state_exchange const &) | |
Gcs_xcom_state_exchange & | operator= (Gcs_xcom_state_exchange const &) |
Private Attributes | |
Gcs_communication_interface * | m_broadcaster |
std::map< Gcs_member_identifier, uint > | m_awaited_vector |
std::map< Gcs_member_identifier, uint > | m_recover_vector |
std::set< Gcs_member_identifier * > | m_ms_total |
std::set< Gcs_member_identifier * > | m_ms_left |
std::set< Gcs_member_identifier * > | m_ms_joined |
std::map< Gcs_member_identifier, Xcom_member_state * > | m_member_states |
std::map< Gcs_member_identifier, Gcs_protocol_version > | m_member_versions |
std::map< Gcs_member_identifier, Gcs_protocol_version > | m_member_max_versions |
std::string * | m_group_name |
Gcs_member_identifier | m_local_information |
synode_no | m_configuration_id |
std::vector< synode_no > | cached_ids |
Gcs_xcom_nodes | m_ms_xcom_nodes |
Implementation of the gcs_xcom_state_exchange_interface.
|
explicit |
State Exchange constructor.
[in] | comm | Communication interface reference to allow broadcasting of member states |
|
override |
|
private |
|
private |
Broadcasts the local state to all nodes in the Cluster.
[in] | proposed_view | proposed view to broadcast |
[in] | exchangeable_data | List with exchangeable messages |
|
private |
Computes the set of incompatible nodes that are trying to join the group.
|
overridevirtual |
Compute the set of incompatible members after the state exchange has finished.
A member M is incompatible if it is attempting to join a group that is using protocol X, but M is using protocol Y s.t. X != Y.
Implements Gcs_xcom_state_exchange_interface.
|
overridevirtual |
Computes the maximum protocol version supported by the group.
Implements Gcs_xcom_state_exchange_interface.
|
overridevirtual |
If messages were buffered during its processing, they are delivered to upper layers and internal structures needed are cleaned up.
Implements Gcs_xcom_state_exchange_interface.
|
private |
Converts xcom data to a set of internal representation.
[in] | in | xcom list |
[in] | pset | Set where the converted member ids will be written |
|
inlineoverridevirtual |
Implements Gcs_xcom_state_exchange_interface.
|
inlineoverridevirtual |
Implements Gcs_xcom_state_exchange_interface.
|
inlineoverridevirtual |
Implements Gcs_xcom_state_exchange_interface.
|
inlineoverridevirtual |
Implements Gcs_xcom_state_exchange_interface.
|
overridevirtual |
Retrieves the new view identifier after a State Exchange.
Implements Gcs_xcom_state_exchange_interface.
|
inlineoverridevirtual |
Implements Gcs_xcom_state_exchange_interface.
|
private |
Checks whether this server is incompatible with the group.
true | If it is incompatible |
false | If it is compatible |
|
overridevirtual |
Accomplishes all necessary initialization steps.
Implements Gcs_xcom_state_exchange_interface.
|
private |
Computes if the local member is joining.
|
private |
Computes if the local member is leaving.
|
private |
Checks whether all the existing group members, myself excluded, announce the same protocol version.
{false,_} | if they do not all announce the same protocol version |
{true,Gcs_protocol_version} | if they all announced the same protocol version of the return value |
|
private |
|
overridevirtual |
Processes a member state message on an ongoing State Exchange round.
[in] | ms_info | received Member State |
[in] | p_id | the node that the Member State pertains |
[in] | maximum_supported_protocol_version | maximum supported protocol version |
[in] | used_protocol_version | protocol version in use by a member during the state exchange phase |
Implements Gcs_xcom_state_exchange_interface.
|
overridevirtual |
Recovers any missing packets required for the member to join the group.
true | if successful |
false | otherwise |
Implements Gcs_xcom_state_exchange_interface.
|
overridevirtual |
If messages were buffered during its processing, they are discarded and internal structures needed are cleaned up.
Implements Gcs_xcom_state_exchange_interface.
|
overridevirtual |
Has the same behavior as the reset but additionally flushes buffered messages.
Implements Gcs_xcom_state_exchange_interface.
|
private |
Stores the member's state and protocol version.
ms_info | state | |
p_id | member | |
[in] | maximum_supported_protocol_version | maximum supported protocol version |
used_protocol_version | protocol version |
|
private |
Auxiliary method that checks whether snapshot_to_recover
contains all the synodes required.
|
overridevirtual |
Signals the module to start a State Exchange.
[in] | configuration_id | Configuration identifier in use when the state exchange phase started |
[in] | total | xcom total members in the new view |
[in] | left | xcom members that left in the new view |
[in] | joined | xcom members that joined in the new view |
[in] | exchangeable_data | generic exchanged data |
[in] | current_view | the currently installed view |
[in] | group | group name |
[in] | local_info | the local GCS member identifier |
[in] | xcom_nodes | list of nodes |
Implements Gcs_xcom_state_exchange_interface.
|
private |
Updates the structure that waits for State Exchanges.
|
private |
Update the communication system with information on membership.
xcom_nodes | List of nodes that belong to the current membership. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |