MySQL  8.0.19
Source Code Documentation
rpl_group_replication.cc File Reference
#include "sql/rpl_group_replication.h"
#include <stdlib.h>
#include <sys/types.h>
#include "m_string.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_loglevel.h"
#include "my_sys.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/components/services/log_shared.h"
#include "mysql/plugin.h"
#include "mysql/plugin_group_replication.h"
#include "mysql/service_mysql_alloc.h"
#include "mysqld_error.h"
#include "sql/log.h"
#include "sql/log_event.h"
#include "sql/mysqld.h"
#include "sql/mysqld_thd_manager.h"
#include "sql/replication.h"
#include "sql/rpl_channel_service_interface.h"
#include "sql/rpl_gtid.h"
#include "sql/rpl_slave.h"
#include "sql/sql_plugin.h"
#include "sql/sql_plugin_ref.h"
#include "sql/ssl_acceptor_context.h"
#include "sql/system_variables.h"

Functions

int group_replication_init ()
 Server side initializations. More...
 
bool is_group_replication_plugin_loaded ()
 
int group_replication_start (char **error_message)
 
int group_replication_stop (char **error_message)
 
bool is_group_replication_running ()
 
bool is_group_replication_cloning ()
 
int set_group_replication_retrieved_certification_info (View_change_log_event *view_change_event)
 
bool get_group_replication_connection_status_info (const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS &callbacks)
 
bool get_group_replication_group_members_info (unsigned int index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS &callbacks)
 
bool get_group_replication_group_member_stats_info (unsigned int index, const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS &callbacks)
 
unsigned int get_group_replication_members_number_info ()
 
char * my_strdup_nullable (OptionalString from)
 helper function to get_server_parameters More...
 
void get_server_parameters (char **hostname, uint *port, char **uuid, unsigned int *out_server_version)
 Returns the server hostname, port and uuid. More...
 
void get_server_ssl_parameters (st_server_ssl_variables *server_ssl_variables)
 Returns the server ssl configuration values. More...
 
ulong get_server_id ()
 Returns the server_id. More...
 
ulong get_auto_increment_increment ()
 Returns the server auto_increment_increment. More...
 
ulong get_auto_increment_offset ()
 Returns the server auto_increment_offset. More...
 
void set_auto_increment_increment (ulong auto_increment_increment)
 Set server auto_increment_increment. More...
 
void set_auto_increment_offset (ulong auto_increment_offset)
 Set server auto_increment_offset. More...
 
void get_server_startup_prerequirements (Trans_context_info &requirements, bool has_lock)
 Returns a struct containing all server startup information needed to evaluate if one has conditions to proceed executing master-master replication. More...
 
bool get_server_encoded_gtid_executed (uchar **encoded_gtid_executed, size_t *length)
 Returns the server GTID_EXECUTED encoded as a binary string. More...
 
char * encoded_gtid_set_to_string (uchar *encoded_gtid_set, size_t length)
 Returns a text representation of a encoded GTID set. More...
 
void global_thd_manager_add_thd (THD *thd)
 Add thread to Global_THD_manager singleton. More...
 
void global_thd_manager_remove_thd (THD *thd)
 Remove thread from Global_THD_manager singleton. More...
 
bool is_gtid_committed (const Gtid &gtid)
 Returns true if the given transaction is committed. More...
 
unsigned long get_slave_max_allowed_packet ()
 Returns the value of slave_max_allowed_packet. More...
 
unsigned long get_max_slave_max_allowed_packet ()
 
bool is_server_restarting_after_clone ()
 

Variables

ulong opt_mi_repository_id
 
ulong opt_rli_repository_id
 

Function Documentation

◆ encoded_gtid_set_to_string()

char* encoded_gtid_set_to_string ( uchar encoded_gtid_set,
size_t  length 
)

Returns a text representation of a encoded GTID set.

Note
Memory allocated to returned pointer must be release by caller.
Parameters
[in]encoded_gtid_setbinary string
[in]lengthbinary string length
Returns
a pointer to text representation of the encoded set

◆ get_auto_increment_increment()

ulong get_auto_increment_increment ( )

Returns the server auto_increment_increment.

Returns
auto_increment_increment

◆ get_auto_increment_offset()

ulong get_auto_increment_offset ( )

Returns the server auto_increment_offset.

Returns
auto_increment_offset

◆ get_group_replication_connection_status_info()

bool get_group_replication_connection_status_info ( const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS callbacks)

◆ get_group_replication_group_member_stats_info()

bool get_group_replication_group_member_stats_info ( unsigned int  index,
const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS callbacks 
)

◆ get_group_replication_group_members_info()

bool get_group_replication_group_members_info ( unsigned int  index,
const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS callbacks 
)

◆ get_group_replication_members_number_info()

unsigned int get_group_replication_members_number_info ( )

◆ get_max_slave_max_allowed_packet()

unsigned long get_max_slave_max_allowed_packet ( )
Returns
the maximum value of slave_max_allowed_packet.

◆ get_server_encoded_gtid_executed()

bool get_server_encoded_gtid_executed ( uchar **  encoded_gtid_executed,
size_t *  length 
)

Returns the server GTID_EXECUTED encoded as a binary string.

Note
Memory allocated to encoded_gtid_executed must be release by caller.
Parameters
[out]encoded_gtid_executedbinary string
[out]lengthbinary string length

◆ get_server_id()

ulong get_server_id ( )

Returns the server_id.

Returns
server_id

◆ get_server_parameters()

void get_server_parameters ( char **  hostname,
uint port,
char **  uuid,
unsigned int *  server_version 
)

Returns the server hostname, port and uuid.

Parameters
[out]hostname
[out]port
[out]uuid
[out]server_version

◆ get_server_ssl_parameters()

void get_server_ssl_parameters ( st_server_ssl_variables server_ssl_variables)

Returns the server ssl configuration values.

Parameters
[out]server_ssl_variables

◆ get_server_startup_prerequirements()

void get_server_startup_prerequirements ( Trans_context_info requirements,
bool  has_lock 
)

Returns a struct containing all server startup information needed to evaluate if one has conditions to proceed executing master-master replication.

Parameters
[out]requirements
[in]has_lockCaller should set this to true if the calling thread holds gtid_mode_lock; otherwise set it to false.

◆ get_slave_max_allowed_packet()

unsigned long get_slave_max_allowed_packet ( )

Returns the value of slave_max_allowed_packet.

Returns
slave_max_allowed_packet

◆ global_thd_manager_add_thd()

void global_thd_manager_add_thd ( THD thd)

Add thread to Global_THD_manager singleton.

Parameters
[in]thdThe thread

◆ global_thd_manager_remove_thd()

void global_thd_manager_remove_thd ( THD thd)

Remove thread from Global_THD_manager singleton.

Parameters
[in]thdThe thread

◆ group_replication_init()

int group_replication_init ( )

Server side initializations.

◆ group_replication_start()

int group_replication_start ( char **  error_message)

◆ group_replication_stop()

int group_replication_stop ( char **  error_message)

◆ is_group_replication_cloning()

bool is_group_replication_cloning ( )

◆ is_group_replication_plugin_loaded()

bool is_group_replication_plugin_loaded ( )

◆ is_group_replication_running()

bool is_group_replication_running ( )

◆ is_gtid_committed()

bool is_gtid_committed ( const Gtid gtid)

Returns true if the given transaction is committed.

Parameters
[in]gtidThe transaction identifier
Returns
true the transaction is committed false otherwise

◆ is_server_restarting_after_clone()

bool is_server_restarting_after_clone ( )
Returns
if the server is restarting after a clone

◆ my_strdup_nullable()

char* my_strdup_nullable ( OptionalString  from)
inline

helper function to get_server_parameters

◆ set_auto_increment_increment()

void set_auto_increment_increment ( ulong  auto_increment_increment)

Set server auto_increment_increment.

Parameters
[in]auto_increment_increment

◆ set_auto_increment_offset()

void set_auto_increment_offset ( ulong  auto_increment_offset)

Set server auto_increment_offset.

Parameters
[in]auto_increment_offset

◆ set_group_replication_retrieved_certification_info()

int set_group_replication_retrieved_certification_info ( View_change_log_event view_change_event)

Variable Documentation

◆ opt_mi_repository_id

ulong opt_mi_repository_id

◆ opt_rli_repository_id

ulong opt_rli_repository_id