24#ifndef REPLICATION_THREADS_API_INCLUDE
25#define REPLICATION_THREADS_API_INCLUDE
33#define DEFAULT_THREAD_PRIORITY 0
35#define GROUP_REPLICATION_APPLIER_THREAD_PRIORITY 1
88 bool use_ssl,
char *ssl_ca,
char *ssl_capath,
89 char *ssl_cert,
char *ssl_cipher,
char *ssl_key,
90 char *ssl_crl,
char *ssl_crlpath,
92 int retry_count,
bool preserve_logs,
93 char *public_key_path,
bool get_public_key,
94 char *compression_algorithm,
95 uint zstd_compression_level,
char *tls_version,
96 char *tls_ciphersuites,
bool ignore_ws_mem_limit,
97 bool allow_drop_write_set);
121 bool start_receiver,
bool start_applier, std::string *view_id,
122 bool wait_for_connection,
135 int stop_threads(
bool stop_receiver,
bool stop_applier);
236 bool update_THD_status =
true);
262 const char *channel_name =
nullptr);
304 const char *channel_name =
nullptr);
361 const char *channel_name =
nullptr);
374 const char *channel_name =
nullptr);
387 const char *uuid_param);
Definition: replication_threads_api.h:37
static int rpl_binlog_dump_thread_kill()
Interface to kill binlog dump thread.
Definition: replication_threads_api.cc:388
static int rpl_channel_stop_all(int threads_to_stop, long timeout)
Interface to Channel Service Interface channel_stop_all method.
Definition: replication_threads_api.cc:369
bool is_partial_transaction_on_relay_log()
Checks if the channel's relay log contains partial transaction.
Definition: replication_threads_api.cc:365
bool get_channel_credentials(std::string &username, std::string &password, const char *channel_name=nullptr)
Method to get the credentials configured for a channel.
Definition: replication_threads_api.cc:335
ulong stop_wait_timeout
Definition: replication_threads_api.h:390
bool is_receiver_thread_running()
Checks if the receiver thread is running.
Definition: replication_threads_api.cc:189
static int delete_credential(const char *channel_name)
Interface to remove stored credentials from thread api.
Definition: replication_threads_api.cc:393
bool is_own_event_applier(my_thread_id id, const char *channel_name=nullptr)
Checks if the given id matches any of the event applying threads for the configured channel.
Definition: replication_threads_api.cc:260
void set_stop_wait_timeout(ulong timeout)
Sets the threads shutdown timeout.
Definition: replication_threads_api.h:292
bool is_own_event_receiver(my_thread_id id)
Checks if the given id matches the receiver thread for the configured channel.
Definition: replication_threads_api.cc:299
Replication_thread_api()
Definition: replication_threads_api.cc:39
bool get_retrieved_gtid_set(std::string &retrieved_set, const char *channel_name=nullptr)
Returns the retrieved gtid set from the receiver thread.
Definition: replication_threads_api.cc:319
~Replication_thread_api()=default
bool get_channel_network_namespace(std::string &net_ns, const char *channel_name=nullptr)
Method to get the network namespace configured for a channel.
Definition: replication_threads_api.cc:351
rpl_gno get_last_delivered_gno(rpl_sidno sidno)
Returns last GNO from the applier for a given UUID.
Definition: replication_threads_api.cc:249
int start_threads(bool start_receiver, bool start_applier, std::string *view_id, bool wait_for_connection, enum_channel_until_condition until_condition=CHANNEL_UNTIL_VIEW_ID)
Start the Applier/Receiver threads according to the given options.
Definition: replication_threads_api.cc:115
bool is_applier_thread_running()
Checks if the applier thread is running.
Definition: replication_threads_api.cc:197
bool is_any_channel_using_uuid_for_assign_gtids_to_anonymous_transaction(const char *uuid_param)
Checks if any channel uses the same UUID for assign_gtids_to_anonymous_transactions as the given uuid...
Definition: replication_threads_api.cc:399
int purge_logs(bool reset_all)
Purges the relay logs.
Definition: replication_threads_api.cc:155
void set_channel_name(const char *channel_name)
Set the channel name to be used on the interface method invocation.
Definition: replication_threads_api.h:50
bool is_receiver_thread_stopping()
Checks if the receiver thread is stopping.
Definition: replication_threads_api.cc:193
int stop_threads(bool stop_receiver, bool stop_applier)
Stops the channel threads according to the given options.
Definition: replication_threads_api.cc:166
int wait_for_gtid_execution(double timeout)
Checks if all the queued transactions were executed.
Definition: replication_threads_api.cc:213
int get_applier_thread_ids(unsigned long **thread_ids)
Method to get applier ids from the configured channel.
Definition: replication_threads_api.cc:254
bool is_applier_thread_waiting()
Checks if the applier, and its workers when parallel applier is enabled, has already consumed all rel...
Definition: replication_threads_api.cc:209
const char * interface_channel
Definition: replication_threads_api.h:391
int initialize_channel(char *hostname, uint port, char *user, char *password, bool use_ssl, char *ssl_ca, char *ssl_capath, char *ssl_cert, char *ssl_cipher, char *ssl_key, char *ssl_crl, char *ssl_crlpath, bool ssl_verify_server_cert, int priority, int retry_count, bool preserve_logs, char *public_key_path, bool get_public_key, char *compression_algorithm, uint zstd_compression_level, char *tls_version, char *tls_ciphersuites, bool ignore_ws_mem_limit, bool allow_drop_write_set)
Initializes a channel connection in a similar way to a change replication source command.
Definition: replication_threads_api.cc:43
int queue_packet(const char *buf, ulong event_len)
Queues a event packet into the current active channel relay log.
Definition: replication_threads_api.cc:205
bool is_applier_thread_stopping()
Checks if the applier thread is stopping.
Definition: replication_threads_api.cc:201
Some integer typedefs for easier portability.
uint32 my_thread_id
Definition: my_thread_local.h:34
static char * password
Definition: mysql_secure_installation.cc:58
char * user
Definition: mysqladmin.cc:66
Definition: buf0block_hint.cc:30
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
required uint32 priority
Definition: replication_group_member_actions.proto:35
enum_channel_until_condition
The known until conditions that can be applied to channels.
Definition: rpl_channel_service_interface.h:134
@ CHANNEL_UNTIL_VIEW_ID
Definition: rpl_channel_service_interface.h:139
mysql::gtid::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of mysql::gtid::gno_t.
Definition: rpl_gtid.h:113
cs::index::rpl_sidno rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:109
static const Thread_to_stop threads_to_stop[]
Definition: srv0start.cc:1326
int ssl_verify_server_cert(SSL *ssl, const char *server_hostname)