MySQL 8.3.0
Source Code Documentation
Slave_reporting_capability Class Referenceabstract

Mix-in to handle the message logging and reporting for relay log info and master log info structures. More...

#include <rpl_reporting.h>

Inheritance diagram for Slave_reporting_capability:
[legend]

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 SLAVE 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 SLAVE 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_capabilityoperator= (const Slave_reporting_capability &rhs)
 

Private Attributes

char const *const m_thread_name
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Slave_reporting_capability() [1/2]

Slave_reporting_capability::Slave_reporting_capability ( char const *  thread_name)

Constructor.

Parameters
thread_namePrintable name of the slave thread that is reporting.

◆ ~Slave_reporting_capability()

Slave_reporting_capability::~Slave_reporting_capability ( )
pure virtual

◆ Slave_reporting_capability() [2/2]

Slave_reporting_capability::Slave_reporting_capability ( const Slave_reporting_capability rhs)
private

Member Function Documentation

◆ clear_error()

void Slave_reporting_capability::clear_error ( )
inline

Clear errors.

They will not show up under SHOW SLAVE STATUS.

◆ do_report() [1/2]

void Slave_reporting_capability::do_report ( loglevel  level,
int  err_code,
const char *  msg,
va_list  v_args 
) const
inlineprotectedvirtual

Reimplemented in Slave_worker.

◆ do_report() [2/2]

void Slave_reporting_capability::do_report ( loglevel  level,
int  err_code,
const Gtid_specification gtid_next,
const char *  msg,
va_list  v_args 
) const
inlineprotectedvirtual

Reimplemented in Slave_worker.

◆ get_for_channel_str()

virtual const char * Slave_reporting_capability::get_for_channel_str ( bool  upper_case) const
pure virtual

Implemented in Master_info, Relay_log_info, and Slave_worker.

◆ has_temporary_error()

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 errors are temporary in nature, such as ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT. Ndb also signals that the error is temporary by pushing a warning with the error code ER_GET_TEMPORARY_ERRMSG, if the originating error is temporary.

Parameters
thda THD instance, typically of the slave SQL thread's.
error_argthe error code for assessment. defaults to zero which makes the function check the top of the reported errors stack.
silentbool indicating whether the error should be silently handled.
Returns
1 as the positive and 0 as the negative verdict

◆ is_error()

bool Slave_reporting_capability::is_error ( ) const
inline

◆ last_error()

Error const & Slave_reporting_capability::last_error ( ) const
inline

◆ operator=()

Slave_reporting_capability & Slave_reporting_capability::operator= ( const Slave_reporting_capability rhs)
private

◆ report() [1/2]

void Slave_reporting_capability::report ( loglevel  level,
int  err_code,
const char *  msg,
  ... 
) const
virtual

Writes a message and, if it's an error message, to Last_Error (which will be displayed by SHOW SLAVE STATUS).

Parameters
levelThe severity level
err_codeThe error code
msgThe message (usually related to the error code, but can contain more information), in printf() format.

◆ report() [2/2]

void Slave_reporting_capability::report ( loglevel  level,
int  err_code,
const Gtid_specification gtid_next,
const char *  msg,
  ... 
) const
virtual

◆ va_report()

void Slave_reporting_capability::va_report ( loglevel  level,
int  err_code,
const char *  prefix_msg,
const char *  msg,
va_list  v_args 
) const

Member Data Documentation

◆ err_lock

mysql_mutex_t Slave_reporting_capability::err_lock
mutable

lock used to synchronize m_last_error on 'SHOW SLAVE STATUS'

◆ m_last_error

Error Slave_reporting_capability::m_last_error
mutableprotected

Last error produced by the I/O or SQL thread respectively.

◆ m_thread_name

char const* const Slave_reporting_capability::m_thread_name
private

The documentation for this class was generated from the following files: