MySQL 26.7.0
Source Code Documentation
mysql::csa::Applier_channel_monitor Class Reference

#include <applier_channel_monitor.h>

Public Member Functions

 Applier_channel_monitor (Csa_channel &channel)
 
void init_monitoring (std::chrono::milliseconds refresh_time=std::chrono::milliseconds{10000})
 Initializes monitoring with custom refresh interval (default 10s). More...
 
void check_applier_progress ()
 Detects if the applier is stalled by monitoring progress metrics (applied events, scheduler/commit clocks, active transactions) over a periodic interval (default 10s). More...
 
std::size_t get_allowed_unblocks () const
 
std::size_t get_current_unblock_counter () const
 
std::size_t get_total_unblock_counter () const
 

Private Member Functions

void refresh_values ()
 Helper refreshing internal statistics. More...
 

Private Attributes

Csa_channelm_channel
 Monitored CSA channel reference. More...
 
std::size_t m_previous_applied_events {0}
 Previous recorded value of applied events. More...
 
std::size_t m_current_applied_events {0}
 Current recorded value of applied events. More...
 
std::size_t m_previous_clock_value {0}
 Previous recorded clock value. More...
 
std::size_t m_current_clock_value {0}
 Current recorded clock value. More...
 
std::size_t m_active_trx {0}
 Active transactions. More...
 
std::size_t m_previous_commit_clock_value {0}
 Previous recorded commit order clock value. More...
 
std::size_t m_current_commit_clock_value {0}
 Current recorded commit order clock value. More...
 
std::chrono::time_point< std::chrono::system_clock > m_time_refresh
 Last time we refreshed values. More...
 
std::chrono::milliseconds m_refresh_interval {10000}
 Refresh current values (and previous) each 'm_refresh_interval' seconds. More...
 
std::size_t m_current_unblock_counter {0}
 Current attempts to unblocking the applier. More...
 
std::size_t m_total_unblock_counter {0}
 Total attempts to unblocking the applier. More...
 
std::size_t m_allowed_unblocks {0}
 Allowed clock unblocks for the current stall. More...
 

Constructor & Destructor Documentation

◆ Applier_channel_monitor()

mysql::csa::Applier_channel_monitor::Applier_channel_monitor ( Csa_channel channel)
explicit

Member Function Documentation

◆ check_applier_progress()

void mysql::csa::Applier_channel_monitor::check_applier_progress ( )

Detects if the applier is stalled by monitoring progress metrics (applied events, scheduler/commit clocks, active transactions) over a periodic interval (default 10s).

If no progress detected and unblock attempts remain, calls scheduler unblock function to mitigate stalls. Void return; unblock counter limited per stall. Call periodically from applier oversight.

◆ get_allowed_unblocks()

std::size_t mysql::csa::Applier_channel_monitor::get_allowed_unblocks ( ) const

◆ get_current_unblock_counter()

std::size_t mysql::csa::Applier_channel_monitor::get_current_unblock_counter ( ) const

◆ get_total_unblock_counter()

std::size_t mysql::csa::Applier_channel_monitor::get_total_unblock_counter ( ) const

◆ init_monitoring()

void mysql::csa::Applier_channel_monitor::init_monitoring ( std::chrono::milliseconds  refresh_time = std::chrono::milliseconds{10000})

Initializes monitoring with custom refresh interval (default 10s).

Resets refresh time to now() and sets interval.

Parameters
refresh_timeCustom interval in milliseconds.

◆ refresh_values()

void mysql::csa::Applier_channel_monitor::refresh_values ( )
private

Helper refreshing internal statistics.

Member Data Documentation

◆ m_active_trx

std::size_t mysql::csa::Applier_channel_monitor::m_active_trx {0}
private

Active transactions.

◆ m_allowed_unblocks

std::size_t mysql::csa::Applier_channel_monitor::m_allowed_unblocks {0}
private

Allowed clock unblocks for the current stall.

◆ m_channel

Csa_channel& mysql::csa::Applier_channel_monitor::m_channel
private

Monitored CSA channel reference.

◆ m_current_applied_events

std::size_t mysql::csa::Applier_channel_monitor::m_current_applied_events {0}
private

Current recorded value of applied events.

◆ m_current_clock_value

std::size_t mysql::csa::Applier_channel_monitor::m_current_clock_value {0}
private

Current recorded clock value.

◆ m_current_commit_clock_value

std::size_t mysql::csa::Applier_channel_monitor::m_current_commit_clock_value {0}
private

Current recorded commit order clock value.

◆ m_current_unblock_counter

std::size_t mysql::csa::Applier_channel_monitor::m_current_unblock_counter {0}
private

Current attempts to unblocking the applier.

◆ m_previous_applied_events

std::size_t mysql::csa::Applier_channel_monitor::m_previous_applied_events {0}
private

Previous recorded value of applied events.

◆ m_previous_clock_value

std::size_t mysql::csa::Applier_channel_monitor::m_previous_clock_value {0}
private

Previous recorded clock value.

◆ m_previous_commit_clock_value

std::size_t mysql::csa::Applier_channel_monitor::m_previous_commit_clock_value {0}
private

Previous recorded commit order clock value.

◆ m_refresh_interval

std::chrono::milliseconds mysql::csa::Applier_channel_monitor::m_refresh_interval {10000}
private

Refresh current values (and previous) each 'm_refresh_interval' seconds.

◆ m_time_refresh

std::chrono::time_point<std::chrono::system_clock> mysql::csa::Applier_channel_monitor::m_time_refresh
private

Last time we refreshed values.

◆ m_total_unblock_counter

std::size_t mysql::csa::Applier_channel_monitor::m_total_unblock_counter {0}
private

Total attempts to unblocking the applier.


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