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
195 int threads_to_start,
int wait_for_connection,
196 bool use_server_mta_configuration =
false,
197 bool channel_map_already_locked =
false);
231 std::string *error_message);
275 unsigned long **
thread_id,
bool need_lock =
true);
347 const char *gtid_set,
349 bool update_THD_status =
true);
379 bool worker =
false);
586 std::string &serialized_configuration);
604 const std::vector<std::string>
605 &exchanged_replication_failover_channels_serialized_configuration);
633 std::string >id_set_to_apply);
static my_thread_id thread_id
Definition: my_thr_init.cc:63
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 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:878
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:937
enum_channel_until_condition
The known until conditions that can be applied to channels.
Definition: rpl_channel_service_interface.h:134
@ CHANNEL_UNTIL_APPLIER_AFTER_GAPS
Definition: rpl_channel_service_interface.h:138
@ CHANNEL_UNTIL_VIEW_ID
Definition: rpl_channel_service_interface.h:139
@ CHANNEL_UNTIL_APPLIER_AFTER_GTIDS
Definition: rpl_channel_service_interface.h:137
@ CHANNEL_UNTIL_APPLIER_BEFORE_GTIDS
Definition: rpl_channel_service_interface.h:136
@ CHANNEL_NO_UNTIL_CONDITION
Definition: rpl_channel_service_interface.h:135
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:415
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:1283
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:898
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:1245
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:590
bool start_failover_channels()
Start channels which have SOURCE_CONNECTION_AUTO_FAILOVER=1.
Definition: rpl_channel_service_interface.cc:1381
void initialize_channel_connection_info(Channel_connection_info *channel_info)
Definition: rpl_channel_service_interface.cc:224
int binlog_dump_thread_kill()
Kills the Binlog Dump threads.
Definition: rpl_channel_service_interface.cc:665
int channel_delete_credentials(const char *channel_name)
Delete stored credentials from Slave_credentials.
Definition: rpl_channel_service_interface.cc:1375
int channel_get_gtid_set_to_apply(const char *channel, std::string >id_set_to_apply)
Calculate transactions that are waiting to be applied on channel.
Definition: rpl_channel_service_interface.cc:1132
int channel_create(const char *channel, Channel_creation_info *channel_information)
Initializes a channel connection in a similar way to a change replication source command.
Definition: rpl_channel_service_interface.cc:279
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:1013
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:498
@ SLAVE_CHANNEL_HAS_OPEN_TEMPORARY_TABLE
Definition: rpl_channel_service_interface.h:507
@ SLAVE_CHANNEL_APPLIER_IS_RUNNING
Definition: rpl_channel_service_interface.h:505
@ SLAVE_CHANNEL_NO_APPLIER_RUNNING_AND_NO_OPEN_TEMPORARY_TABLE
Definition: rpl_channel_service_interface.h:503
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:1467
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:857
void initialize_channel_creation_info(Channel_creation_info *channel_info)
Definition: rpl_channel_service_interface.cc:185
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:1111
void initialize_channel_ssl_info(Channel_ssl_info *channel_ssl_info)
Definition: rpl_channel_service_interface.cc:210
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:604
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:1222
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:1412
int channel_purge_queue(const char *channel, bool reset_all)
Purges the channel logs.
Definition: rpl_channel_service_interface.cc:673
int channel_flush(const char *channel)
Flush the channel.
Definition: rpl_channel_service_interface.cc:1033
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:1325
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:1474
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:729
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:1179
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:1052
void reload_failover_channels_status()
Reload the status values on Rpl_acf_status_configuration singleton.
Definition: rpl_channel_service_interface.cc:1460
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:1485
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:822
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:1209
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:966
bool unset_source_connection_auto_failover_on_all_channels()
Unset SOURCE_CONNECTION_AUTO_FAILOVER=0 on all channels.
Definition: rpl_channel_service_interface.cc:1443
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:698
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:1077
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:125
@ CHANNEL_NO_THD
Definition: rpl_channel_service_interface.h:126
@ CHANNEL_RECEIVER_THREAD
Definition: rpl_channel_service_interface.h:127
@ CHANNEL_APPLIER_THREAD
Definition: rpl_channel_service_interface.h:128
static const Thread_to_stop threads_to_stop[]
Definition: srv0start.cc:1344
Channel information to connect to a receiver.
Definition: rpl_channel_service_interface.h:145
int until_condition
Definition: rpl_channel_service_interface.h:146
char * view_id
Definition: rpl_channel_service_interface.h:148
char * gtid
Definition: rpl_channel_service_interface.h:147
Creation information for a channel.
Definition: rpl_channel_service_interface.h:89
char * compression_algorithm
Definition: rpl_channel_service_interface.h:109
char * hostname
Definition: rpl_channel_service_interface.h:91
int channel_mts_parallel_type
Definition: rpl_channel_service_interface.h:97
char * public_key_path
Definition: rpl_channel_service_interface.h:106
int sql_delay
Definition: rpl_channel_service_interface.h:102
bool m_allow_drop_write_set
Definition: rpl_channel_service_interface.h:114
int m_source_connection_auto_failover
Definition: rpl_channel_service_interface.h:112
unsigned int zstd_compression_level
Definition: rpl_channel_service_interface.h:110
int replicate_same_server_id
Definition: rpl_channel_service_interface.h:100
int connect_retry
Definition: rpl_channel_service_interface.h:103
int channel_mts_parallel_workers
Definition: rpl_channel_service_interface.h:98
enum_channel_type type
Definition: rpl_channel_service_interface.h:90
int port
Definition: rpl_channel_service_interface.h:92
char * user
Definition: rpl_channel_service_interface.h:93
int retry_count
Definition: rpl_channel_service_interface.h:104
bool preserve_relay_logs
Definition: rpl_channel_service_interface.h:105
int get_public_key
Definition: rpl_channel_service_interface.h:107
int channel_mta_checkpoint_group
Definition: rpl_channel_service_interface.h:99
bool m_ignore_write_set_memory_limit
Definition: rpl_channel_service_interface.h:113
char * password
Definition: rpl_channel_service_interface.h:94
int thd_tx_priority
Definition: rpl_channel_service_interface.h:101
Channel_ssl_info * ssl_info
Definition: rpl_channel_service_interface.h:95
int auto_position
Definition: rpl_channel_service_interface.h:96
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