24#ifndef PRIMARY_ELECTION_INVOCATION_HANDLER_INCLUDED
25#define PRIMARY_ELECTION_INVOCATION_HANDLER_INCLUDED
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:41
~Primary_election_handler()
Class destructor.
Definition: primary_election_invocation_handler.cc:39
Primary_election_primary_process primary_election_handler
The handler to handle the election on the primary member.
Definition: primary_election_invocation_handler.h:158
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:88
bool election_process_running
Is an election running?
Definition: primary_election_invocation_handler.h:164
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:251
void notify_election_end()
Notify transaction consistency manager that election ended.
Definition: primary_election_invocation_handler.cc:513
Primary_election_secondary_process secondary_election_handler
The handler to handle the election in the secondary members.
Definition: primary_election_invocation_handler.h:161
Primary_election_handler(ulong components_stop_timeout)
Instantiate a new election handler.
Definition: primary_election_invocation_handler.cc:30
mysql_mutex_t flag_lock
The lock for the running flag.
Definition: primary_election_invocation_handler.h:167
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:68
bool is_an_election_running()
Is an election process running?
Definition: primary_election_invocation_handler.cc:48
int terminate_election_process()
End any running election process.
Definition: primary_election_invocation_handler.cc:75
void print_gtid_info_in_log()
Print server executed GTID and applier retrieved GTID in logs.
Definition: primary_election_invocation_handler.cc:223
int legacy_primary_election(std::string &primary_uuid)
Execute the legacy (<8.0.12) primary election algorithm.
Definition: primary_election_invocation_handler.cc:288
bool pick_primary_member(std::string &primary_uuid, Group_member_info_list *all_members_info)
Get the member to elect from all group members.
Definition: primary_election_invocation_handler.cc:346
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:61
void set_election_running(bool election_running)
Sets if the election process is running or not.
Definition: primary_election_invocation_handler.cc:55
void notify_election_running()
Notify transaction consistency manager that election is running.
Definition: primary_election_invocation_handler.cc:509
void set_stop_wait_timeout(ulong timeout)
Sets the component stop timeout.
Definition: primary_election_invocation_handler.cc:43
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:736
std::vector< Group_member_info *, Malloc_allocator< Group_member_info * > > Group_member_info_list
Definition: member_info.h:735
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:496
mode
Definition: file_handle.h:60
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:494
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:429
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50