MySQL 9.1.0
Source Code Documentation
Multi_primary_migration_action Class Reference

The group action class to do migration to multi primary mode. More...

#include <multi_primary_migration_action.h>

Inheritance diagram for Multi_primary_migration_action:
[legend]

Public Member Functions

 Multi_primary_migration_action ()
 Create a new primary election action. More...
 
 Multi_primary_migration_action (my_thread_id invoking_thread_id)
 Create a new primary election action. More...
 
 ~Multi_primary_migration_action () override
 
void get_action_message (Group_action_message **message) override
 Get the message with parameters to this action. More...
 
int process_action_message (Group_action_message &message, const std::string &message_origin) override
 
Group_action::enum_action_execution_result execute_action (bool invoking_member, Plugin_stage_monitor_handler *stage_handler, Notification_context *ctx) override
 Execute the action. More...
 
bool stop_action_execution (bool killed) override
 
Group_action_diagnosticsget_execution_info () override
 Gets the info about execution, be it success or failure. More...
 
PSI_stage_key get_action_stage_termination_key () override
 For this action, what is the PSI key for the last stage when the action is terminating. More...
 
- Public Member Functions inherited from Group_action
virtual ~Group_action ()=0
 

Private Member Functions

bool persist_variable_values ()
 Persist the value of the variables changed in the action. More...
 
void log_result_execution (bool aborted, bool mode_changed)
 Log the result of the execution. More...
 
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. More...
 
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. More...
 
int before_message_handling (const Plugin_gcs_message &message, const std::string &message_origin, bool *skip_message) override
 Executed before the message is processed. More...
 
- Private Member Functions inherited from Group_event_observer
virtual ~Group_event_observer ()=0
 

Private Attributes

my_thread_id invoking_thread_id
 The thread that invoked this action - if applicable, 0 otherwise. More...
 
bool multi_primary_switch_aborted
 Is the process aborted. More...
 
bool action_killed
 Was this action order to terminate by a kill signal. More...
 
std::string primary_uuid
 The current primary. More...
 
std::string primary_gcs_id
 The id of the primary. More...
 
bool is_primary
 If the member is primary. More...
 
bool is_primary_transaction_queue_applied
 Is the primary transaction back log consumed. More...
 
std::shared_ptr< Continuationapplier_checkpoint_condition
 Continuation object to wait on the applier queue consumption. More...
 
mysql_mutex_t notification_lock
 The lock for notifications. More...
 
mysql_cond_t notification_cond
 The condition for notifications. More...
 
Group_action_diagnostics execution_message_area
 Place to store result messages. More...
 

Additional Inherited Members

- Public Types inherited from Group_action
enum  enum_action_execution_result {
  GROUP_ACTION_RESULT_TERMINATED = 0 , GROUP_ACTION_RESULT_ERROR = 1 , GROUP_ACTION_RESULT_RESTART = 2 , GROUP_ACTION_RESULT_ABORTED = 3 ,
  GROUP_ACTION_RESULT_KILLED = 4 , GROUP_ACTION_RESULT_END = 5
}
 Enum for the end results of a action execution. More...
 

Detailed Description

The group action class to do migration to multi primary mode.

Constructor & Destructor Documentation

◆ Multi_primary_migration_action() [1/2]

Multi_primary_migration_action::Multi_primary_migration_action ( )

Create a new primary election action.

◆ Multi_primary_migration_action() [2/2]

Multi_primary_migration_action::Multi_primary_migration_action ( my_thread_id  invoking_thread_id)

Create a new primary election action.

Parameters
invoking_thread_idthe local thread id that is invoking this action

◆ ~Multi_primary_migration_action()

Multi_primary_migration_action::~Multi_primary_migration_action ( )
override

Member Function Documentation

◆ after_primary_election()

int Multi_primary_migration_action::after_primary_election ( std::string  primary_uuid,
enum_primary_election_primary_change_status  primary_change_status,
enum_primary_election_mode  election_mode,
int  error 
)
overrideprivatevirtual

Executed after primary election.

Parameters
primary_uuidthe elected primary
primary_change_statusif the primary changed after the election
election_modewhat was the election mode
errorif there was and error on the process

Implements Group_event_observer.

◆ after_view_change()

int Multi_primary_migration_action::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 
)
overrideprivatevirtual

Executed after view install and before primary election.

Parameters
joiningmembers joining the group
leavingmembers leaving the group
groupmembers in the group
is_leavingis the member leaving
[out]skip_electionskip primary election on view
[out]election_modeelection mode
[out]suggested_primarywhat should be the next primary to elect

Implements Group_event_observer.

◆ before_message_handling()

int Multi_primary_migration_action::before_message_handling ( const Plugin_gcs_message message,
const std::string &  message_origin,
bool *  skip_message 
)
overrideprivatevirtual

Executed before the message is processed.

Parameters
messageThe GCS message
message_originThe member that sent this message (address)
[out]skip_messageskip message handling if true

Implements Group_event_observer.

◆ execute_action()

Group_action::enum_action_execution_result Multi_primary_migration_action::execute_action ( bool  invoking_member,
Plugin_stage_monitor_handler stage_handler,
Notification_context ctx 
)
overridevirtual

Execute the action.

Parameters
invoking_memberis the member that invoked it
stage_handlerthe stage handler to report progress
ctxthe notification context
Returns
the execution result

Wait for all packets in the applier module to be consumed. This safety check prevents certification enabling packets from being read while this process executes

Implements Group_action.

◆ get_action_message()

void Multi_primary_migration_action::get_action_message ( Group_action_message **  message)
overridevirtual

Get the message with parameters to this action.

Parameters
[out]messagethe message to start the action

Implements Group_action.

◆ get_action_stage_termination_key()

PSI_stage_key Multi_primary_migration_action::get_action_stage_termination_key ( )
overridevirtual

For this action, what is the PSI key for the last stage when the action is terminating.

Returns
The stage key for this class

Reimplemented from Group_action.

◆ get_execution_info()

Group_action_diagnostics * Multi_primary_migration_action::get_execution_info ( )
overridevirtual

Gets the info about execution, be it success or failure.

Returns
the execution diagnostics object that was the message and its level

Implements Group_action.

◆ log_result_execution()

void Multi_primary_migration_action::log_result_execution ( bool  aborted,
bool  mode_changed 
)
private

Log the result of the execution.

Parameters
abortedwas the action aborted?
mode_changedwas the mode changed to multi primary?

◆ persist_variable_values()

bool Multi_primary_migration_action::persist_variable_values ( )
private

Persist the value of the variables changed in the action.

Returns
true if a problem was found, false otherwise

◆ process_action_message()

int Multi_primary_migration_action::process_action_message ( Group_action_message message,
const std::string &  message_origin 
)
overridevirtual

Implements Group_action.

◆ stop_action_execution()

bool Multi_primary_migration_action::stop_action_execution ( bool  killed)
overridevirtual

Implements Group_action.

Member Data Documentation

◆ action_killed

bool Multi_primary_migration_action::action_killed
private

Was this action order to terminate by a kill signal.

◆ applier_checkpoint_condition

std::shared_ptr<Continuation> Multi_primary_migration_action::applier_checkpoint_condition
private

Continuation object to wait on the applier queue consumption.

◆ execution_message_area

Group_action_diagnostics Multi_primary_migration_action::execution_message_area
private

Place to store result messages.

◆ invoking_thread_id

my_thread_id Multi_primary_migration_action::invoking_thread_id
private

The thread that invoked this action - if applicable, 0 otherwise.

◆ is_primary

bool Multi_primary_migration_action::is_primary
private

If the member is primary.

◆ is_primary_transaction_queue_applied

bool Multi_primary_migration_action::is_primary_transaction_queue_applied
private

Is the primary transaction back log consumed.

◆ multi_primary_switch_aborted

bool Multi_primary_migration_action::multi_primary_switch_aborted
private

Is the process aborted.

◆ notification_cond

mysql_cond_t Multi_primary_migration_action::notification_cond
private

The condition for notifications.

◆ notification_lock

mysql_mutex_t Multi_primary_migration_action::notification_lock
private

The lock for notifications.

◆ primary_gcs_id

std::string Multi_primary_migration_action::primary_gcs_id
private

The id of the primary.

◆ primary_uuid

std::string Multi_primary_migration_action::primary_uuid
private

The current primary.


The documentation for this class was generated from the following files: