#include <stddef.h>
#include <string>
#include "my_hostname.h"
#include "my_inttypes.h"
#include "my_thread_local.h"
#include "mysql/gtid/uuid.h"
#include "mysql_com.h"
#include "sql/resource_blocker.h"
#include "sql/sql_const.h"
Go to the source code of this file.
|
resource_blocker::Resource & | get_dump_thread_resource () |
|
int | register_replica (THD *thd, uchar *packet, size_t packet_length) |
| Register slave in 'slave_list' hash table. More...
|
|
void | unregister_replica (THD *thd, bool only_mine, bool need_lock_slave_list) |
|
bool | show_replicas (THD *thd) |
| Execute a SHOW REPLICAS statement. More...
|
|
String * | get_replica_uuid (THD *thd, String *value) |
| An auxiliary function extracts slave UUID. More...
|
|
bool | show_binary_log_status (THD *thd) |
| Execute a SHOW BINARY LOG STATUS statement. More...
|
|
bool | show_binlogs (THD *thd) |
| Execute a SHOW BINARY LOGS statement. More...
|
|
void | kill_zombie_dump_threads (THD *thd) |
|
bool | com_binlog_dump_gtid (THD *thd, char *packet, size_t packet_length) |
| Process a COM_BINLOG_DUMP_GTID packet. More...
|
|
bool | com_binlog_dump (THD *thd, char *packet, size_t packet_length) |
| Process a COM_BINLOG_DUMP packet. More...
|
|
void | mysql_binlog_send (THD *thd, char *log_ident, my_off_t pos, Gtid_set *gtid_set, uint32 flags) |
| Low-level function where the dump thread iterates over the binary log and sends events to the slave. More...
|
|
bool | reset_binary_logs_and_gtids (THD *thd, bool unlock_read_lock) |
| Execute a RESET BINARY LOGS AND GTIDS statement. More...
|
|
const user_var_entry * | get_user_var_from_alternatives (const THD *thd, const std::string alt1, const std::string alt2) |
| Read a user variable that may exist under two different names. More...
|
|
◆ com_binlog_dump()
bool com_binlog_dump |
( |
THD * |
thd, |
|
|
char * |
packet, |
|
|
size_t |
packet_length |
|
) |
| |
Process a COM_BINLOG_DUMP packet.
This function parses the packet and then calls mysql_binlog_send.
- Parameters
-
thd | The dump thread. |
packet | The COM_BINLOG_DUMP packet. |
packet_length | The length of the packet in bytes. |
- Return values
-
◆ com_binlog_dump_gtid()
bool com_binlog_dump_gtid |
( |
THD * |
thd, |
|
|
char * |
packet, |
|
|
size_t |
packet_length |
|
) |
| |
Process a COM_BINLOG_DUMP_GTID packet.
This function parses the packet and then calls mysql_binlog_send.
- Parameters
-
thd | The dump thread. |
packet | The COM_BINLOG_DUMP_GTID packet. |
packet_length | The length of the packet in bytes. |
- Return values
-
◆ get_dump_thread_resource()
◆ get_replica_uuid()
An auxiliary function extracts slave UUID.
- Parameters
-
[in] | thd | THD to access a user variable |
[out] | value | String to return UUID value. |
- Returns
- if success value is returned else NULL is returned.
◆ get_user_var_from_alternatives()
const user_var_entry * get_user_var_from_alternatives |
( |
const THD * |
thd, |
|
|
const std::string |
alt1, |
|
|
const std::string |
alt2 |
|
) |
| |
Read a user variable that may exist under two different names.
- Parameters
-
thd | The session to read from. |
alt1 | The first variable name alternative. |
alt2 | The second variable name alternative. |
- Return values
-
If | there exists a user variable in the current session with the first name, return that. Otherwise, if the second one exists, return that. Otherwise, return NULL. |
◆ kill_zombie_dump_threads()
void kill_zombie_dump_threads |
( |
THD * |
thd | ) |
|
◆ mysql_binlog_send()
Low-level function where the dump thread iterates over the binary log and sends events to the slave.
This function is common for both COM_BINLOG_DUMP and COM_BINLOG_DUMP_GTID.
- Parameters
-
thd | The dump thread. |
log_ident | The filename of the binary log, as given in the COM_BINLOG_DUMP[_GTID] packet. If this is is an empty string (first character is '\0'), we start with the oldest binary log. |
pos | The offset in the binary log, as given in the COM_BINLOG_DUMP[_GTID] packet. This must be at least 4 and at most the size of the binary log file. |
gtid_set | The gtid_set that the slave sent, or NULL if the protocol is COM_BINLOG_DUMP. |
flags | flags in COM_BINLOG_DUMP[_GTID] packets. |
- Note
- This function will start reading at the given (filename, offset), or from the oldest log if filename[0]==0. It will send all events from that position; but if gtid_set!=NULL, it will skip all events in that set.
◆ register_replica()
int register_replica |
( |
THD * |
thd, |
|
|
uchar * |
packet, |
|
|
size_t |
packet_length |
|
) |
| |
Register slave in 'slave_list' hash table.
- Returns
- 0 ok
-
1 Error. Error message sent to client
◆ reset_binary_logs_and_gtids()
bool reset_binary_logs_and_gtids |
( |
THD * |
thd, |
|
|
bool |
unlock_global_read_lock |
|
) |
| |
Execute a RESET BINARY LOGS AND GTIDS statement.
- Parameters
-
thd | Pointer to THD object of the client thread executing the statement. |
unlock_global_read_lock | Unlock the global read lock aquired by RESET BINARY LOGS AND GTIDS. |
- Return values
-
◆ show_binary_log_status()
bool show_binary_log_status |
( |
THD * |
thd | ) |
|
Execute a SHOW BINARY LOG STATUS statement.
- Parameters
-
thd | Pointer to THD object for the client thread executing the statement. |
- Return values
-
◆ show_binlogs()
bool show_binlogs |
( |
THD * |
thd | ) |
|
Execute a SHOW BINARY LOGS statement.
- Parameters
-
thd | Pointer to THD object for the client thread executing the statement. |
- Return values
-
◆ show_replicas()
bool show_replicas |
( |
THD * |
thd | ) |
|
Execute a SHOW REPLICAS statement.
- Parameters
-
thd | Pointer to THD object for the client thread executing the statement. |
- Return values
-
◆ unregister_replica()
void unregister_replica |
( |
THD * |
thd, |
|
|
bool |
only_mine, |
|
|
bool |
need_lock_slave_list |
|
) |
| |
◆ max_binlog_dump_events
int max_binlog_dump_events |
|
extern |
◆ opt_show_replica_auth_info
bool opt_show_replica_auth_info |
|
extern |
◆ opt_sporadic_binlog_dump_fail
bool opt_sporadic_binlog_dump_fail |
|
extern |