24#ifndef RPL_SERVICE_INTERFACE_INCLUDE
25#define RPL_SERVICE_INTERFACE_INCLUDE
32#define RPL_CHANNEL_SERVICE_RECEIVER_CONNECTION_ERROR -1
33#define RPL_CHANNEL_SERVICE_DEFAULT_CHANNEL_CREATION_ERROR -2
34#define RPL_CHANNEL_SERVICE_SLAVE_SKIP_COUNTER_ACTIVE -3
35#define RPL_CHANNEL_SERVICE_CHANNEL_DOES_NOT_EXISTS_ERROR -4
38#define REPLICATION_THREAD_WAIT_TIMEOUT_ERROR -1
39#define REPLICATION_THREAD_WAIT_NO_INFO_ERROR -2
44#define RPL_SERVICE_SERVER_DEFAULT -1
193 int threads_to_start,
int wait_for_connection,
194 bool use_server_mta_configuration =
false,
195 bool channel_map_already_locked =
false);
229 std::string *error_message);
273 unsigned long **
thread_id,
bool need_lock =
true);
345 const char *gtid_set,
347 bool update_THD_status =
true);
377 bool worker =
false);
584 std::string &serialized_configuration);
602 const std::vector<std::string>
603 &exchanged_replication_failover_channels_serialized_configuration);
static my_thread_id thread_id
Definition: my_thr_init.cc:63
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 uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
required string type
Definition: replication_group_member_actions.proto:34
int channel_queue_packet(const char *channel, const char *buf, unsigned long len)
Queues a event packet into the current active channel.
Definition: rpl_channel_service_interface.cc:881
int channel_wait_until_transactions_applied(const char *channel, const char *gtid_set, double timeout, bool update_THD_status=true)
Checks if all the transactions in the given set were executed.
Definition: rpl_channel_service_interface.cc:940
enum_channel_until_condition
The known until conditions that can be applied to channels.
Definition: rpl_channel_service_interface.h:133
@ CHANNEL_UNTIL_APPLIER_AFTER_GAPS
Definition: rpl_channel_service_interface.h:137
@ CHANNEL_UNTIL_VIEW_ID
Definition: rpl_channel_service_interface.h:138
@ CHANNEL_UNTIL_APPLIER_AFTER_GTIDS
Definition: rpl_channel_service_interface.h:136
@ CHANNEL_UNTIL_APPLIER_BEFORE_GTIDS
Definition: rpl_channel_service_interface.h:135
@ CHANNEL_NO_UNTIL_CONDITION
Definition: rpl_channel_service_interface.h:134
int channel_start(const char *channel, Channel_connection_info *connection_info, int threads_to_start, int wait_for_connection, bool use_server_mta_configuration=false, bool channel_map_already_locked=false)
Start the Applier/Receiver threads according to the given options.
Definition: rpl_channel_service_interface.cc:418
bool is_any_slave_channel_running_with_failover_enabled(int thread_mask)
Checks if any slave threads of any channel configured with SOURCE_CONNECTION_AUTO_FAILOVER is running...
Definition: rpl_channel_service_interface.cc:1239
int channel_wait_until_apply_queue_applied(const char *channel, double timeout)
Checks if all the queued transactions were executed.
Definition: rpl_channel_service_interface.cc:901
bool is_any_slave_channel_running(int thread_mask)
Checks if any slave threads of any channel is running.
Definition: rpl_channel_service_interface.cc:1201
int channel_stop(const char *channel, int threads_to_stop, long timeout)
Stops the channel threads according to the given options.
Definition: rpl_channel_service_interface.cc:593
bool start_failover_channels()
Start channels which have SOURCE_CONNECTION_AUTO_FAILOVER=1.
Definition: rpl_channel_service_interface.cc:1337
void initialize_channel_connection_info(Channel_connection_info *channel_info)
Definition: rpl_channel_service_interface.cc:230
int binlog_dump_thread_kill()
Kills the Binlog Dump threads.
Definition: rpl_channel_service_interface.cc:668
int channel_delete_credentials(const char *channel_name)
Delete stored credentials from Slave_credentials.
Definition: rpl_channel_service_interface.cc:1331
int channel_create(const char *channel, Channel_creation_info *channel_information)
Initializes a channel connection in a similar way to a change master command.
Definition: rpl_channel_service_interface.cc:285
int channel_is_applier_thread_waiting(unsigned long thread_id, bool worker=false)
Checks if the applier thread, and its workers when parallel applier is enabled, has already consumed ...
Definition: rpl_channel_service_interface.cc:1016
enum_slave_channel_status
Return type for function has_any_slave_channel_open_temp_table_or_is_its_applier_running()
Definition: rpl_channel_service_interface.h:496
@ SLAVE_CHANNEL_HAS_OPEN_TEMPORARY_TABLE
Definition: rpl_channel_service_interface.h:505
@ SLAVE_CHANNEL_APPLIER_IS_RUNNING
Definition: rpl_channel_service_interface.h:503
@ SLAVE_CHANNEL_NO_APPLIER_RUNNING_AND_NO_OPEN_TEMPORARY_TABLE
Definition: rpl_channel_service_interface.h:501
bool get_replication_failover_channels_configuration(std::string &serialized_configuration)
Get replication failover channels configuration in a serialized protobuf_replication_asynchronous_con...
Definition: rpl_channel_service_interface.cc:1423
enum_channel_type
Types of channels.
Definition: rpl_channel_service_interface.h:51
@ GROUP_REPLICATION_CHANNEL
Definition: rpl_channel_service_interface.h:53
@ SLAVE_REPLICATION_CHANNEL
Definition: rpl_channel_service_interface.h:52
int channel_add_executed_gtids_to_received_gtids(const char *channel)
Adds server executed GTID set to channel received GTID set.
Definition: rpl_channel_service_interface.cc:860
void initialize_channel_creation_info(Channel_creation_info *channel_info)
Definition: rpl_channel_service_interface.cc:191
int channel_get_network_namespace(const char *channel, std::string &net_ns)
Method to get the network namespace configured for a channel.
Definition: rpl_channel_service_interface.cc:1114
void initialize_channel_ssl_info(Channel_ssl_info *channel_ssl_info)
Definition: rpl_channel_service_interface.cc:216
int channel_stop_all(int threads_to_stop, long timeout, std::string *error_message)
Stops all the running channel threads according to the given options.
Definition: rpl_channel_service_interface.cc:607
bool channel_has_same_uuid_as_group_name(const char *group_name)
Checks if any running channel uses the same UUID for assign_gtids_to_anonymous_transactions as the gr...
Definition: rpl_channel_service_interface.cc:1178
bool channel_change_source_connection_auto_failover(const char *channel, bool status)
Set SOURCE_CONNECTION_AUTO_FAILOVER on the given channel to the given status value.
Definition: rpl_channel_service_interface.cc:1368
int channel_purge_queue(const char *channel, bool reset_all)
Purges the channel logs.
Definition: rpl_channel_service_interface.cc:676
int channel_flush(const char *channel)
Flush the channel.
Definition: rpl_channel_service_interface.cc:1036
enum_slave_channel_status has_any_slave_channel_open_temp_table_or_is_its_applier_running()
Checks if any slave channel applier is running or any slave channel has open temporary table(s).
Definition: rpl_channel_service_interface.cc:1281
bool set_replication_failover_channels_configuration(const std::vector< std::string > &exchanged_replication_failover_channels_serialized_configuration)
Set replication failover channels configuration that was received from the group.
Definition: rpl_channel_service_interface.cc:1430
int channel_get_thread_id(const char *channel, enum_channel_thread_types thread_type, unsigned long **thread_id, bool need_lock=true)
Returns the id(s) of the channel threads: receiver or applier.
Definition: rpl_channel_service_interface.cc:732
bool channel_is_stopping(const char *channel, enum_channel_thread_types type)
Tells if the selected component of the channel is stopping or not.
Definition: rpl_channel_service_interface.cc:1135
int channel_get_retrieved_gtid_set(const char *channel, char **retrieved_set)
Returns the receiver thread retrieved GTID set in string format.
Definition: rpl_channel_service_interface.cc:1055
void reload_failover_channels_status()
Reload the status values on Rpl_acf_status_configuration singleton.
Definition: rpl_channel_service_interface.cc:1416
bool force_my_replication_failover_channels_configuration_on_all_members()
Collect and broadcast the replication failover channels configuration in a serialized protobuf_replic...
Definition: rpl_channel_service_interface.cc:1441
long long channel_get_last_delivered_gno(const char *channel, int sidno)
Returns last GNO from applier from a given UUID.
Definition: rpl_channel_service_interface.cc:825
bool is_partial_transaction_on_channel_relay_log(const char *channel)
Checks if the given channel's relaylog contains a partial transaction.
Definition: rpl_channel_service_interface.cc:1165
int channel_is_applier_waiting(const char *channel)
Checks if the applier, and its workers when parallel applier is enabled, has already consumed all rel...
Definition: rpl_channel_service_interface.cc:969
bool unset_source_connection_auto_failover_on_all_channels()
Unset SOURCE_CONNECTION_AUTO_FAILOVER=0 on all channels.
Definition: rpl_channel_service_interface.cc:1399
bool channel_is_active(const char *channel, enum_channel_thread_types type)
Tells if the selected component of the channel is active or not.
Definition: rpl_channel_service_interface.cc:701
int initialize_channel_service_interface()
Initializes channel structures if needed.
Definition: rpl_channel_service_interface.cc:91
int channel_get_credentials(const char *channel, std::string &user, std::string &password)
Method to get the credentials configured for a channel.
Definition: rpl_channel_service_interface.cc:1080
enum_multi_threaded_workers_type
Know parallelization options that can be applied to channel appliers.
Definition: rpl_channel_service_interface.h:59
@ CHANNEL_MTS_PARALLEL_TYPE_LOGICAL_CLOCK
Definition: rpl_channel_service_interface.h:61
@ CHANNEL_MTS_PARALLEL_TYPE_DB_NAME
Definition: rpl_channel_service_interface.h:60
enum_channel_thread_types
The known types of channel threads.
Definition: rpl_channel_service_interface.h:124
@ CHANNEL_NO_THD
Definition: rpl_channel_service_interface.h:125
@ CHANNEL_RECEIVER_THREAD
Definition: rpl_channel_service_interface.h:126
@ CHANNEL_APPLIER_THREAD
Definition: rpl_channel_service_interface.h:127
static const Thread_to_stop threads_to_stop[]
Definition: srv0start.cc:1342
Channel information to connect to a receiver.
Definition: rpl_channel_service_interface.h:144
int until_condition
Definition: rpl_channel_service_interface.h:145
char * view_id
Definition: rpl_channel_service_interface.h:147
char * gtid
Definition: rpl_channel_service_interface.h:146
Creation information for a channel.
Definition: rpl_channel_service_interface.h:88
char * compression_algorithm
Definition: rpl_channel_service_interface.h:108
char * hostname
Definition: rpl_channel_service_interface.h:90
int channel_mts_parallel_type
Definition: rpl_channel_service_interface.h:96
char * public_key_path
Definition: rpl_channel_service_interface.h:105
int sql_delay
Definition: rpl_channel_service_interface.h:101
bool m_allow_drop_write_set
Definition: rpl_channel_service_interface.h:113
int m_source_connection_auto_failover
Definition: rpl_channel_service_interface.h:111
unsigned int zstd_compression_level
Definition: rpl_channel_service_interface.h:109
int replicate_same_server_id
Definition: rpl_channel_service_interface.h:99
int connect_retry
Definition: rpl_channel_service_interface.h:102
int channel_mts_parallel_workers
Definition: rpl_channel_service_interface.h:97
enum_channel_type type
Definition: rpl_channel_service_interface.h:89
int port
Definition: rpl_channel_service_interface.h:91
char * user
Definition: rpl_channel_service_interface.h:92
int retry_count
Definition: rpl_channel_service_interface.h:103
bool preserve_relay_logs
Definition: rpl_channel_service_interface.h:104
int get_public_key
Definition: rpl_channel_service_interface.h:106
int channel_mta_checkpoint_group
Definition: rpl_channel_service_interface.h:98
bool m_ignore_write_set_memory_limit
Definition: rpl_channel_service_interface.h:112
char * password
Definition: rpl_channel_service_interface.h:93
int thd_tx_priority
Definition: rpl_channel_service_interface.h:100
Channel_ssl_info * ssl_info
Definition: rpl_channel_service_interface.h:94
int auto_position
Definition: rpl_channel_service_interface.h:95
SSL information to be used when creating a channel.
Definition: rpl_channel_service_interface.h:68
char * ssl_key
Definition: rpl_channel_service_interface.h:75
char * ssl_ca_file_name
Definition: rpl_channel_service_interface.h:70
char * ssl_crl_file_name
Definition: rpl_channel_service_interface.h:73
int use_ssl
Definition: rpl_channel_service_interface.h:69
int ssl_verify_server_cert
Definition: rpl_channel_service_interface.h:77
char * tls_ciphersuites
Definition: rpl_channel_service_interface.h:79
char * ssl_cipher
Definition: rpl_channel_service_interface.h:76
char * tls_version
Definition: rpl_channel_service_interface.h:78
char * ssl_cert_file_name
Definition: rpl_channel_service_interface.h:72
char * ssl_crl_directory
Definition: rpl_channel_service_interface.h:74
char * ssl_ca_directory
Definition: rpl_channel_service_interface.h:71