24#ifndef RECOVERY_INCLUDE
25#define RECOVERY_INCLUDE
169 const char *ssl_capath,
const char *ssl_cert,
170 const char *ssl_cipher,
const char *ssl_key,
171 const char *ssl_crl,
const char *ssl_crlpath,
173 char *tls_ciphersuites) {
176 if (ssl_capath !=
nullptr)
178 if (ssl_cert !=
nullptr)
180 if (ssl_cipher !=
nullptr)
182 if (ssl_key !=
nullptr)
184 if (ssl_crl !=
nullptr)
186 if (ssl_crlpath !=
nullptr)
190 if (tls_version !=
nullptr)
266 std::string *ssl_key) {
281 if (public_key_path !=
nullptr)
Definition: applier.h:276
A class to register observers for channel state events.
Definition: channel_observation_manager.h:131
Definition: recovery.h:39
void set_recovery_ssl_crlpath(const char *ssl_crlpath)
Set a folder with SSL revocation list files.
Definition: recovery.h:231
void set_recovery_get_public_key(bool set)
Get public key automatically.
Definition: recovery.h:286
mysql_cond_t run_cond
Definition: recovery.h:447
mysql_mutex_t m_recovery_metadata_receive_lock
Definition: recovery.h:463
mysql_cond_t m_recovery_metadata_receive_waiting_condition
Definition: recovery.h:466
enum_channel_until_condition m_until_condition
Definition: recovery.h:437
enum_recovery_metadata_error m_recovery_metadata_error_status
Recovery metadata receive error status.
Definition: recovery.h:459
void set_recovery_thread_context()
Sets the thread context.
Definition: recovery.cc:649
void set_recovery_ssl_cipher(const char *ssl_cipher)
Set a SSL ciphers to be used.
Definition: recovery.h:216
int start_recovery(const std::string &group_name, const std::string &view_id)
Starts the recovery process, initializing the recovery thread.
Definition: recovery.cc:87
std::string group_name
Definition: recovery.h:423
thread_state recovery_thd_state
Definition: recovery.h:429
void notify_group_recovery_end()
Sends a message throughout the group stating the member as online.
Definition: recovery.cc:759
bool m_recovery_metadata_received
Definition: recovery.h:453
enum_recovery_metadata_error wait_for_recovery_metadata_gtid_executed()
Starts a wait process until the recovery metadata is successfully send by the donor.
Definition: recovery.cc:786
bool is_own_event_channel(my_thread_id id)
Checks if the given id matches the recovery applier thread.
Definition: recovery.cc:771
void set_recovery_donor_retry_count(ulong retry_count)
Sets the number of times recovery tries to connect to a given donor.
Definition: recovery.h:143
int set_retrieved_cert_info(void *info)
Set retrieved certification info from a group replication channel extracted from a given View_change ...
Definition: recovery.cc:624
Recovery_metadata_message * m_recovery_metadata_message
Recovery metadata received on group members.
Definition: recovery.h:376
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.h:236
bool m_recovery_metadata_received_error
Error while fetching Recovery metadata.
Definition: recovery.h:456
void set_recovery_ssl_capath(const char *ssl_capath)
Set a folder with SSL trusted CA files.
Definition: recovery.h:206
void clean_recovery_thread_context()
Cleans the recovery thread related options/structures.
Definition: recovery.cc:663
unsigned int m_max_metadata_wait_time
Definition: recovery.h:443
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.h:168
void set_stop_wait_timeout(ulong timeout)
Sets the recovery shutdown timeout.
Definition: recovery.h:275
void set_recovery_public_key_path(const char *public_key_path)
Set a public key file.
Definition: recovery.h:280
void suspend_recovery_metadata()
Suspend recovery thd, so that member can wait to receive the recovery metadata.
Definition: recovery.cc:832
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.cc:776
void set_recovery_ssl_key(const char *ssl_key)
Set a SSL key for connections.
Definition: recovery.h:221
void set_recovery_tls_ciphersuites(const char *tls_ciphersuites)
Set TLS ciphersuites to be used.
Definition: recovery.h:247
enum_recovery_metadata_error
Definition: recovery.h:42
@ RECOVERY_METADATA_RECEIVED_TIMEOUT_ERROR
@ RECOVERY_METADATA_RECOVERY_ABORTED_ERROR
@ RECOVERY_METADATA_RECEIVED_ERROR
@ RECOVERY_METADATA_RECEIVED_NO_ERROR
void set_applier_module(Applier_module_interface *applier)
Definition: recovery.h:66
void set_recovery_use_ssl(char use_ssl)
Set the option that forces the use of SSL on recovery connections.
Definition: recovery.h:196
void set_recovery_donor_reconnect_interval(ulong reconnect_interval)
Sets the sleep time between connection attempts to all possible donors.
Definition: recovery.h:148
Applier_module_interface * applier_module
Definition: recovery.h:420
void delete_recovery_metadata_message()
Delete recovery metadata object.
Definition: recovery.cc:850
void leave_group_on_recovery_failure()
Handles code for removing the member in case of a failure during recovery.
Definition: recovery.cc:185
my_thread_handle recovery_pthd
Definition: recovery.h:416
bool set_recovery_metadata_message(Recovery_metadata_message *recovery_metadata_message)
Set the recovery metadata message.
Definition: recovery.cc:839
~Recovery_module()
Definition: recovery.cc:79
void set_recovery_ssl_cert(const char *ssl_cert)
Set a SSL certificate for connection.
Definition: recovery.h:211
Recovery_state_transfer recovery_state_transfer
Definition: recovery.h:426
THD * recovery_thd
Definition: recovery.h:417
int stop_recovery(bool wait_for_termination=true)
Stops the recovery process, shutting down the recovery thread.
Definition: recovery.cc:129
bool get_recovery_use_ssl()
Definition: recovery.h:254
void set_recovery_tls_version(const char *tls_version)
Set TLS version to be used.
Definition: recovery.h:242
Recovery_module(Applier_module_interface *applier, Channel_observation_manager *channel_obsr_mngr)
Recovery_module constructor.
Definition: recovery.cc:61
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.h:265
void set_recovery_compression_algorithm(const char *name)
Set compression algorithm.
Definition: recovery.h:291
bool m_is_vcle_enable
Flag to determine if recovery should use VCLE.
Definition: recovery.h:373
int wait_for_applier_module_recovery()
Starts a wait process until the applier fulfills the necessary condition for the member to be acknowl...
Definition: recovery.cc:668
int update_recovery_process(bool did_members_left, bool is_leaving)
This method decides what action to take when a member exits the group and executes it.
Definition: recovery.cc:600
mysql_mutex_t run_lock
Definition: recovery.h:446
State_transfer_status m_state_transfer_return
Definition: recovery.h:450
void set_recovery_zstd_compression_level(uint level)
Set compression level.
Definition: recovery.h:296
void set_recovery_ssl_ca(const char *ssl_ca)
Set a SSL trusted certificate authorities file.
Definition: recovery.h:201
bool is_vcle_enable()
Return the flag which determine if VCLE is enabled.
Definition: recovery.cc:857
void set_recovery_ssl_crl(const char *ssl_crl)
Set a SSL revocation list file.
Definition: recovery.h:226
int recovery_thread_handle()
Recovery thread main execution method.
Definition: recovery.cc:258
void awake_recovery_metadata_suspension(bool error=false)
Awakes recovery thd, waiting for the donor to send recovery metadata.
Definition: recovery.cc:824
bool recovery_aborted
Definition: recovery.h:431
void set_vcle_enabled(bool is_vcle_enabled)
Set the View ID on which the joiner joined.
Definition: recovery.cc:859
Definition: recovery_state_transfer.h:45
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
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
void set_recovery_ssl_capath(const char *ssl_capath)
Set a folder with SSL trusted CA files.
Definition: recovery_state_transfer.h:141
void set_recovery_ssl_cipher(const char *ssl_cipher)
Set a SSL ciphers to be used.
Definition: recovery_state_transfer.h:151
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
void set_recovery_ssl_cert(const char *ssl_cert)
Set a SSL certificate for connection.
Definition: recovery_state_transfer.h:146
void set_recovery_tls_ciphersuites(const char *tls_ciphersuites)
Set a TLS ciphersuites to be used.
Definition: recovery_state_transfer.h:181
void set_recovery_zstd_compression_level(uint level)
Set compression level.
Definition: recovery_state_transfer.h:236
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
bool get_recovery_use_ssl()
Definition: recovery_state_transfer.h:194
void set_stop_wait_timeout(ulong timeout)
Sets the recovery shutdown timeout.
Definition: recovery_state_transfer.h:215
void set_recovery_public_key_path(const char *public_key_path)
Set a public key file.
Definition: recovery_state_transfer.h:220
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 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
void set_recovery_compression_algorithm(const char *name)
Set compression algorithm.
Definition: recovery_state_transfer.h:231
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
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:2884
enum st_state_transfer_status State_transfer_status
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
case opt name
Definition: sslopt-case.h:29
Definition: my_thread_bits.h:58
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: plugin_utils.h:48
int ssl_verify_server_cert(SSL *ssl, const char *server_hostname)