24#ifndef RECOVERY_STATE_TRANSFER_INCLUDE
25#define RECOVERY_STATE_TRANSFER_INCLUDE
114 const char *ssl_capath,
const char *ssl_cert,
115 const char *ssl_cipher,
const char *ssl_key,
116 const char *ssl_crl,
const char *ssl_crlpath,
118 char *tls_ciphersuites) {
182 if (
nullptr == tls_ciphersuites) {
187 strlen(tls_ciphersuites) + 1);
204 std::string *ssl_key) {
221 if (public_key_path !=
nullptr) {
223 strlen(public_key_path) + 1);
339 std::string &local_gtid_executed_string);
390 bool purge_logs =
true);
A class to register observers for channel state events.
Definition: channel_observation_manager.h:131
A interface class to code channel state response methods.
Definition: channel_observation_manager.h:38
Definition: member_info.h:82
Definition: stage_monitor_handler.h:30
Definition: recovery_state_transfer.h:45
char recovery_tls_ciphersuites[FN_REFLEN]
Definition: recovery_state_transfer.h:492
bool recovery_tls_ciphersuites_null
Permitted TLS 1.3 ciphersuites.
Definition: recovery_state_transfer.h:491
void set_recovery_donor_reconnect_interval(ulong reconnect_interval)
Sets the sleep time between connection attempts to all possible donors.
Definition: recovery_state_transfer.h:94
bool verify_after_gtids_applied()
Verifies if after_gtids sent by sender is successfully applied when recovery is using CHANNEL_UNTIL_A...
bool on_failover
Definition: recovery_state_transfer.h:451
void set_recovery_donor_retry_count(ulong retry_count)
Sets the number of times recovery tries to connect to a given donor.
Definition: recovery_state_transfer.h:89
bool recovery_get_public_key
Get public key.
Definition: recovery_state_transfer.h:469
int update_recovery_process(bool did_members_left)
This method decides what action to take when a member exits the group.
Definition: recovery_state_transfer.cc:262
void set_recovery_ssl_capath(const char *ssl_capath)
Set a folder with SSL trusted CA files.
Definition: recovery_state_transfer.h:141
~Recovery_state_transfer()
Definition: recovery_state_transfer.cc:89
Group_member_info_list * group_members
Definition: recovery_state_transfer.h:437
Group_member_info * selected_donor
Definition: recovery_state_transfer.h:433
mysql_cond_t recovery_condition
Definition: recovery_state_transfer.h:497
uint recovery_zstd_compression_level
Definition: recovery_state_transfer.h:507
State_transfer_status state_transfer(Plugin_stage_monitor_handler &stage_handler)
Execute state transfer.
Definition: recovery_state_transfer.cc:820
bool donor_channel_thread_error
Definition: recovery_state_transfer.h:453
long donor_reconnect_interval
Definition: recovery_state_transfer.h:503
void set_recovery_ssl_cipher(const char *ssl_cipher)
Set a SSL ciphers to be used.
Definition: recovery_state_transfer.h:151
Channel_observation_manager * channel_observation_manager
Definition: recovery_state_transfer.h:461
bool initialize_connection_parameters()
Initializes the connection parameters for the donor connection.
int establish_donor_connection()
Establish a master/slave connection to the selected donor.
Definition: recovery_state_transfer.cc:428
bool connected_to_donor
Definition: recovery_state_transfer.h:449
long max_connection_attempts_to_donors
Definition: recovery_state_transfer.h:501
Replication_thread_api donor_connection_interface
Interface class to interact with the donor connection threads.
Definition: recovery_state_transfer.h:458
State_transfer_status terminate_recovery_slave_threads(bool purge_logs=true)
Terminates the connection to the donor.
Definition: recovery_state_transfer.cc:772
char recovery_public_key_path[FN_REFLEN]
Public key information.
Definition: recovery_state_transfer.h:487
void set_recovery_tls_version(const char *tls_version)
Set a TLS versions to be used.
Definition: recovery_state_transfer.h:176
void set_recovery_ssl_ca(const char *ssl_ca)
Set a SSL trusted certificate authorities file.
Definition: recovery_state_transfer.h:136
void set_recovery_use_ssl(char use_ssl)
Set the option that forces the use of SSL on recovery connections.
Definition: recovery_state_transfer.h:133
int start_recovery_donor_threads()
Starts the recovery slave threads to receive data from the donor.
Definition: recovery_state_transfer.cc:618
char recovery_ssl_capath[FN_REFLEN]
The configured directory that contains trusted SSL CA files.
Definition: recovery_state_transfer.h:473
long donor_connection_retry_count
Definition: recovery_state_transfer.h:442
Recovery_state_transfer(char *recovery_channel_name, const std::string &member_uuid, Channel_observation_manager *channel_obsr_mngr)
Recovery state transfer constructor.
Definition: recovery_state_transfer.cc:44
void set_recovery_ssl_options(bool use_ssl, const char *ssl_ca, const char *ssl_capath, const char *ssl_cert, const char *ssl_cipher, const char *ssl_key, const char *ssl_crl, const char *ssl_crlpath, bool ssl_verify_server_cert, char *tls_version, char *tls_ciphersuites)
Sets all the SSL option to use on recovery.
Definition: recovery_state_transfer.h:113
char recovery_ssl_crl[FN_REFLEN]
The configured SSL file containing certificate revocation lists.
Definition: recovery_state_transfer.h:481
void donor_failover()
Method that sets the failover status to true and awakes recovery.
Definition: recovery_state_transfer.cc:343
int initialize_donor_connection(std::string hostname, uint port)
Initializes the structures for the donor connection threads.
Definition: recovery_state_transfer.cc:541
Channel_state_observer * recovery_channel_observer
Definition: recovery_state_transfer.h:464
void set_recovery_ssl_cert(const char *ssl_cert)
Set a SSL certificate for connection.
Definition: recovery_state_transfer.h:146
char recovery_ssl_cipher[FN_REFLEN]
The configured SSL list of permissible ciphers to use for encryption.
Definition: recovery_state_transfer.h:477
void set_recovery_tls_ciphersuites(const char *tls_ciphersuites)
Set a TLS ciphersuites to be used.
Definition: recovery_state_transfer.h:181
char recovery_ssl_crlpath[FN_REFLEN]
The configured directory that contains certificate revocation list files.
Definition: recovery_state_transfer.h:483
int check_recovery_thread_status()
Checks to see if the recovery IO/SQL thread is still running, probably caused by an timeout on shutdo...
Definition: recovery_state_transfer.cc:353
void inform_of_receiver_stop(my_thread_id thread_id)
Method that informs recovery that the donor channel receiver was stopped.
Definition: recovery_state_transfer.cc:190
bool is_own_event_channel(my_thread_id id)
Checks if the given id matches the recovery applier thread.
Definition: recovery_state_transfer.cc:364
bool verify_member_has_after_gtids_present(std::string &local_gtid_executed_string)
Verify member has after_gtids received from replication donor already present in member's gtid_execut...
Definition: recovery_state_transfer.cc:583
std::string m_recovery_channel_name
The recovery channel name.
Definition: recovery_state_transfer.h:415
void set_recovery_zstd_compression_level(uint level)
Set compression level.
Definition: recovery_state_transfer.h:236
std::string m_after_gtids
Definition: recovery_state_transfer.h:424
void end_state_transfer()
Signals that the data was received so the process can end.
Definition: recovery_state_transfer.cc:334
char recovery_ssl_key[FN_REFLEN]
The configured SSL key file to use for establishing a secure connection.
Definition: recovery_state_transfer.h:479
void initialize(const std::string &view_id, bool is_vcle_enabled)
Initialize the state transfer class and reset the class flags.
Definition: recovery_state_transfer.cc:106
void build_donor_list(std::string *selected_donor)
Based on the group list, build a random order list with all suitable donors.
Definition: recovery_state_transfer.cc:369
std::string member_uuid
Definition: recovery_state_transfer.h:418
char recovery_tls_version[FN_REFLEN]
Permitted TLS versions.
Definition: recovery_state_transfer.h:489
bool recovery_use_ssl
If the use of SSL is obligatory on recovery connections.
Definition: recovery_state_transfer.h:467
char recovery_ssl_ca[FN_REFLEN]
The configured SSL trusted certificate authorities file.
Definition: recovery_state_transfer.h:471
Group_member_info_list suitable_donors
Definition: recovery_state_transfer.h:439
void update_group_membership(bool update_donor)
Removes the old list of group members and enquires about the current members.
Definition: recovery_state_transfer.cc:224
bool recovery_aborted
Definition: recovery_state_transfer.h:445
void set_recovery_ssl_key(const char *ssl_key)
Set a SSL key for connections.
Definition: recovery_state_transfer.h:156
void set_recovery_ssl_crl(const char *ssl_crl)
Set a SSL revocation list file.
Definition: recovery_state_transfer.h:161
void set_recovery_get_public_key(bool set)
Get preference to get public key.
Definition: recovery_state_transfer.h:228
void initialize_group_info()
This method initializes the group membership info.
Definition: recovery_state_transfer.cc:212
bool get_recovery_use_ssl()
Definition: recovery_state_transfer.h:194
bool recovery_ssl_verify_server_cert
If the server's Common Name value checks against donor sent certificate.
Definition: recovery_state_transfer.h:485
std::string view_id
Definition: recovery_state_transfer.h:421
std::string selected_donor_hostname
Definition: recovery_state_transfer.h:435
void set_stop_wait_timeout(ulong timeout)
Sets the recovery shutdown timeout.
Definition: recovery_state_transfer.h:215
char recovery_compression_algorithm[COMPRESSION_ALGORITHM_NAME_LENGTH_MAX]
Definition: recovery_state_transfer.h:505
void set_recovery_public_key_path(const char *public_key_path)
Set a public key file.
Definition: recovery_state_transfer.h:220
mysql_mutex_t recovery_lock
Definition: recovery_state_transfer.h:495
bool donor_transfer_finished
Definition: recovery_state_transfer.h:447
void inform_of_applier_stop(my_thread_id thread_id, bool aborted)
Method that informs recovery that the donor channel applier was stopped.
Definition: recovery_state_transfer.cc:133
void set_recovery_ssl_crlpath(const char *ssl_crlpath)
Set a folder with SSL revocation list files.
Definition: recovery_state_transfer.h:166
void get_recovery_base_ssl_options(std::string *ssl_ca, std::string *ssl_cert, std::string *ssl_key)
Get SSL options configured for recovery.
Definition: recovery_state_transfer.h:203
void abort_state_transfer()
Abort the state transfer.
Definition: recovery_state_transfer.cc:252
void set_recovery_ssl_verify_server_cert(char ssl_verify_server_cert)
Set if recovery shall compare the used hostname against the certificate.
Definition: recovery_state_transfer.h:171
char recovery_ssl_cert[FN_REFLEN]
The configured SSL certificate file to use for a secure connection.
Definition: recovery_state_transfer.h:475
void set_until_condition_after_gtids(const std::string &after_gtids)
Set the gtids to use for the recovery until condition.
Definition: recovery_state_transfer.cc:128
void set_recovery_compression_algorithm(const char *name)
Set compression algorithm.
Definition: recovery_state_transfer.h:231
int purge_recovery_slave_threads_repos()
Purges relay logs and the master info object.
Definition: recovery_state_transfer.cc:794
mysql_mutex_t donor_selection_lock
Definition: recovery_state_transfer.h:498
enum_channel_until_condition m_until_condition
Definition: recovery_state_transfer.h:430
Definition: replication_threads_api.h:37
void set_stop_wait_timeout(ulong timeout)
Sets the threads shutdown timeout.
Definition: replication_threads_api.h:292
#define COMPRESSION_ALGORITHM_NAME_LENGTH_MAX
Definition: compression.h:40
std::vector< Group_member_info *, Malloc_allocator< Group_member_info * > > Group_member_info_list
Definition: member_info.h:771
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:83
static my_thread_id thread_id
Definition: my_thr_init.cc:63
uint32 my_thread_id
Definition: my_thread_local.h:34
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2882
static char recovery_channel_name[]
The relay log name.
Definition: recovery.cc:53
enum st_state_transfer_status State_transfer_status
st_state_transfer_status
Definition: recovery_state_transfer.h:38
@ STATE_TRANSFER_OK
Definition: recovery_state_transfer.h:39
@ STATE_TRANSFER_STOP
Definition: recovery_state_transfer.h:40
@ STATE_TRANSFER_PURGE
Definition: recovery_state_transfer.h:41
@ STATE_TRANSFER_NO_CONNECTION
Definition: recovery_state_transfer.h:42
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
enum_channel_until_condition
The known until conditions that can be applied to channels.
Definition: rpl_channel_service_interface.h:134
case opt name
Definition: sslopt-case.h:29
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
int ssl_verify_server_cert(SSL *ssl, const char *server_hostname)