MySQL 8.4.3
Source Code Documentation
|
Mix-in to handle the message logging and reporting for relay log info and master log info structures. More...
#include <rpl_reporting.h>
Classes | |
class | Error |
Error information structure. More... | |
Public Member Functions | |
Slave_reporting_capability (char const *thread_name) | |
Constructor. More... | |
virtual void | report (loglevel level, int err_code, const char *msg,...) const |
Writes a message and, if it's an error message, to Last_Error (which will be displayed by SHOW REPLICA STATUS). More... | |
virtual void | report (loglevel level, int err_code, const Gtid_specification *gtid_next, const char *msg,...) const |
void | va_report (loglevel level, int err_code, const char *prefix_msg, const char *msg, va_list v_args) const |
void | clear_error () |
Clear errors. More... | |
int | has_temporary_error (THD *thd, uint error_arg=0, bool *silent=nullptr) const |
Check if the current error is of temporary nature or not. More... | |
Error const & | last_error () const |
bool | is_error () const |
virtual const char * | get_for_channel_str (bool upper_case) const =0 |
virtual | ~Slave_reporting_capability ()=0 |
Public Attributes | |
mysql_mutex_t | err_lock |
lock used to synchronize m_last_error on 'SHOW REPLICA STATUS' More... | |
Protected Member Functions | |
virtual void | do_report (loglevel level, int err_code, const char *msg, va_list v_args) const |
virtual void | do_report (loglevel level, int err_code, const Gtid_specification *gtid_next, const char *msg, va_list v_args) const |
Protected Attributes | |
Error | m_last_error |
Last error produced by the I/O or SQL thread respectively. More... | |
Private Member Functions | |
Slave_reporting_capability (const Slave_reporting_capability &rhs) | |
Slave_reporting_capability & | operator= (const Slave_reporting_capability &rhs) |
Private Attributes | |
char const *const | m_thread_name |
Mix-in to handle the message logging and reporting for relay log info and master log info structures.
By inheriting from this class, the class is imbued with capabilities to do slave reporting.
Slave_reporting_capability::Slave_reporting_capability | ( | char const * | thread_name | ) |
Constructor.
thread_name | Printable name of the slave thread that is reporting. |
|
pure virtual |
|
private |
|
inline |
Clear errors.
They will not show up under SHOW REPLICA STATUS
.
|
inlineprotectedvirtual |
Reimplemented in Slave_worker.
|
inlineprotectedvirtual |
Reimplemented in Slave_worker.
|
pure virtual |
Implemented in Master_info, Relay_log_info, and Slave_worker.
int Slave_reporting_capability::has_temporary_error | ( | THD * | thd, |
uint | error_arg = 0 , |
||
bool * | silent = nullptr |
||
) | const |
Check if the current error is of temporary nature or not.
Some error codes are always considered temporary in nature, such as ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT.
It is also possible to signal that the error is temporary by pushing a warning with the error code ER_GET_TEMPORARY_ERRMSG or ER_REPLICA_SILENT_RETRY_TRANSACTION.
thd | Thread handle | |
error_arg | The error code for assessment. Defaults to zero which makes the function check the top of the reported errors stack. | |
[out] | silent | Return value indicating whether the error should be silently handled. |
|
inline |
|
inline |
|
private |
|
virtual |
Writes a message and, if it's an error message, to Last_Error (which will be displayed by SHOW REPLICA STATUS).
level | The severity level |
err_code | The error code |
msg | The message (usually related to the error code, but can contain more information), in printf() format. |
|
virtual |
void Slave_reporting_capability::va_report | ( | loglevel | level, |
int | err_code, | ||
const char * | prefix_msg, | ||
const char * | msg, | ||
va_list | v_args | ||
) | const |
|
mutable |
lock used to synchronize m_last_error on 'SHOW REPLICA STATUS'
|
mutableprotected |
Last error produced by the I/O or SQL thread respectively.
|
private |