24#ifndef PRIMARY_ELECTION_INVOCATION_HANDLER_INCLUDED
25#define PRIMARY_ELECTION_INVOCATION_HANDLER_INCLUDED
176 std::vector<Gr_primary_election_member> &members);
A convenience context class used to share information between the event handlers and the notifier.
Definition: notification.h:35
The base class to request and execute an election.
Definition: primary_election_invocation_handler.h:46
~Primary_election_handler()
Class destructor.
Definition: primary_election_invocation_handler.cc:43
Primary_election_primary_process primary_election_handler
The handler to handle the election on the primary member.
Definition: primary_election_invocation_handler.h:179
int execute_primary_election(std::string &primary_uuid, enum_primary_election_mode mode, Notification_context *notification_ctx)
Execute the primary member selection if needed and the election algorithm invocation.
Definition: primary_election_invocation_handler.cc:92
bool election_process_running
Is an election running?
Definition: primary_election_invocation_handler.h:185
int internal_primary_election(std::string &primary_uuid, enum_primary_election_mode mode)
Execute the standard primary election algorithm (that supports primary appointments)
Definition: primary_election_invocation_handler.cc:257
void notify_election_end()
Notify transaction consistency manager that election ended.
Definition: primary_election_invocation_handler.cc:637
Primary_election_secondary_process secondary_election_handler
The handler to handle the election in the secondary members.
Definition: primary_election_invocation_handler.h:182
Primary_election_handler(ulong components_stop_timeout)
Instantiate a new election handler.
Definition: primary_election_invocation_handler.cc:34
mysql_mutex_t flag_lock
The lock for the running flag.
Definition: primary_election_invocation_handler.h:188
int handle_primary_election_message(Single_primary_message *message, Notification_context *notification_ctx)
Handle new received primary message of type SINGLE_PRIMARY_PRIMARY_ELECTION.
Definition: primary_election_invocation_handler.cc:72
bool is_an_election_running()
Is an election process running?
Definition: primary_election_invocation_handler.cc:52
int terminate_election_process()
End any running election process.
Definition: primary_election_invocation_handler.cc:79
bool pick_primary_member(std::string &primary_uuid, Group_member_info_list *all_members_info, enum_primary_election_mode mode)
Get the member to elect from all group members.
Definition: primary_election_invocation_handler.cc:352
int sort_member_by_most_up_to_date(Group_member_info_list *all_members_info, Group_member_info_list_iterator lowest_version_end, std::vector< Gr_primary_election_member > &members)
Order list of members until lowest_version_end position.
Definition: primary_election_invocation_handler.cc:506
void print_gtid_info_in_log()
Print server executed GTID and applier retrieved GTID in logs.
Definition: primary_election_invocation_handler.cc:229
int legacy_primary_election(std::string &primary_uuid)
Execute the legacy (<8.0.12) primary election algorithm.
Definition: primary_election_invocation_handler.cc:294
int request_group_primary_election(std::string primary_uuid, enum_primary_election_mode mode)
Send a message to all members requesting an election.
Definition: primary_election_invocation_handler.cc:65
void set_election_running(bool election_running)
Sets if the election process is running or not.
Definition: primary_election_invocation_handler.cc:59
void notify_election_running()
Notify transaction consistency manager that election is running.
Definition: primary_election_invocation_handler.cc:633
void set_stop_wait_timeout(ulong timeout)
Sets the component stop timeout.
Definition: primary_election_invocation_handler.cc:47
Class that contains the primary election process logic for the elected primary.
Definition: primary_election_primary_process.h:41
Class that contains the primary election process logic for secondary members.
Definition: primary_election_secondary_process.h:40
Definition: single_primary_message.h:35
Group_member_info_list::iterator Group_member_info_list_iterator
Definition: member_info.h:793
std::vector< Group_member_info *, Malloc_allocator< Group_member_info * > > Group_member_info_list
Definition: member_info.h:792
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
mode
Definition: file_handle.h:61
enum_primary_election_mode
Enum for election types.
Definition: primary_election_include.h:33
void sort_members_for_election(Group_member_info_list *all_members_info, Group_member_info_list_iterator lowest_version_end)
Sort lower version members based on member weight if member version is greater than equal to PRIMARY_...
Definition: primary_election_invocation_handler.cc:617
Group_member_info_list_iterator sort_and_get_lowest_version_member_position(Group_member_info_list *all_members_info)
Sort members based on member_version and get first iterator position where member version differs.
Definition: primary_election_invocation_handler.cc:577
Definition: primary_election_invocation_handler.h:37
uint64_t delta
Definition: primary_election_invocation_handler.h:39
std::string uuid
Definition: primary_election_invocation_handler.h:38
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50