24#ifndef RPL_REPORTING_H
25#define RPL_REPORTING_H
42#define MAX_SLAVE_ERRMSG 1024
75 virtual void report(
loglevel level,
int err_code,
const char *msg, ...) const
76 MY_ATTRIBUTE((format(printf, 4, 5)));
80 ...) const MY_ATTRIBUTE((format(printf, 5, 6)));
83 const
char *msg, va_list v_args) const
84 MY_ATTRIBUTE((format(printf, 5, 0)));
100 bool *
silent =
nullptr)
const;
123 tt_tmp =
skr / 1000000;
124 localtime_r(&tt_tmp, &tm_tmp);
160 va_list v_args)
const
161 MY_ATTRIBUTE((format(printf, 4, 0)));
165 va_list v_args)
const
166 MY_ATTRIBUTE((format(printf, 5, 0)));
183 va_list v_args)
const {
184 va_report(level, err_code,
nullptr, msg, v_args);
190 va_list v_args)
const {
191 va_report(level, err_code,
nullptr, msg, v_args);
Error information structure.
Definition: rpl_reporting.h:105
char message[MAX_SLAVE_ERRMSG]
Error message.
Definition: rpl_reporting.h:136
char timestamp[64]
Error timestamp as string.
Definition: rpl_reporting.h:138
Error()
Definition: rpl_reporting.h:109
void clear()
Definition: rpl_reporting.h:111
void update_timestamp()
Definition: rpl_reporting.h:117
ulonglong skr
Error timestamp in microseconds.
Definition: rpl_reporting.h:140
uint32 number
Error code.
Definition: rpl_reporting.h:134
Mix-in to handle the message logging and reporting for relay log info and master log info structures.
Definition: rpl_reporting.h:54
Error const & last_error() const
Definition: rpl_reporting.h:143
virtual void do_report(loglevel level, int err_code, const char *msg, va_list v_args) const
Definition: rpl_reporting.h:181
Slave_reporting_capability(char const *thread_name)
Constructor.
Definition: rpl_reporting.cc:42
Slave_reporting_capability(const Slave_reporting_capability &rhs)
Slave_reporting_capability & operator=(const Slave_reporting_capability &rhs)
virtual const char * get_for_channel_str(bool upper_case) const =0
mysql_mutex_t err_lock
lock used to synchronize m_last_error on 'SHOW REPLICA STATUS'
Definition: rpl_reporting.h:57
void va_report(loglevel level, int err_code, const char *prefix_msg, const char *msg, va_list v_args) const
Definition: rpl_reporting.cc:134
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 REPLIC...
Definition: rpl_reporting.cc:117
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.
Definition: rpl_reporting.cc:67
void clear_error()
Clear errors.
Definition: rpl_reporting.h:90
bool is_error() const
Definition: rpl_reporting.h:144
virtual ~Slave_reporting_capability()=0
Definition: rpl_reporting.cc:200
Error m_last_error
Last error produced by the I/O or SQL thread respectively.
Definition: rpl_reporting.h:171
char const *const m_thread_name
Definition: rpl_reporting.h:174
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:50
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:57
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
Header for compiler-dependent features.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint32_t uint32
Definition: my_inttypes.h:67
Definition of the global "loglevel" enumeration.
loglevel
Definition: my_loglevel.h:41
Defines for getting and processing the current system type programmatically.
unsigned long long int my_getsystime()
Get high-resolution time.
Definition: my_systime.h:102
ABI for instrumented mutexes.
static bool silent
Definition: mysqlimport.cc:70
Instrumentation helpers for mutexes.
#define MAX_SLAVE_ERRMSG
Maximum size of an error message from a slave thread.
Definition: rpl_reporting.h:42
This struct represents a specification of a GTID for a statement to be executed: either "AUTOMATIC",...
Definition: rpl_gtid.h:3985
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Include file for Sun RPC to compile out of the box.