MySQL 8.0.39
Source Code Documentation
|
#include <recovery.h>
Public Member Functions | |
Recovery_module (Applier_module_interface *applier, Channel_observation_manager *channel_obsr_mngr) | |
Recovery_module constructor. More... | |
~Recovery_module () | |
void | set_applier_module (Applier_module_interface *applier) |
int | start_recovery (const std::string &group_name, const std::string &rec_view_id) |
Starts the recovery process, initializing the recovery thread. More... | |
int | recovery_thread_handle () |
Recovery thread main execution method. More... | |
int | set_retrieved_cert_info (void *info) |
Set retrieved certification info from a group replication channel extracted from a given View_change event. More... | |
int | stop_recovery (bool wait_for_termination=true) |
Stops the recovery process, shutting down the recovery thread. More... | |
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. More... | |
void | set_recovery_donor_retry_count (ulong retry_count) |
Sets the number of times recovery tries to connect to a given donor. More... | |
void | set_recovery_donor_reconnect_interval (ulong reconnect_interval) |
Sets the sleep time between connection attempts to all possible donors. More... | |
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. More... | |
void | set_recovery_use_ssl (char use_ssl) |
Set the option that forces the use of SSL on recovery connections. More... | |
void | set_recovery_ssl_ca (const char *ssl_ca) |
Set a SSL trusted certificate authorities file. More... | |
void | set_recovery_ssl_capath (const char *ssl_capath) |
Set a folder with SSL trusted CA files. More... | |
void | set_recovery_ssl_cert (const char *ssl_cert) |
Set a SSL certificate for connection. More... | |
void | set_recovery_ssl_cipher (const char *ssl_cipher) |
Set a SSL ciphers to be used. More... | |
void | set_recovery_ssl_key (const char *ssl_key) |
Set a SSL key for connections. More... | |
void | set_recovery_ssl_crl (const char *ssl_crl) |
Set a SSL revocation list file. More... | |
void | set_recovery_ssl_crlpath (const char *ssl_crlpath) |
Set a folder with SSL revocation list files. More... | |
void | set_recovery_ssl_verify_server_cert (char ssl_verify_server_cert) |
Set if recovery shall compare the used hostname against the certificate. More... | |
void | set_recovery_tls_version (const char *tls_version) |
Set TLS version to be used. More... | |
void | set_recovery_tls_ciphersuites (const char *tls_ciphersuites) |
Set TLS ciphersuites to be used. More... | |
bool | get_recovery_use_ssl () |
void | get_recovery_base_ssl_options (std::string *ssl_ca, std::string *ssl_cert, std::string *ssl_key) |
Get SSL options configured for recovery. More... | |
void | set_stop_wait_timeout (ulong timeout) |
Sets the recovery shutdown timeout. More... | |
void | set_recovery_completion_policy (enum_recovery_completion_policies completion_policy) |
Sets recovery threshold policy on what to wait when handling transactions. More... | |
void | set_recovery_public_key_path (const char *public_key_path) |
Set a public key file. More... | |
void | set_recovery_get_public_key (bool set) |
Get public key automatically. More... | |
void | set_recovery_compression_algorithm (const char *name) |
Set compression algorithm. More... | |
void | set_recovery_zstd_compression_level (uint level) |
Set compression level. More... | |
bool | is_own_event_channel (my_thread_id id) |
Checks if the given id matches the recovery applier thread. More... | |
int | check_recovery_thread_status () |
Checks to see if the recovery IO/SQL thread is still running, probably caused by an timeout on shutdown. More... | |
Private Member Functions | |
void | set_recovery_thread_context () |
Sets the thread context. More... | |
void | leave_group_on_recovery_failure () |
Handles code for removing the member in case of a failure during recovery. More... | |
void | clean_recovery_thread_context () |
Cleans the recovery thread related options/structures. More... | |
int | wait_for_applier_module_recovery () |
Starts a wait process until the applier fulfills the necessary condition for the member to be acknowledge as being online. More... | |
void | notify_group_recovery_end () |
Sends a message throughout the group stating the member as online. More... | |
Recovery_module::Recovery_module | ( | Applier_module_interface * | applier, |
Channel_observation_manager * | channel_obsr_mngr | ||
) |
Recovery_module constructor.
applier | reference to the applier |
channel_obsr_mngr | reference to the channel hooks observation manager |
Recovery_module::~Recovery_module | ( | ) |
int Recovery_module::check_recovery_thread_status | ( | ) |
Checks to see if the recovery IO/SQL thread is still running, probably caused by an timeout on shutdown.
If the threads are still running, we try to stop them again. If not possible, an error is reported.
0 | All is stopped. |
!=0 | Threads are still running |
|
private |
Cleans the recovery thread related options/structures.
|
inline |
Get SSL options configured for recovery.
[out] | ssl_ca | the ssl ca |
[out] | ssl_cert | the ssl cert |
[out] | ssl_key | the ssl key |
|
inline |
bool Recovery_module::is_own_event_channel | ( | my_thread_id | id | ) |
Checks if the given id matches the recovery applier thread.
id | the thread id |
true | the id matches a SQL or worker thread |
false | the id doesn't match any thread |
|
private |
Handles code for removing the member in case of a failure during recovery.
|
private |
Sends a message throughout the group stating the member as online.
int Recovery_module::recovery_thread_handle | ( | ) |
Recovery thread main execution method.
Here, the donor is selected, the connection to the donor is established, and several safe keeping assurances are guaranteed, such as the applier being suspended.
If recovery fails or is aborted, it never makes sense to awake the applier, as that would lead to the certification and execution of transactions on the wrong context.
|
inline |
|
inline |
Sets recovery threshold policy on what to wait when handling transactions.
completion_policy | if recovery shall wait for execution or certification |
|
inline |
Set compression algorithm.
|
inline |
Sets the sleep time between connection attempts to all possible donors.
|
inline |
Sets the number of times recovery tries to connect to a given donor.
|
inline |
Get public key automatically.
|
inline |
Set a public key file.
|
inline |
Set a SSL trusted certificate authorities file.
|
inline |
Set a folder with SSL trusted CA files.
|
inline |
Set a SSL certificate for connection.
|
inline |
Set a SSL ciphers to be used.
|
inline |
Set a SSL revocation list file.
|
inline |
Set a folder with SSL revocation list files.
|
inline |
Set a SSL key for connections.
|
inline |
Sets all the SSL option to use on recovery.
use_ssl | force the use of SSL on recovery connections |
ssl_ca | SSL trusted certificate authorities file |
ssl_capath | a directory with trusted CA files |
ssl_cert | the certificate file for secure connections |
ssl_cipher | the list of ciphers to use |
ssl_key | the SSL key file |
ssl_crl | SSL revocation list file |
ssl_crlpath | path with revocation list files |
ssl_verify_server_cert | verify the hostname against the certificate |
tls_version | the list of TLS versions to use |
tls_ciphersuites | the list of TLS ciphersuites to use |
|
inline |
Set if recovery shall compare the used hostname against the certificate.
|
private |
Sets the thread context.
|
inline |
Set TLS ciphersuites to be used.
|
inline |
Set TLS version to be used.
|
inline |
Set the option that forces the use of SSL on recovery connections.
|
inline |
Set compression level.
int Recovery_module::set_retrieved_cert_info | ( | void * | info | ) |
Set retrieved certification info from a group replication channel extracted from a given View_change event.
info | the given view_change_event |
0 | OK |
!=0 | Error |
|
inline |
Sets the recovery shutdown timeout.
[in] | timeout | the timeout |
int Recovery_module::start_recovery | ( | const std::string & | group_name, |
const std::string & | rec_view_id | ||
) |
Starts the recovery process, initializing the recovery thread.
This method is designed to be as light as possible, as if it involved any major computation or wait process that would block the view change process delaying the group.
group_name | the joiner's group name |
rec_view_id | the new view id |
0 | OK |
!=0 | Error |
int Recovery_module::stop_recovery | ( | bool | wait_for_termination = true | ) |
Stops the recovery process, shutting down the recovery thread.
If the thread does not stop in a user designated time interval, a timeout is issued.
wait_for_termination | wait for thread termination or not |
0 | OK |
!=0 | Timeout |
int Recovery_module::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.
It can for the joiner: If it exited, then terminate the recovery process. If the donor left, and the state transfer is still ongoing, then pick a new one and restart the transfer.
did_members_left | states if members left the view |
is_leaving | true if the member is leaving the group |
0 | OK |
!=0 | Error |
|
private |
Starts a wait process until the applier fulfills the necessary condition for the member to be acknowledge as being online.
0 | OK |
!=0 | Error |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |