70#define SOURCE_DELAY_MAX (0x7FFFFFFF)
71#if INT_MAX < 0x7FFFFFFF
72#error "don't support platforms where INT_MAX < 0x7FFFFFFF"
90#define REPLICA_MAX_HEARTBEAT_PERIOD 4294967
92#define REPLICA_NET_TIMEOUT 60
94#define MAX_SLAVE_ERROR 14000
96#define MTS_WORKER_UNDEF ((ulong)-1)
97#define MTS_MAX_WORKERS 1024
98#define MAX_SLAVE_RETRY_PAUSE 5
106#define MTS_MAX_BITS_IN_GROUP ((1L << 19) - 8)
426#define MYSQL_SLAVE_NOT_RUN 0
427#define MYSQL_SLAVE_RUN_NOT_CONNECT 1
428#define MYSQL_SLAVE_RUN_CONNECT 2
434#define SLAVE_FORCE_ALL 4
441 bool preserve_logs =
false);
484 Master_info *mi,
bool ignore_if_no_info,
int thread_mask,
485 bool skip_received_gtid_set_and_relaylog_recovery =
false,
486 bool force_load =
false);
534 bool flush_relay_log =
true,
535 bool skip_repo_persistence =
false);
562 ulong stop_wait_timeout,
563 bool need_lock_term =
true);
572 bool *push_temp_table_warning);
582 std::atomic<uint> *slave_running,
583 std::atomic<ulong> *slave_run_id,
Master_info *mi);
610 bool need_lock =
true,
bool need_log_space_lock =
true);
617 ulong event_len,
bool flush_mi =
true);
620 std::string binlog_name, uint64_t position,
621 unsigned long &inc_pos,
bool &do_flush_mi);
648 bool suppress_warnings,
649 const std::string &
host = std::string(),
650 const uint
port = 0,
bool is_io_thread =
true);
Definition: rpl_rli.h:203
Helper class used to initialize the replica (includes init_replica())
Definition: rpl_replica.h:373
int m_init_code
Replica initialization error code.
Definition: rpl_replica.h:413
int m_thread_mask
Thread mask indicating type of the thread.
Definition: rpl_replica.h:414
bool m_opt_skip_replica_start
Indicates whether replica threads should be started or not.
Definition: rpl_replica.h:411
bool m_opt_initialize_replica
Indicates whether to initialize replica.
Definition: rpl_replica.h:409
The class is a container for all the per-channel filters, both a map of Rpl_filter objects and a list...
Definition: rpl_msr.h:489
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
bool stop_slave_cmd(THD *thd)
Entry point for the STOP REPLICA command.
Definition: rpl_replica.cc:832
char * replica_load_tmpdir
Definition: rpl_replica.cc:194
QUEUE_EVENT_RESULT
Definition: rpl_replica.h:611
bool opt_log_replica_updates
Definition: mysqld.cc:1250
bool sql_slave_killed(THD *thd, Relay_log_info *rli)
The function analyzes a possible killed status and makes a decision whether to accept it or not.
Definition: rpl_replica.cc:2269
int heartbeat_queue_event(bool is_valid, Master_info *&mi, std::string binlog_name, uint64_t position, unsigned long &inc_pos, bool &do_flush_mi)
Definition: rpl_replica.cc:7479
const char * relay_log_basename
Definition: rpl_replica.cc:199
bool net_request_file(NET *net, const char *fname)
Definition: rpl_replica.cc:2376
bool start_slave_threads(bool need_lock_slave, bool wait_for_start, Master_info *mi, int thread_mask)
Definition: rpl_replica.cc:2061
bool mta_checkpoint_routine(Relay_log_info *rli, bool force)
Processing rli->gaq to find out the low-water-mark (lwm) coordinates which is stored into the central...
Definition: rpl_replica.cc:6443
void clear_info(Master_info *mi)
Clear the information regarding the Master_info and Relay_log_info objects represented by the paramet...
Definition: rpl_replica.cc:1404
ulong source_retry_count
Definition: mysqld.cc:1646
void set_replica_skip_errors(char **replica_skip_errors_ptr)
Change arg to the string with the nice, human-readable skip error values.
Definition: rpl_replica.cc:1591
void start_threads()
This function starts replication threads.
Definition: rpl_replica.cc:507
bool change_master_cmd(THD *thd)
Entry point for the CHANGE REPLICATION SOURCE command.
Definition: rpl_replica.cc:10963
int load_mi_and_rli_from_repositories(Master_info *mi, bool ignore_if_no_info, int thread_mask, bool skip_received_gtid_set_and_relaylog_recovery, bool force_load)
Call mi->init_info() and/or mi->rli->init_info(), which will read the replication configuration from ...
Definition: rpl_replica.cc:1282
char * opt_relay_logname
Definition: mysqld.cc:1648
void end_info(Master_info *mi)
Definition: rpl_replica.cc:1392
bool replicate_same_server_id
Definition: rpl_replica.cc:195
int init_replica_thread(THD *thd, SLAVE_THD_TYPE thd_type)
Definition: rpl_replica.cc:4033
int remove_info(Master_info *mi)
Definition: rpl_replica.cc:1424
char * report_password
Definition: rpl_replica.h:658
ReplicaInitializer(bool opt_initialize, bool opt_skip_replica_start, Rpl_channel_filters &filters, char **replica_skip_erors)
Constructor, calls init_replica()
Definition: rpl_replica.cc:437
const char * print_slave_db_safe(const char *db)
Definition: rpl_replica.cc:2389
bool reencrypt_relay_logs()
Re-encrypt previous relay logs with current master key for all slave channels.
Definition: rpl_replica.cc:8739
QUEUE_EVENT_RESULT queue_event(Master_info *mi, const char *buf, ulong event_len, bool do_flush_mi)
Store an event received from the master connection into the relay log.
Definition: rpl_replica.cc:7582
bool flush_relay_logs_cmd(THD *thd)
Entry point for FLUSH RELAYLOGS command or to flush relaylogs for the FLUSH LOGS command.
Definition: rpl_replica.cc:8671
char * report_user
Definition: mysqld.cc:1647
static void init_replica_psi_keys()
Initializes replica PSI keys in case PSI interface is available.
Definition: rpl_replica.cc:542
int stop_slave(THD *thd)
Function to stop a slave for all channels.
Definition: rpl_replica.cc:686
int add_new_channel(Master_info **mi, const char *channel)
This function is first called when the Master_info object corresponding to a channel in a multisource...
Definition: rpl_replica.cc:10811
void * handle_slave_io(void *arg)
Slave IO thread entry point.
Definition: rpl_replica.cc:5314
bool reset_slave_cmd(THD *thd)
Entry function for RESET REPLICA command.
Definition: rpl_replica.cc:9294
bool is_network_error(uint errorno)
Definition: rpl_replica.cc:2395
void add_replica_skip_errors(const char *arg)
Definition: rpl_replica.cc:1640
ulonglong relay_log_space_limit
Definition: rpl_replica.cc:196
bool opt_skip_replica_start
If set, slave is not autostarted.
Definition: mysqld.cc:1245
int rotate_relay_log(Master_info *mi, bool log_master_fd, bool need_lock, bool need_log_space_lock)
Rotates the relay log.
Definition: rpl_replica.cc:8565
void start_replication_threads(bool skip_replica_start=true)
This function starts replication threads.
Definition: rpl_replica.cc:501
bool show_slave_status(THD *thd)
Method to the show the replication status in all channels.
Definition: rpl_replica.cc:3723
void print_channel_info() const
In case debug mode is on, prints channel information.
Definition: rpl_replica.cc:480
bool reset_info(Master_info *mi)
Resets the information regarding the Master_info and Relay_log_info objects represented by the parame...
Definition: rpl_replica.cc:1445
const char * relay_log_index
Definition: rpl_replica.cc:198
int init_replica()
Performs replica initialization, creates default replication channel and sets channel filters.
Definition: rpl_replica.cc:555
int flush_relay_logs(Master_info *mi, THD *thd)
flushes the relay logs of a replication channel.
Definition: rpl_replica.cc:8625
void delete_slave_info_objects()
Free all resources used by slave threads at time of executing shutdown.
Definition: rpl_replica.cc:2188
bool mts_recovery_groups(Relay_log_info *rli)
Definition: rpl_replica.cc:6187
int change_master(THD *thd, Master_info *mi, LEX_SOURCE_INFO *lex_mi, bool preserve_logs)
Execute a CHANGE REPLICATION SOURCE statement.
Definition: rpl_replica.cc:10457
bool start_slave_cmd(THD *thd)
Entry point to the START REPLICA command.
Definition: rpl_replica.cc:733
int flush_master_info(Master_info *mi, bool force, bool need_lock, bool do_flush_relay_log, bool skip_repo_persistence)
This method flushes the current configuration for the channel into the connection metadata repository...
Definition: rpl_replica.cc:1480
char * report_host
Definition: mysqld.cc:1647
uint report_port
Definition: mysqld.cc:1645
bool opt_relaylog_index_name_supplied
Definition: mysqld.cc:1653
bool start_slave_thread(PSI_thread_key thread_key, my_start_routine h_func, mysql_mutex_t *start_lock, mysql_mutex_t *cond_lock, mysql_cond_t *start_cond, std::atomic< uint > *slave_running, std::atomic< ulong > *slave_run_id, Master_info *mi)
Definition: rpl_replica.cc:1985
void set_slave_thread_options(THD *thd)
Set slave thread default options.
Definition: rpl_replica.cc:3964
int get_initialization_code() const
Gets initialization code set-up at replica initialization.
Definition: rpl_replica.cc:435
bool server_id_supplied
Definition: mysqld.cc:1205
char * opt_relaylog_index_name
Definition: rpl_replica.h:359
int connect_to_master(THD *thd, MYSQL *mysql, Master_info *mi, bool reconnect, bool suppress_warnings, const std::string &host, const uint port, bool is_io_thread)
Definition: rpl_replica.cc:8338
int terminate_slave_threads(Master_info *mi, int thread_mask, ulong stop_wait_timeout, bool need_lock_term)
Terminates the slave threads according to the given mask.
Definition: rpl_replica.cc:1712
int init_recovery(Master_info *mi)
Definition: rpl_replica.cc:1162
char slave_skip_error_names[]
Definition: rpl_replica.cc:192
void end_slave()
Definition: rpl_replica.cc:2157
MY_BITMAP slave_error_mask
Definition: rpl_replica.cc:191
char * opt_binlog_index_name
Definition: mysqld.cc:1677
bool show_slave_status_cmd(THD *thd)
Entry point for SHOW REPLICA STATUS command.
Definition: rpl_replica.cc:3919
void * handle_slave_sql(void *arg)
Slave SQL thread entry point.
Definition: rpl_replica.cc:6958
bool use_slave_mask
Definition: rpl_replica.cc:190
void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli)
Definition: rpl_replica.cc:4010
bool opt_relay_logname_supplied
Definition: mysqld.cc:1658
bool start_slave(THD *thd)
Function to start a slave for all channels.
Definition: rpl_replica.cc:623
char * opt_replica_skip_errors
Definition: mysqld.cc:1251
@ QUEUE_EVENT_OK
Definition: rpl_replica.h:612
@ QUEUE_EVENT_ERROR_QUEUING
Definition: rpl_replica.h:613
@ QUEUE_EVENT_ERROR_FLUSHING_INFO
Definition: rpl_replica.h:614
unsigned int PSI_thread_key
Instrumented thread key.
Definition: psi_thread_bits.h:50
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Defines to make different thread packages compatible.
void *(* my_start_routine)(void *)
Definition: my_thread.h:72
static int reconnect()
Definition: mysql.cc:3366
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
Common definition between mysql server & client.
const char * host
Definition: mysqladmin.cc:65
bool opt_initialize
Definition: mysqld.cc:1244
Definition: buf0block_hint.cc:30
constexpr value_type reset_slave
Definition: classic_protocol_constants.h:314
bool is_valid(const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, bool *is_valid) noexcept
Decides if a geometry is valid.
Definition: is_valid.cc:95
Definition: instrumented_condition_variable.h:32
Performance schema instrumentation interface.
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
const long mts_online_stat_period
Definition: rpl_replica.h:55
const long mts_online_stat_count
Definition: rpl_replica.h:56
SLAVE_THD_TYPE
Definition: rpl_replica.h:60
@ SLAVE_THD_SQL
Definition: rpl_replica.h:62
@ SLAVE_THD_IO
Definition: rpl_replica.h:61
@ SLAVE_THD_WORKER
Definition: rpl_replica.h:63
@ SLAVE_THD_MONITOR
Definition: rpl_replica.h:64
Declarations for the Debug Sync Facility.
Structure to hold parameters for CHANGE REPLICATION SOURCE, START REPLICA, and STOP REPLICA.
Definition: sql_lex.h:353
Definition: my_bitmap.h:43
Definition: mysql_com.h:914
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: sql_lex.h:2546