24#ifndef PRIMARY_ELECTION_PRIMARY_PROCESS_INCLUDED
25#define PRIMARY_ELECTION_PRIMARY_PROCESS_INCLUDED
105 const std::vector<Gcs_member_identifier> &leaving,
106 const std::vector<Gcs_member_identifier> &group,
107 bool is_leaving,
bool *skip_election,
109 std::string &suggested_primary)
override;
115 const std::string &message_origin,
116 bool *skip_message)
override;
Class that others can extend to receive notifications about views and primary elections.
Definition: group_event_observer.h:40
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:64
Definition: stage_monitor_handler.h:30
Class that contains the primary election process logic for the elected primary.
Definition: primary_election_primary_process.h:41
bool waiting_on_queue_applied_message
Waiting for old primary transaction execution.
Definition: primary_election_primary_process.h:137
std::shared_ptr< Continuation > applier_checkpoint_condition
Continuation object to wait on the applier queue consumption.
Definition: primary_election_primary_process.h:125
mysql_cond_t election_cond
The thread run condition.
Definition: primary_election_primary_process.h:162
ulong stop_wait_timeout
Definition: primary_election_primary_process.h:155
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: primary_election_primary_process.cc:434
std::string primary_uuid
The primary to be elected.
Definition: primary_election_primary_process.h:144
bool election_process_aborted
Is the process aborted.
Definition: primary_election_primary_process.h:130
thread_state election_process_thd_state
The election thread status.
Definition: primary_election_primary_process.h:128
int terminate_election_process(bool wait=true)
Terminate the election process on shutdown.
Definition: primary_election_primary_process.cc:494
bool is_election_process_terminating()
Is the process already terminating?
Definition: primary_election_primary_process.cc:63
void set_stop_wait_timeout(ulong timeout)
Sets the component stop timeout.
Definition: primary_election_primary_process.cc:55
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: primary_election_primary_process.cc:396
enum_primary_election_mode election_mode
The election invocation context.
Definition: primary_election_primary_process.h:141
ulong number_of_know_members
The number of known members when the election started.
Definition: primary_election_primary_process.h:147
std::list< std::string > known_members_addresses
The members known for the current action.
Definition: primary_election_primary_process.h:149
bool is_election_process_running()
Is the election process running?
Definition: primary_election_primary_process.cc:59
bool primary_ready
Definition: primary_election_primary_process.h:133
Primary_election_primary_process()
Class constructor for primary election process.
Definition: primary_election_primary_process.cc:36
int launch_primary_election_process(enum_primary_election_mode election_mode, std::string &primary_to_elect, Group_member_info_list *group_members_info)
Launch the local process on the primary member for primary election.
Definition: primary_election_primary_process.cc:70
my_thread_handle primary_election_pthd
The thread handle.
Definition: primary_election_primary_process.h:164
bool signal_read_mode_ready()
Signal that the read mode is ready on this member.
Definition: primary_election_primary_process.cc:488
int primary_election_process_handler()
Definition: primary_election_primary_process.cc:134
Plugin_stage_monitor_handler * stage_handler
The stage handler for progress reporting.
Definition: primary_election_primary_process.h:152
bool group_in_read_mode
Are all group members in read mode.
Definition: primary_election_primary_process.h:135
~Primary_election_primary_process() override
Class destructor for primary election process.
Definition: primary_election_primary_process.cc:50
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
Executed after primary election.
Definition: primary_election_primary_process.cc:428
mysql_mutex_t election_lock
The thread run lock.
Definition: primary_election_primary_process.h:160
bool election_process_ending
Are the main stages of the election process finished.
Definition: primary_election_primary_process.h:139
void wait_on_election_process_termination()
Waits for the election thread process to finish.
Definition: primary_election_primary_process.cc:524
std::vector< Group_member_info *, Malloc_allocator< Group_member_info * > > Group_member_info_list
Definition: member_info.h:771
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
static int wait(mysql_cond_t *that, mysql_mutex_t *mutex_arg, const char *, unsigned int)
Definition: mysql_cond_v1_native.cc:63
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
Definition: my_thread_bits.h:58
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: plugin_utils.h:48