24#ifndef GROUP_ACTION_COORDINATOR_INCLUDED
25#define GROUP_ACTION_COORDINATOR_INCLUDED
128 const std::string &message_origin);
163 const std::vector<Gcs_member_identifier> &leaving,
164 const std::vector<Gcs_member_identifier> &group,
165 bool is_leaving,
bool *skip_election,
167 std::string &suggested_primary)
override;
169 std::string primary_uuid,
173 const std::string &message_origin,
174 bool *skip_message)
override;
183 const std::string &message_origin);
192 const std::string &message_origin);
217 const char *error_message,
218 bool is_local_executor,
219 bool is_action_running =
false);
228 bool is_local_executor,
229 bool is_action_running =
false);
The coordinator class where group actions are submitted.
Definition: group_action_coordinator.h:66
bool action_execution_error
Is there an error on the message after receiving the action.
Definition: group_action_coordinator.h:286
Group_action_information * current_executing_action
The currently proposed action owner.
Definition: group_action_coordinator.h:277
bool local_action_killed
Was the local action killed.
Definition: group_action_coordinator.h:283
std::list< std::string > known_members_addresses
The list of members known for the current action.
Definition: group_action_coordinator.h:253
void terminate_action()
Handle the termination of current action.
Definition: group_action_coordinator.cc:702
bool handle_action_message(Group_action_message *message, const std::string &message_origin)
Handle incoming action message (start or stop)
Definition: group_action_coordinator.cc:460
std::atomic< bool > action_running
The flag to avoid concurrent action running.
Definition: group_action_coordinator.h:272
Plugin_stage_monitor_handler monitoring_stage_handler
The handler where actions can report progress through stages.
Definition: group_action_coordinator.h:301
ulong stop_wait_timeout
Definition: group_action_coordinator.h:313
void awake_coordinator_on_error(Group_action_information *execution_info, const char *error_message, bool is_local_executor, bool is_action_running=false)
Set an error message and awake the coordinator.
Definition: group_action_coordinator.cc:756
int execute_group_action_handler()
The main thread process for the action execution process.
Definition: group_action_coordinator.cc:870
bool thread_killed()
This method returns if the current thread was killed.
Definition: group_action_coordinator.cc:456
bool action_proposed
The flag to avoid concurrent action start requests.
Definition: group_action_coordinator.h:269
void signal_and_wait_action_termination(bool wait)
Declares the action as not running, wait or not for its finish.
Definition: group_action_coordinator.cc:736
bool remote_warnings_reported
There were remote warnings reported.
Definition: group_action_coordinator.h:298
void register_coordinator_observers()
Register the coordinator observers.
Definition: group_action_coordinator.cc:196
bool handle_action_start_message(Group_action_message *message, const std::string &message_origin)
Handle incoming start action message.
Definition: group_action_coordinator.cc:490
mysql_cond_t group_thread_run_cond
The group action process thread condition.
Definition: group_action_coordinator.h:321
bool member_leaving_group
Is this member leaving.
Definition: group_action_coordinator.h:295
int coordinate_action_execution(Group_action *action, Group_action_diagnostics *execution_info, Group_action_message::enum_action_initiator_and_action initiator)
Submit an action for execution in the coordinator.
Definition: group_action_coordinator.cc:295
int signal_action_terminated()
Declare this action as terminated to other members.
Definition: group_action_coordinator.cc:802
int number_of_terminated_members
The number of received stop messages or dead members.
Definition: group_action_coordinator.h:257
bool action_cancelled_on_termination
If we propose an action but the coordinator ends before it starts.
Definition: group_action_coordinator.h:292
enum_end_action_message_return_flags
Enum for the flags used in the return field of the end message.
Definition: group_action_coordinator.h:69
@ END_ACTION_MESSAGE_UNKNOWN_FLAG
Definition: group_action_coordinator.h:70
@ END_ACTION_MESSAGE_WARNING_FLAG
Definition: group_action_coordinator.h:71
@ END_ACTION_MESSAGE_FLAG_END
Definition: group_action_coordinator.h:72
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: group_action_coordinator.cc:1060
bool local_action_terminating
Is the local submitted action terminating.
Definition: group_action_coordinator.h:280
mysql_cond_t coordinator_process_condition
The condition to wake up on error or termination.
Definition: group_action_coordinator.h:263
bool member_in_recovery(Group_member_info_list *all_members_info)
This method checks if there is a member in recovery in the group.
Definition: group_action_coordinator.cc:676
mysql_mutex_t coordinator_process_lock
The lock too coordinate start and stop requests.
Definition: group_action_coordinator.h:260
Group_action_coordinator(ulong components_stop_timeout)
The group coordinator constructor.
Definition: group_action_coordinator.cc:153
int stop_coordinator_process(bool coordinator_stop, bool wait=true)
Asks the coordinator to stop any ongoing action.
Definition: group_action_coordinator.cc:252
bool is_group_action_being_executed
If the group action execution method is being executed.
Definition: group_action_coordinator.h:310
int launch_group_action_handler_thread()
launch_group_action_handler_thread
Definition: group_action_coordinator.cc:839
void set_stop_wait_timeout(ulong timeout)
Sets the component stop timeout.
Definition: group_action_coordinator.cc:204
void reset_coordinator_process()
Resets flags as the coordinator can live through multiple stops and starts.
Definition: group_action_coordinator.cc:236
bool coordinator_terminating
The flag to avoid action starts post stop.
Definition: group_action_coordinator.h:289
my_thread_handle action_execution_pthd
The thread handle for the group action process.
Definition: group_action_coordinator.h:317
bool is_sender
Is this member the sender and controller of this action.
Definition: group_action_coordinator.h:266
bool handle_action_stop_message(Group_action_message *message, const std::string &message_origin)
Handle incoming end action message.
Definition: group_action_coordinator.cc:652
void unregister_coordinator_observers()
Unregister the coordinator observers.
Definition: group_action_coordinator.cc:200
mysql_mutex_t group_thread_run_lock
The group action process thread lock.
Definition: group_action_coordinator.h:319
bool member_from_invalid_version(Group_member_info_list *all_members_info)
This method checks if there is a member from a version that does not allow actions.
Definition: group_action_coordinator.cc:689
~Group_action_coordinator() override
The group coordinator destructor
Definition: group_action_coordinator.cc:187
int number_of_known_members
The number of received stop messages or dead members.
Definition: group_action_coordinator.h:255
bool failure_debug_flag
Flag for cases where we don't have debug execution tools Can be an enum if other cases emerge.
Definition: group_action_coordinator.h:156
mysql_mutex_t group_thread_end_lock
The group action process thread end lock.
Definition: group_action_coordinator.h:324
mysql_cond_t group_thread_end_cond
The group action process thread end condition.
Definition: group_action_coordinator.h:326
thread_state action_handler_thd_state
The action handler thread status.
Definition: group_action_coordinator.h:307
bool is_group_action_running(std::pair< std::string, std::string > &initiator)
Returns if there is a group action running.
Definition: group_action_coordinator.cc:214
Group_action_information * proposed_action
The currently proposed action owner.
Definition: group_action_coordinator.h:275
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: group_action_coordinator.cc:1054
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: group_action_coordinator.cc:1017
The parent class for group wide operations.
Definition: group_action.h:35
Definition: group_action_message.h:33
enum_action_initiator_and_action
Enum to identify initiator and action.
Definition: group_action_message.h:81
The parent class for group wide operations.
Definition: group_action.h:139
enum_action_execution_result
Enum for the end results of a action execution.
Definition: group_action.h:142
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
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
repeated Action action
Definition: replication_group_member_actions.proto:43
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