MySQL 8.0.39
Source Code Documentation
|
Implementation of the interface Group_member_info_manager_interface. More...
#include <member_info.h>
Public Member Functions | |
Group_member_info_manager (Group_member_info *local_member_info, PSI_mutex_key psi_mutex_key=key_GR_LOCK_group_member_info_manager_update_lock) | |
~Group_member_info_manager () override | |
void * | operator new (size_t size, const std::nothrow_t &) noexcept |
void | operator delete (void *ptr, const std::nothrow_t &) noexcept |
void * | operator new (size_t size) noexcept |
Allocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked. More... | |
void | operator delete (void *ptr) noexcept |
Deallocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked. More... | |
size_t | get_number_of_members () override |
Number of members in the group. More... | |
size_t | get_number_of_members_online () override |
Number of ONLINE members in the group. More... | |
bool | is_member_info_present (const std::string &uuid) override |
Is the member present in the group info. More... | |
bool | get_group_member_info (const std::string &uuid, Group_member_info &member_info_arg) override |
Retrieves a registered Group member by its uuid. More... | |
bool | get_group_member_info_by_index (int idx, Group_member_info &member_info_arg) override |
Retrieves a registered Group member by an index function. More... | |
Member_version | get_group_lowest_online_version () override |
Return lowest member version. More... | |
bool | get_group_member_info_by_member_id (const Gcs_member_identifier &id, Group_member_info &member_info_arg) override |
Retrieves a registered Group member by its backbone GCS identifier. More... | |
Group_member_info::Group_member_status | get_group_member_status_by_member_id (const Gcs_member_identifier &id) override |
Return the status of the member with the given GCS identifier. More... | |
Group_member_info_list * | get_all_members () override |
Retrieves all Group members managed by this site. More... | |
std::list< Gcs_member_identifier > * | get_online_members_with_guarantees (const Gcs_member_identifier &exclude_member) override |
Retrieves all ONLINE Group members managed by this site, or NULL if any group member version is from a version lower than TRANSACTION_WITH_GUARANTEES_VERSION. More... | |
void | add (Group_member_info *new_member) override |
Adds a new member to be managed by this Group manager. More... | |
void | update (Group_member_info *update_local_member) override |
Removes all members of the group and update new local member. More... | |
void | update (Group_member_info_list *new_members) override |
Updates all members of the group. More... | |
void | update_member_status (const std::string &uuid, Group_member_info::Group_member_status new_status, Notification_context &ctx) override |
Updates the status of a single member. More... | |
void | set_member_unreachable (const std::string &uuid) override |
Sets the identified member as unreachable. More... | |
void | set_member_reachable (const std::string &uuid) override |
Sets the identified member as reachable. More... | |
void | update_gtid_sets (const std::string &uuid, std::string >id_executed, std::string &purged_gtids, std::string >id_retrieved) override |
Updates the GTID sets on a single member. More... | |
void | update_member_role (const std::string &uuid, Group_member_info::Group_member_role new_role, Notification_context &ctx) override |
Updates the role of a single member. More... | |
void | update_group_primary_roles (const std::string &uuid, Notification_context &ctx) override |
Updates the primary/secondary roles of the group. More... | |
void | update_member_weight (const std::string &uuid, uint member_weight) override |
Updates the weight of a single member. More... | |
void | update_primary_member_flag (bool in_primary_mode) override |
Changes the primary flag on all members. More... | |
void | update_enforce_everywhere_checks_flag (bool enforce_everywhere) override |
Set the enforces_update_everywhere_checks flag on all members. More... | |
void | encode (std::vector< uchar > *to_encode) override |
Encodes this object to send via the network. More... | |
Group_member_info_list * | decode (const uchar *to_decode, size_t length) override |
Decodes the raw format of this object. More... | |
bool | is_conflict_detection_enabled () override |
Check if some member of the group has the conflict detection enable. More... | |
bool | get_primary_member_uuid (std::string &primary_member_uuid) override |
Return the uuid for the for the primary. More... | |
bool | get_primary_member_info (Group_member_info &member_info_arg) override |
Return the group member info for the current group primary. More... | |
bool | is_majority_unreachable () override |
Check if majority of the group is unreachable. More... | |
bool | is_unreachable_member_present () override |
Check if an unreachable member exists. More... | |
bool | is_recovering_member_present () override |
Check if a member in recovery exists in the group. More... | |
std::string | get_string_current_view_active_hosts () const override |
This method returns all ONLINE and RECOVERING members comma separated host and port in string format. More... | |
mysql_mutex_t * | get_update_lock () override |
This method returns the update lock for consistent read of member state. More... | |
Public Member Functions inherited from Group_member_info_manager_interface | |
virtual | ~Group_member_info_manager_interface ()=default |
Private Member Functions | |
void | clear_members () |
Group_member_info * | get_group_member_info_by_member_id_internal (const Gcs_member_identifier &id) |
Private Attributes | |
Group_member_info_map * | members |
Group_member_info * | local_member_info |
mysql_mutex_t | update_lock |
Implementation of the interface Group_member_info_manager_interface.
Group_member_info_manager::Group_member_info_manager | ( | Group_member_info * | local_member_info, |
PSI_mutex_key | psi_mutex_key = key_GR_LOCK_group_member_info_manager_update_lock |
||
) |
|
override |
|
overridevirtual |
Adds a new member to be managed by this Group manager.
[in] | new_member | new group member |
Implements Group_member_info_manager_interface.
|
private |
|
overridevirtual |
Decodes the raw format of this object.
[in] | to_decode | raw encoded data |
[in] | length | raw encoded data length |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Encodes this object to send via the network.
[out] | to_encode | out parameter to receive the encoded data |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Retrieves all Group members managed by this site.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Return lowest member version.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Retrieves a registered Group member by its uuid.
[in] | uuid | uuid to retrieve |
[out] | member_info_arg | a member info reference local to the method caller that is updated when the member is found. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Retrieves a registered Group member by an index function.
One is free to determine the index function. Nevertheless, it should have the same result regardless of the member of the group where it is called
[in] | idx | the index |
[out] | member_info_arg | a member info reference local to the method caller that is updated when the member is found. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Retrieves a registered Group member by its backbone GCS identifier.
[in] | id | the GCS identifier |
[out] | member_info_arg | a member info reference local to the method caller that is updated when the member is found. |
Implements Group_member_info_manager_interface.
|
private |
|
overridevirtual |
Return the status of the member with the given GCS identifier.
[in] | id | the GCS identifier |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Number of members in the group.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Number of ONLINE members in the group.
UNREACHABLE members are included.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Retrieves all ONLINE Group members managed by this site, or NULL if any group member version is from a version lower than TRANSACTION_WITH_GUARANTEES_VERSION.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Return the group member info for the current group primary.
[out] | member_info_arg | a member info reference local to the method caller that is updated when the member is found. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Return the uuid for the for the primary.
[out] | primary_member_uuid | the uuid of the primary will be assigned here. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
This method returns all ONLINE and RECOVERING members comma separated host and port in string format.
Implements Group_member_info_manager_interface.
|
inlineoverridevirtual |
This method returns the update lock for consistent read of member state.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Check if some member of the group has the conflict detection enable.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Check if majority of the group is unreachable.
This approach is optimistic, right after return the majority can be reestablish or go away.
Implements Group_member_info_manager_interface.
|
overridevirtual |
Is the member present in the group info.
[in] | uuid | uuid to check |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Check if a member in recovery exists in the group.
This approach is optimistic, right after return a member can enter the group
Implements Group_member_info_manager_interface.
|
overridevirtual |
Check if an unreachable member exists.
This approach is optimistic, right after return a member can be marked as reachable/unreachable
Implements Group_member_info_manager_interface.
|
inlinenoexcept |
Deallocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked.
[in] | ptr | pointer to the allocated memory |
|
inlinenoexcept |
|
inlinenoexcept |
Allocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked.
[in] | size | memory size to be allocated |
|
inlinenoexcept |
|
overridevirtual |
Sets the identified member as reachable.
[in] | uuid | member uuid |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Sets the identified member as unreachable.
[in] | uuid | member uuid |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Removes all members of the group and update new local member.
[in] | update_local_member | new Group member |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Updates all members of the group.
Typically used after a view change.
[in] | new_members | new Group members |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Set the enforces_update_everywhere_checks flag on all members.
enforce_everywhere | are the update everywhere checks active or not |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Updates the primary/secondary roles of the group.
This method allows for all roles to be updated at once in the same method
[in] | uuid | the primary member uuid |
[in,out] | ctx | The notification context to update. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Updates the GTID sets on a single member.
[in] | uuid | member uuid |
[in] | gtid_executed | the member executed GTID set |
[in] | purged_gtids | the server purged GTID set |
[in] | gtid_retrieved | the member retrieved GTID set for the applier |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Updates the role of a single member.
[in] | uuid | member uuid |
[in] | new_role | role to change to |
[in,out] | ctx | The notification context to update. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Updates the status of a single member.
[in] | uuid | member uuid |
[in] | new_status | status to change to |
[in,out] | ctx | The notification context to update. |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Updates the weight of a single member.
[in] | uuid | member uuid |
[in] | member_weight | the new weight |
Implements Group_member_info_manager_interface.
|
overridevirtual |
Changes the primary flag on all members.
in_primary_mode | is the member in primary mode |
Implements Group_member_info_manager_interface.
|
private |
|
private |
|
private |