24#ifndef CONSENSUS_LEADERS_HANDLER_INCLUDED
25#define CONSENSUS_LEADERS_HANDLER_INCLUDED
55 const std::vector<Gcs_member_identifier> &leaving,
56 const std::vector<Gcs_member_identifier> &group,
57 bool is_leaving,
bool *skip_election,
59 std::string &suggested_primary)
override;
72 std::string primary_uuid,
77 const std::string &message_origin,
78 bool *skip_message)
override;
100 bool is_single_primary_mode,
103 std::function<
bool()> allow_single_leader_getter);
125 bool is_single_primary_mode,
Deals with the orchestration necessary to set the appropriate "consensus leaders" on GCS.
Definition: consensus_leaders_handler.h:39
~Consensus_leaders_handler() override
Unregister as a group event observer from m_group_events_manager.
Definition: consensus_leaders_handler.cc:46
int after_view_change(const std::vector< Gcs_member_identifier > &joining, const std::vector< Gcs_member_identifier > &leaving, const std::vector< Gcs_member_identifier > &group, bool is_leaving, bool *skip_election, enum_primary_election_mode *election_mode, std::string &suggested_primary) override
Executed after view install and before primary election.
Definition: consensus_leaders_handler.cc:50
int before_message_handling(const Plugin_gcs_message &message, const std::string &message_origin, bool *skip_message) override
Executed before the message is processed.
Definition: consensus_leaders_handler.cc:93
Consensus_leaders_handler(Group_events_observation_manager &group_events_manager)
Register as a group event observer in group_events_manager.
Definition: consensus_leaders_handler.cc:40
Group_events_observation_manager & m_group_events_manager
Definition: consensus_leaders_handler.h:136
void set_consensus_leaders(Member_version const &communication_protocol, bool is_single_primary_mode, Group_member_info::Group_member_role role, Gcs_member_identifier const &my_gcs_id, std::function< bool()> allow_single_leader_getter)
Set the appropriate "consensus leaders" in GCS.
Definition: consensus_leaders_handler.cc:108
void set_as_single_consensus_leader(Gcs_member_identifier const &leader) const
Definition: consensus_leaders_handler.cc:128
void set_everyone_as_consensus_leader() const
Definition: consensus_leaders_handler.cc:154
static Member_version const s_first_protocol_with_support_for_consensus_leaders
Definition: consensus_leaders_handler.h:135
int after_primary_election(std::string primary_uuid, enum_primary_election_primary_change_status primary_change_status, enum_primary_election_mode election_mode, int error) override
Sets the newly elected primary as the single preferred "consensus leader" in GCS.
Definition: consensus_leaders_handler.cc:59
It represents the identity of a group member within a certain group.
Definition: gcs_member_identifier.h:40
Class that others can extend to receive notifications about views and primary elections.
Definition: group_event_observer.h:40
Class alerts listeners of group events like view changes and elections.
Definition: group_event_observer.h:87
Group_member_role
Definition: member_info.h:183
represent the MySQL version of a Member within the Group Replication group.
Definition: member_version.h:35
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:64
enum_primary_election_mode
Enum for election types.
Definition: primary_election_include.h:33
enum_primary_election_primary_change_status
Enum for primary change status.
Definition: primary_election_include.h:50