MySQL  8.0.19
Source Code Documentation
plugin.h File Reference
#include <mysql/plugin.h>
#include <mysql/plugin_group_replication.h>
#include "plugin/group_replication/include/applier.h"
#include "plugin/group_replication/include/asynchronous_channels_state_observer.h"
#include "plugin/group_replication/include/auto_increment.h"
#include "plugin/group_replication/include/compatibility_module.h"
#include "plugin/group_replication/include/delayed_plugin_initialization.h"
#include "plugin/group_replication/include/gcs_event_handlers.h"
#include "plugin/group_replication/include/gcs_operations.h"
#include "plugin/group_replication/include/gcs_view_modification_notifier.h"
#include "plugin/group_replication/include/group_actions/group_action_coordinator.h"
#include "plugin/group_replication/include/plugin_constants.h"
#include "plugin/group_replication/include/plugin_handlers/group_partition_handling.h"
#include "plugin/group_replication/include/plugin_handlers/primary_election_invocation_handler.h"
#include "plugin/group_replication/include/plugin_handlers/read_mode_handler.h"
#include "plugin/group_replication/include/plugin_handlers/remote_clone_handler.h"
#include "plugin/group_replication/include/plugin_observers/channel_observation_manager.h"
#include "plugin/group_replication/include/plugin_observers/group_event_observer.h"
#include "plugin/group_replication/include/plugin_observers/group_transaction_observation_manager.h"
#include "plugin/group_replication/include/plugin_server_include.h"
#include "plugin/group_replication/include/ps_information.h"
#include "plugin/group_replication/include/recovery.h"
#include "plugin/group_replication/include/services/message_service/message_service.h"
#include "plugin/group_replication/include/services/registry.h"
#include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_interface.h"

Go to the source code of this file.

Classes

struct  SYS_VAR
 
struct  gr_modules
 This struct provides a namespace for the GR layer components. More...
 

Enumerations

enum  enum_channel_observation_manager_position { GROUP_CHANNEL_OBSERVATION_MANAGER_POS = 0, ASYNC_CHANNEL_OBSERVATION_MANAGER_POS, END_CHANNEL_OBSERVATION_MANAGER_POS }
 Position of channel observation manager's in channel_observation_manager_list. More...
 
enum  enum_exit_state_action { EXIT_STATE_ACTION_READ_ONLY = 0, EXIT_STATE_ACTION_ABORT_SERVER, EXIT_STATE_ACTION_OFFLINE_MODE }
 Action performed when the member leaves the group unexpectedly. More...
 

Functions

bool server_engine_initialized ()
 
void * get_plugin_pointer ()
 
mysql_mutex_tget_plugin_running_lock ()
 
Plugin_waitlockget_plugin_online_lock ()
 
int initialize_plugin_and_join (enum_plugin_con_isolation sql_api_isolation, Delayed_initialization_thread *delayed_init_thd)
 
int initialize_plugin_modules (gr_modules::mask modules_to_init)
 
int terminate_plugin_modules (gr_modules::mask modules_to_terminate, char **error_message=nullptr, bool rejoin=false)
 
void register_server_reset_master ()
 
bool get_allow_local_lower_version_join ()
 
ulong get_transaction_size_limit ()
 
bool is_plugin_waiting_to_set_server_read_mode ()
 
bool check_async_channel_running_on_secondary ()
 
void set_enforce_update_everywhere_checks (bool option)
 
void set_single_primary_mode_var (bool option)
 
void set_auto_increment_handler_values ()
 
void reset_auto_increment_handler_values (bool force_reset=false)
 
const mysql_service_registry_tget_plugin_registry ()
 
rpl_sidno get_group_sidno ()
 
bool is_autorejoin_enabled ()
 
uint get_number_of_autorejoin_tries ()
 
ulonglong get_rejoin_timeout ()
 
void declare_plugin_cloning (bool is_running)
 
bool attempt_rejoin ()
 Encapsulates the logic necessary to attempt a rejoin, i.e. More...
 
bool get_plugin_is_stopping ()
 
bool get_wait_on_engine_initialization ()
 
void enable_server_shutdown_status ()
 
bool get_server_shutdown_status ()
 
void set_plugin_is_setting_read_mode (bool value)
 
bool get_plugin_is_setting_read_mode ()
 
const char * get_group_name_var ()
 
ulong get_exit_state_action_var ()
 
ulong get_flow_control_mode_var ()
 
long get_flow_control_certifier_threshold_var ()
 
long get_flow_control_applier_threshold_var ()
 
long get_flow_control_min_quota_var ()
 
long get_flow_control_min_recovery_quota_var ()
 
long get_flow_control_max_quota_var ()
 
int get_flow_control_member_quota_percent_var ()
 
int get_flow_control_period_var ()
 
int get_flow_control_hold_percent_var ()
 
int get_flow_control_release_percent_var ()
 
ulong get_components_stop_timeout_var ()
 
void set_error_state_due_to_error_during_autorejoin ()
 
bool get_error_state_due_to_error_during_autorejoin ()
 
int plugin_group_replication_init (MYSQL_PLUGIN plugin_info)
 
int plugin_group_replication_deinit (void *p)
 
int plugin_group_replication_start (char **error_message=NULL)
 
int plugin_group_replication_stop (char **error_message=NULL)
 
bool plugin_is_group_replication_running ()
 
bool plugin_is_group_replication_cloning ()
 
bool is_plugin_auto_starting_on_non_bootstrap_member ()
 
bool is_plugin_configured_and_starting ()
 
bool initiate_wait_on_start_process ()
 Blocks the calling thread. More...
 
void terminate_wait_on_start_process (bool abort=false)
 Release all the blocked threads. More...
 
void set_wait_on_start_process (bool cond)
 Set condition to block or unblock the calling threads. More...
 
bool plugin_get_connection_status (const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS &callbacks)
 
bool plugin_get_group_members (uint index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS &callbacks)
 
bool plugin_get_group_member_stats (uint index, const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS &callbacks)
 
uint plugin_get_group_members_number ()
 
int plugin_group_replication_set_retrieved_certification_info (void *info)
 Method to set retrieved certification info from a recovery channel extracted from a given View_change event. More...
 

Variables

Gcs_operationsgcs_module
 The plugin modules. More...
 
Applier_moduleapplier_module
 The plugin applier. More...
 
Recovery_modulerecovery_module
 The plugin recovery module. More...
 
Registry_module_interfaceregistry_module
 The registry module. More...
 
Group_member_info_manager_interfacegroup_member_mgr
 
Group_events_observation_managergroup_events_observation_manager
 The observation module for group events. More...
 
Channel_observation_manager_listchannel_observation_manager_list
 The channel observation modules. More...
 
Asynchronous_channels_state_observerasynchronous_channels_state_observer
 The Single primary channel observation module. More...
 
Transaction_consistency_managertransaction_consistency_manager
 The plugin transaction consistency manager. More...
 
Group_transaction_observation_managergroup_transaction_observation_manager
 The transaction observation module. More...
 
Shared_writelockshared_plugin_stop_lock
 Class to coordinate access to the plugin stop lock. More...
 
Delayed_initialization_threaddelayed_initialization_thread
 Initialization thread for server starts. More...
 
Group_action_coordinatorgroup_action_coordinator
 The coordinator for group actions. More...
 
Primary_election_handlerprimary_election_handler
 The primary election handler. More...
 
Hold_transactionshold_transactions
 Hold transaction mechanism. More...
 
Autorejoin_threadautorejoin_module
 The thread that handles the auto-rejoin process. More...
 
Message_service_handlermessage_service_handler
 The thread that handles the message service process. More...
 
Plugin_gcs_events_handlerevents_handler
 
Group_member_infolocal_member_info
 
Compatibility_modulecompatibility_mgr
 
Group_partition_handlinggroup_partition_handler
 The transaction handler for network partitions. More...
 
Blocked_transaction_handlerblocked_transaction_handler
 The handler for transaction killing when an error or partition happens. More...
 
Remote_clone_handlerremote_clone_handler
 The handler to invoke clone. More...
 
Wait_ticket< my_thread_id > * transactions_latch
 Transactions latch. More...
 

Enumeration Type Documentation

◆ enum_channel_observation_manager_position

Position of channel observation manager's in channel_observation_manager_list.

Enumerator
GROUP_CHANNEL_OBSERVATION_MANAGER_POS 
ASYNC_CHANNEL_OBSERVATION_MANAGER_POS 
END_CHANNEL_OBSERVATION_MANAGER_POS 

◆ enum_exit_state_action

Action performed when the member leaves the group unexpectedly.

Enumerator
EXIT_STATE_ACTION_READ_ONLY 
EXIT_STATE_ACTION_ABORT_SERVER 
EXIT_STATE_ACTION_OFFLINE_MODE 

Function Documentation

◆ attempt_rejoin()

bool attempt_rejoin ( )

Encapsulates the logic necessary to attempt a rejoin, i.e.

gracefully leave the group, terminate GCS infrastructure, terminate auto-rejoin relevant plugin modules, reinitialize auto-rejoin relevant plugin modules, reinitialize GCS infrastructure and attempt to join the group again.

Returns
a flag indicating success or failure.
Return values
truethe rejoin failed.
falsethe rejoin succeeded.

◆ check_async_channel_running_on_secondary()

bool check_async_channel_running_on_secondary ( )

◆ declare_plugin_cloning()

void declare_plugin_cloning ( bool  is_running)

◆ enable_server_shutdown_status()

void enable_server_shutdown_status ( )

◆ get_allow_local_lower_version_join()

bool get_allow_local_lower_version_join ( )

◆ get_components_stop_timeout_var()

ulong get_components_stop_timeout_var ( )

◆ get_error_state_due_to_error_during_autorejoin()

bool get_error_state_due_to_error_during_autorejoin ( )

◆ get_exit_state_action_var()

ulong get_exit_state_action_var ( )

◆ get_flow_control_applier_threshold_var()

long get_flow_control_applier_threshold_var ( )

◆ get_flow_control_certifier_threshold_var()

long get_flow_control_certifier_threshold_var ( )

◆ get_flow_control_hold_percent_var()

int get_flow_control_hold_percent_var ( )

◆ get_flow_control_max_quota_var()

long get_flow_control_max_quota_var ( )

◆ get_flow_control_member_quota_percent_var()

int get_flow_control_member_quota_percent_var ( )

◆ get_flow_control_min_quota_var()

long get_flow_control_min_quota_var ( )

◆ get_flow_control_min_recovery_quota_var()

long get_flow_control_min_recovery_quota_var ( )

◆ get_flow_control_mode_var()

ulong get_flow_control_mode_var ( )

◆ get_flow_control_period_var()

int get_flow_control_period_var ( )

◆ get_flow_control_release_percent_var()

int get_flow_control_release_percent_var ( )

◆ get_group_name_var()

const char* get_group_name_var ( )

◆ get_group_sidno()

rpl_sidno get_group_sidno ( )

◆ get_number_of_autorejoin_tries()

uint get_number_of_autorejoin_tries ( )

◆ get_plugin_is_setting_read_mode()

bool get_plugin_is_setting_read_mode ( )

◆ get_plugin_is_stopping()

bool get_plugin_is_stopping ( )

◆ get_plugin_online_lock()

Plugin_waitlock* get_plugin_online_lock ( )

◆ get_plugin_pointer()

void* get_plugin_pointer ( )

◆ get_plugin_registry()

const mysql_service_registry_t* get_plugin_registry ( )

◆ get_plugin_running_lock()

mysql_mutex_t* get_plugin_running_lock ( )

◆ get_rejoin_timeout()

ulonglong get_rejoin_timeout ( )

◆ get_server_shutdown_status()

bool get_server_shutdown_status ( )

◆ get_transaction_size_limit()

ulong get_transaction_size_limit ( )

◆ get_wait_on_engine_initialization()

bool get_wait_on_engine_initialization ( )

◆ initialize_plugin_and_join()

int initialize_plugin_and_join ( enum_plugin_con_isolation  sql_api_isolation,
Delayed_initialization_thread delayed_init_thd 
)

◆ initialize_plugin_modules()

int initialize_plugin_modules ( gr_modules::mask  modules_to_init)

◆ initiate_wait_on_start_process()

bool initiate_wait_on_start_process ( )

Blocks the calling thread.

◆ is_autorejoin_enabled()

bool is_autorejoin_enabled ( )

◆ is_plugin_auto_starting_on_non_bootstrap_member()

bool is_plugin_auto_starting_on_non_bootstrap_member ( )

◆ is_plugin_configured_and_starting()

bool is_plugin_configured_and_starting ( )

◆ is_plugin_waiting_to_set_server_read_mode()

bool is_plugin_waiting_to_set_server_read_mode ( )

◆ plugin_get_connection_status()

bool plugin_get_connection_status ( const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS callbacks)

◆ plugin_get_group_member_stats()

bool plugin_get_group_member_stats ( uint  index,
const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS callbacks 
)

◆ plugin_get_group_members()

bool plugin_get_group_members ( uint  index,
const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS callbacks 
)

◆ plugin_get_group_members_number()

uint plugin_get_group_members_number ( )

◆ plugin_group_replication_deinit()

int plugin_group_replication_deinit ( void *  p)

◆ plugin_group_replication_init()

int plugin_group_replication_init ( MYSQL_PLUGIN  plugin_info)

◆ plugin_group_replication_set_retrieved_certification_info()

int plugin_group_replication_set_retrieved_certification_info ( void *  info)

Method to set retrieved certification info from a recovery channel extracted from a given View_change event.

Note
a copy of the certification info is made here.
Parameters
infothe given view_change_event.

◆ plugin_group_replication_start()

int plugin_group_replication_start ( char **  error_message = NULL)

◆ plugin_group_replication_stop()

int plugin_group_replication_stop ( char **  error_message = NULL)

◆ plugin_is_group_replication_cloning()

bool plugin_is_group_replication_cloning ( )

◆ plugin_is_group_replication_running()

bool plugin_is_group_replication_running ( )

◆ register_server_reset_master()

void register_server_reset_master ( )

◆ reset_auto_increment_handler_values()

void reset_auto_increment_handler_values ( bool  force_reset = false)

◆ server_engine_initialized()

bool server_engine_initialized ( )

◆ set_auto_increment_handler_values()

void set_auto_increment_handler_values ( )

◆ set_enforce_update_everywhere_checks()

void set_enforce_update_everywhere_checks ( bool  option)

◆ set_error_state_due_to_error_during_autorejoin()

void set_error_state_due_to_error_during_autorejoin ( )

◆ set_plugin_is_setting_read_mode()

void set_plugin_is_setting_read_mode ( bool  value)

◆ set_single_primary_mode_var()

void set_single_primary_mode_var ( bool  option)

◆ set_wait_on_start_process()

void set_wait_on_start_process ( bool  cond)

Set condition to block or unblock the calling threads.

Parameters
[in]condif the threads should be blocked or not

◆ terminate_plugin_modules()

int terminate_plugin_modules ( gr_modules::mask  modules_to_terminate,
char **  error_message = nullptr,
bool  rejoin = false 
)

◆ terminate_wait_on_start_process()

void terminate_wait_on_start_process ( bool  abort = false)

Release all the blocked threads.

Variable Documentation

◆ applier_module

Applier_module* applier_module

The plugin applier.

◆ asynchronous_channels_state_observer

Asynchronous_channels_state_observer* asynchronous_channels_state_observer

The Single primary channel observation module.

◆ autorejoin_module

Autorejoin_thread* autorejoin_module

The thread that handles the auto-rejoin process.

◆ blocked_transaction_handler

Blocked_transaction_handler* blocked_transaction_handler

The handler for transaction killing when an error or partition happens.

◆ channel_observation_manager_list

Channel_observation_manager_list* channel_observation_manager_list

The channel observation modules.

◆ compatibility_mgr

Compatibility_module* compatibility_mgr

◆ delayed_initialization_thread

Delayed_initialization_thread* delayed_initialization_thread

Initialization thread for server starts.

◆ events_handler

Plugin_gcs_events_handler* events_handler

◆ gcs_module

Gcs_operations* gcs_module

The plugin modules.

Note
Whenever you want to create a new plugin module, be sure to add it to the gr_modules enum (
See also
gr_modules) and see if it's part of the rejoin process.

The plugin modules.

◆ group_action_coordinator

Group_action_coordinator* group_action_coordinator

The coordinator for group actions.

◆ group_events_observation_manager

Group_events_observation_manager* group_events_observation_manager

The observation module for group events.

◆ group_member_mgr

◆ group_partition_handler

Group_partition_handling* group_partition_handler

The transaction handler for network partitions.

◆ group_transaction_observation_manager

Group_transaction_observation_manager* group_transaction_observation_manager

The transaction observation module.

◆ hold_transactions

Hold_transactions* hold_transactions

Hold transaction mechanism.

◆ local_member_info

Group_member_info* local_member_info

◆ message_service_handler

Message_service_handler* message_service_handler

The thread that handles the message service process.

◆ primary_election_handler

Primary_election_handler* primary_election_handler

The primary election handler.

◆ recovery_module

Recovery_module* recovery_module

The plugin recovery module.

◆ registry_module

Registry_module_interface* registry_module

The registry module.

◆ remote_clone_handler

Remote_clone_handler* remote_clone_handler

The handler to invoke clone.

◆ shared_plugin_stop_lock

Shared_writelock* shared_plugin_stop_lock

Class to coordinate access to the plugin stop lock.

◆ transaction_consistency_manager

Transaction_consistency_manager* transaction_consistency_manager

The plugin transaction consistency manager.

◆ transactions_latch

Wait_ticket<my_thread_id>* transactions_latch

Transactions latch.