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);
119 std::string *view_id,
bool wait_for_connection);
131 int stop_threads(
bool stop_receiver,
bool stop_applier);
232 bool update_THD_status =
true);
258 const char *channel_name =
nullptr);
300 const char *channel_name =
nullptr);
357 const char *channel_name =
nullptr);
370 const char *channel_name =
nullptr);
383 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:384
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:365
bool is_partial_transaction_on_relay_log()
Checks if the channel's relay log contains partial transaction.
Definition: replication_threads_api.cc:361
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:331
ulong stop_wait_timeout
Definition: replication_threads_api.h:386
bool is_receiver_thread_running()
Checks if the receiver thread is running.
Definition: replication_threads_api.cc:185
static int delete_credential(const char *channel_name)
Interface to remove stored credentials from thread api.
Definition: replication_threads_api.cc:389
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:256
void set_stop_wait_timeout(ulong timeout)
Sets the threads shutdown timeout.
Definition: replication_threads_api.h:288
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:295
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:315
~Replication_thread_api()=default
int start_threads(bool start_receiver, bool start_applier, std::string *view_id, bool wait_for_connection)
Start the Applier/Receiver threads according to the given options.
Definition: replication_threads_api.cc:115
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:347
rpl_gno get_last_delivered_gno(rpl_sidno sidno)
Returns last GNO from the applier for a given UUID.
Definition: replication_threads_api.cc:245
bool is_applier_thread_running()
Checks if the applier thread is running.
Definition: replication_threads_api.cc:193
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:395
int purge_logs(bool reset_all)
Purges the relay logs.
Definition: replication_threads_api.cc:151
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:189
int stop_threads(bool stop_receiver, bool stop_applier)
Stops the channel threads according to the given options.
Definition: replication_threads_api.cc:162
int wait_for_gtid_execution(double timeout)
Checks if all the queued transactions were executed.
Definition: replication_threads_api.cc:209
int get_applier_thread_ids(unsigned long **thread_ids)
Method to get applier ids from the configured channel.
Definition: replication_threads_api.cc:250
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:205
const char * interface_channel
Definition: replication_threads_api.h:387
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 master 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:201
bool is_applier_thread_stopping()
Checks if the applier thread is stopping.
Definition: replication_threads_api.cc:197
Some integer typedefs for easier portability.
uint32 my_thread_id
Definition: my_thread_local.h:34
static char * password
Definition: mysql_secure_installation.cc:56
char * user
Definition: mysqladmin.cc:60
Definition: buf0block_hint.cc:30
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:496
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
required uint32 priority
Definition: replication_group_member_actions.proto:35
int rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:96
binary_log::gtids::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of binary_log::gtids::gno_t.
Definition: rpl_gtid.h:103
static const Thread_to_stop threads_to_stop[]
Definition: srv0start.cc:1342
unsigned int uint
Definition: uca9-dump.cc:75
int ssl_verify_server_cert(SSL *ssl, const char *server_hostname)