MySQL 8.0.40
Source Code Documentation
rpl_group_replication.cc File Reference

Namespaces

namespace  anonymous_namespace{rpl_group_replication.cc}
 

Functions

 REQUIRES_SERVICE_PLACEHOLDER (component_sys_variable_register)
 
 REQUIRES_SERVICE_PLACEHOLDER (component_sys_variable_unregister)
 
int group_replication_init ()
 Server side initializations. More...
 
bool is_group_replication_plugin_loaded ()
 
int group_replication_start (char **error_message, THD *thd)
 
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, uint *out_admin_port)
 Returns the server hostname, port and uuid. More...
 
void get_server_main_ssl_parameters (st_server_ssl_variables *server_ssl_variables)
 Returns the server's client-server interface's ssl configuration values. More...
 
void get_server_admin_ssl_parameters (st_server_ssl_variables *server_ssl_variables)
 Returns the server's admin interface's 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)
 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...
 
bool wait_for_gtid_set_committed (const char *gtid_set_text, double timeout, bool update_thd_status)
 Wait until the given Gtid_set is included in @GLOBAL.GTID_EXECUTED. More...
 
unsigned long get_replica_max_allowed_packet ()
 Returns the value of replica_max_allowed_packet. More...
 
unsigned long get_max_replica_max_allowed_packet ()
 
bool is_server_restarting_after_clone ()
 
bool is_server_data_dropped ()
 
std::string get_group_replication_group_name ()
 Getter to extract the group_name in GR which, this can be used outside GR to find out the group name. More...
 
bool get_group_replication_view_change_uuid (std::string &uuid)
 Getter to extract the value of variable group_replication_view_change_uuid in Group Replication. More...
 
bool is_group_replication_member_secondary ()
 Checks if this member is part of a group in single-primary mode and if this member is a secondary. More...
 

Variables

ulong opt_mi_repository_id
 
ulong opt_rli_repository_id
 
std::atomic_flag start_stop_executing = ATOMIC_FLAG_INIT
 
LEX_CSTRING anonymous_namespace{rpl_group_replication.cc}::group_replication_plugin_name_str
 Static name of Group Replication plugin. More...
 

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_group_name()

std::string get_group_replication_group_name ( )

Getter to extract the group_name in GR which, this can be used outside GR to find out the group name.

◆ get_group_replication_members_number_info()

unsigned int get_group_replication_members_number_info ( )

◆ get_group_replication_view_change_uuid()

bool get_group_replication_view_change_uuid ( std::string &  uuid)

Getter to extract the value of variable group_replication_view_change_uuid in Group Replication.

If group_replication_view_change_uuid variable isn't defined or service retrieves error when getting variable it will return default value "AUTOMATIC".

Parameters
[out]uuidRetrieves value of variable group_replication_view_change
Returns
the operation status
Return values
falseOK
trueError

◆ get_max_replica_max_allowed_packet()

unsigned long get_max_replica_max_allowed_packet ( )
Returns
the maximum value of replica_max_allowed_packet.

◆ get_replica_max_allowed_packet()

unsigned long get_replica_max_allowed_packet ( )

Returns the value of replica_max_allowed_packet.

Returns
replica_max_allowed_packet

◆ get_server_admin_ssl_parameters()

void get_server_admin_ssl_parameters ( st_server_ssl_variables server_ssl_variables)

Returns the server's admin interface's ssl configuration values.

Parameters
[out]server_ssl_variablesserver's ssl_variables

◆ 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_main_ssl_parameters()

void get_server_main_ssl_parameters ( st_server_ssl_variables server_ssl_variables)

Returns the server's client-server interface's ssl configuration values.

Parameters
[out]server_ssl_variablesserver's ssl_variables

◆ get_server_parameters()

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

Returns the server hostname, port and uuid.

Parameters
[out]hostnamehostname
[out]portport
[out]uuiduuid
[out]server_versionserver version
[out]admin_portmysqld admin port

◆ get_server_startup_prerequirements()

void get_server_startup_prerequirements ( Trans_context_info requirements)

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

Parameters
[out]requirementsrequirements

◆ 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,
THD thd 
)

◆ group_replication_stop()

int group_replication_stop ( char **  error_message)

◆ is_group_replication_cloning()

bool is_group_replication_cloning ( )

◆ is_group_replication_member_secondary()

bool is_group_replication_member_secondary ( )

Checks if this member is part of a group in single-primary mode and if this member is a secondary.

Returns
status
Return values
truethis member is part of a group in single-primary mode and is a secondary
falseotherwise

◆ 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_data_dropped()

bool is_server_data_dropped ( )
Returns
if the server already dropped its data when cloning

◆ 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

◆ REQUIRES_SERVICE_PLACEHOLDER() [1/2]

REQUIRES_SERVICE_PLACEHOLDER ( component_sys_variable_register  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [2/2]

REQUIRES_SERVICE_PLACEHOLDER ( component_sys_variable_unregister  )

◆ set_auto_increment_increment()

void set_auto_increment_increment ( ulong  auto_increment_increment)

Set server auto_increment_increment.

Parameters
[in]auto_increment_incrementauto-increment increment

◆ set_auto_increment_offset()

void set_auto_increment_offset ( ulong  auto_increment_offset)

Set server auto_increment_offset.

Parameters
[in]auto_increment_offsetauto-increment offset

◆ set_group_replication_retrieved_certification_info()

int set_group_replication_retrieved_certification_info ( View_change_log_event view_change_event)

◆ wait_for_gtid_set_committed()

bool wait_for_gtid_set_committed ( const char *  gtid_set_text,
double  timeout,
bool  update_thd_status 
)

Wait until the given Gtid_set is included in @GLOBAL.GTID_EXECUTED.

Parameters
[in]gtid_set_textGtid_set to wait for.
[in]timeoutThe maximum number of seconds that the function should wait, or 0 to wait indefinitely.
[in]update_thd_statuswhen true updates the stage info with the new wait condition, when false keeps the current stage info.
Return values
falsethe Gtid_set is included in @GLOBAL.GTID_EXECUTED
trueotherwise

Variable Documentation

◆ opt_mi_repository_id

ulong opt_mi_repository_id
extern

◆ opt_rli_repository_id

ulong opt_rli_repository_id
extern

◆ start_stop_executing

std::atomic_flag start_stop_executing = ATOMIC_FLAG_INIT