MySQL 9.7.0
Source Code Documentation
gr_resource_manager Namespace Reference

Classes

class  GR_resource_manager
 This class will be used to execute SQL Queries. More...
 
class  Lag_metadata_thresholds
 This class stores the lag thesholds controlled by system variables. More...
 
struct  lag_record
 Stores the channel lag information. More...
 
struct  Memory_Info
 
struct  Proc_Meminfo
 
struct  Proc_Meminfo_Reader
 Reader for /proc/meminfo. More...
 
struct  Proc_Reader
 Reader base class. More...
 
class  ProcFS
 
struct  Query
 
class  Query_Manager
 Query processor. More...
 
class  Resource_manager_stats_collector
 
struct  System_Memory_Info
 
struct  value_by_name
 Line processor for values indexed by name. More...
 

Typedefs

using value_name_u64 = value_by_name< uint64_t >
 
typedef std::vector< std::string > Row
 
typedef std::vector< RowResult_Set
 

Functions

int register_system_variables ()
 
int unregister_system_variables ()
 
int register_status_variables ()
 
int unregister_status_variables ()
 
void stop_the_component (bool status_vars, bool system_vars, bool thread_stop)
 Stop/Unregister the part of the components as passed in the argument. More...
 
static mysql_service_status_t gr_resource_manager_init ()
 Component's init functions. More...
 
static mysql_service_status_t gr_resource_manager_deinit ()
 Component's deinit functions. More...
 
bool is_numeric (const std::string &str)
 
bool insert_values_for_debug (std::vector< lag_record > &records)
 
int get_system_memory_info (System_Memory_Info &sys_memory_info)
 Get memory stats for the system and current process (Linux). More...
 
int get_memory_info (Memory_Info &memory_info)
 
static void * start_routine (void *arg)
 Static routine for thread instrumentation interface. More...
 
static int gr_applier_lag (THD *, SHOW_VAR *var, char *buf)
 
static int gr_recovery_lag (THD *, SHOW_VAR *var, char *buf)
 
static int gr_memory_percentage_used (THD *, SHOW_VAR *var, char *buf)
 
static int gr_applier_hit (THD *, SHOW_VAR *var, char *buf)
 
static int gr_recovery_hit (THD *, SHOW_VAR *var, char *buf)
 
static int gr_memory_hit (THD *, SHOW_VAR *var, char *buf)
 
static int gr_applier_timestamp (THD *, SHOW_VAR *var, char *buf)
 
static int gr_recovery_timestamp (THD *, SHOW_VAR *var, char *buf)
 
static int gr_memory_timestamp (THD *, SHOW_VAR *var, char *buf)
 
static int gr_lag_query_last_error_timestamp (THD *, SHOW_VAR *var, char *buf)
 
static int gr_memory_last_error_timestamp (THD *, SHOW_VAR *var, char *buf)
 
static void update_the_variable_used_memory_limit (MYSQL_THD, SYS_VAR *, void *var_ptr, const void *save)
 
static void update_the_variable_quarantine_time (MYSQL_THD, SYS_VAR *, void *var_ptr, const void *save)
 
static void update_the_variable_applier_lag (MYSQL_THD, SYS_VAR *, void *var_ptr, const void *save)
 
static void update_the_variable_recovery_lag (MYSQL_THD, SYS_VAR *, void *var_ptr, const void *save)
 

Variables

const char * component_name = STRINGIFY(GROUP_REPLICATION_RESOURCE_MANAGER)
 
bool m_sysinfo_error {false}
 
constexpr std::string_view k_path_proc_meminfo {"/proc/meminfo"}
 
int threshhold_hit {0}
 
static SHOW_VAR status_func_var []
 

Typedef Documentation

◆ Result_Set

typedef std::vector<Row> gr_resource_manager::Result_Set

◆ Row

typedef std::vector<std::string> gr_resource_manager::Row

◆ value_name_u64

Function Documentation

◆ get_memory_info()

int gr_resource_manager::get_memory_info ( Memory_Info memory_info)

◆ get_system_memory_info()

int gr_resource_manager::get_system_memory_info ( System_Memory_Info sys_memory_info)

Get memory stats for the system and current process (Linux).

Parameters
[out]sys_memory_infoSystem memory info
Returns
0 success, 1 failure

◆ gr_applier_hit()

static int gr_resource_manager::gr_applier_hit ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_applier_lag()

static int gr_resource_manager::gr_applier_lag ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_applier_timestamp()

static int gr_resource_manager::gr_applier_timestamp ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_lag_query_last_error_timestamp()

static int gr_resource_manager::gr_lag_query_last_error_timestamp ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_memory_hit()

static int gr_resource_manager::gr_memory_hit ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_memory_last_error_timestamp()

static int gr_resource_manager::gr_memory_last_error_timestamp ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_memory_percentage_used()

static int gr_resource_manager::gr_memory_percentage_used ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_memory_timestamp()

static int gr_resource_manager::gr_memory_timestamp ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_recovery_hit()

static int gr_resource_manager::gr_recovery_hit ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_recovery_lag()

static int gr_resource_manager::gr_recovery_lag ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_recovery_timestamp()

static int gr_resource_manager::gr_recovery_timestamp ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ gr_resource_manager_deinit()

static mysql_service_status_t gr_resource_manager::gr_resource_manager_deinit ( )
static

Component's deinit functions.

Deregisters everything that was registered by init.

Returns
status
Return values
0Success

◆ gr_resource_manager_init()

static mysql_service_status_t gr_resource_manager::gr_resource_manager_init ( )
static

Component's init functions.

Starts thread.

Registers everything.

Returns
status
Return values
1Error
0Success

◆ insert_values_for_debug()

bool gr_resource_manager::insert_values_for_debug ( std::vector< lag_record > &  records)

◆ is_numeric()

bool gr_resource_manager::is_numeric ( const std::string &  str)

◆ register_status_variables()

int gr_resource_manager::register_status_variables ( )

◆ register_system_variables()

int gr_resource_manager::register_system_variables ( )

◆ start_routine()

static void * gr_resource_manager::start_routine ( void *  arg)
static

Static routine for thread instrumentation interface.

◆ stop_the_component()

void gr_resource_manager::stop_the_component ( bool  status_vars,
bool  system_vars,
bool  thread_stop 
)

Stop/Unregister the part of the components as passed in the argument.

Parameters
[in]status_varsUnregister the status variables.
[in]system_varsUnregister the system variables.
[in]thread_stopStop the thread.

◆ unregister_status_variables()

int gr_resource_manager::unregister_status_variables ( )

◆ unregister_system_variables()

int gr_resource_manager::unregister_system_variables ( )

◆ update_the_variable_applier_lag()

static void gr_resource_manager::update_the_variable_applier_lag ( MYSQL_THD  ,
SYS_VAR ,
void *  var_ptr,
const void *  save 
)
static

◆ update_the_variable_quarantine_time()

static void gr_resource_manager::update_the_variable_quarantine_time ( MYSQL_THD  ,
SYS_VAR ,
void *  var_ptr,
const void *  save 
)
static

◆ update_the_variable_recovery_lag()

static void gr_resource_manager::update_the_variable_recovery_lag ( MYSQL_THD  ,
SYS_VAR ,
void *  var_ptr,
const void *  save 
)
static

◆ update_the_variable_used_memory_limit()

static void gr_resource_manager::update_the_variable_used_memory_limit ( MYSQL_THD  ,
SYS_VAR ,
void *  var_ptr,
const void *  save 
)
static

Variable Documentation

◆ component_name

const char* gr_resource_manager::component_name = STRINGIFY(GROUP_REPLICATION_RESOURCE_MANAGER)

◆ k_path_proc_meminfo

constexpr std::string_view gr_resource_manager::k_path_proc_meminfo {"/proc/meminfo"}
constexpr

◆ m_sysinfo_error

bool gr_resource_manager::m_sysinfo_error {false}

◆ status_func_var

SHOW_VAR gr_resource_manager::status_func_var[]
static

◆ threshhold_hit

int gr_resource_manager::threshhold_hit {0}