MySQL 8.4.0
Source Code Documentation
Adaptive_flush Namespace Reference

Functions

bool initialize (ulint n_pages_last)
 Initialize flush parameters for current iteration. More...
 
void set_average ()
 Set average LSN and page flush speed across multiple iterations. More...
 
ulint get_pct_for_dirty ()
 Calculates if flushing is required based on number of dirty pages in the buffer pool. More...
 
ulint get_pct_for_lsn (lsn_t age)
 Calculates if flushing is required based on redo generation rate. More...
 
ulint set_flush_target_by_lsn (bool sync_flush, lsn_t sync_flush_limit_lsn)
 Set page flush target based on LSN change and checkpoint age. More...
 
ulint set_flush_target_by_page (ulint n_pages_lsn)
 Set page flush target based on dirty pages in buffer pool. More...
 
ulint page_recommendation (ulint last_pages_in, bool is_sync_flush, lsn_t sync_flush_limit_lsn)
 This function is called approximately once every second by the page_cleaner thread, unless it is sync flushing mode, in which case it is called every small round. More...
 

Variables

std::chrono::steady_clock::time_point cur_iter_time
 Time stamp of current iteration. More...
 
lsn_t cur_iter_lsn = 0
 LSN at current iteration. More...
 
ulint cur_iter_pages_dirty = 0
 Number of dirty pages in flush list in current iteration. More...
 
ulint cur_iter_dirty_pct = 0
 Dirty page percentage in buffer pool. More...
 
std::chrono::steady_clock::time_point prev_iter_time
 Time stamp of previous iteration. More...
 
ulint prev_iter_pages_dirty = 0
 Number of dirty pages in flush list at previous iteration. More...
 
ulint prev_iter_pages_flushed = 0
 Actual number of pages flushed by last iteration. More...
 
lsn_t lsn_avg_rate = 0
 Average redo generation rate. More...
 
ulint page_avg_rate = 0
 Average page flush rate. More...
 
lsn_t prev_lsn = 0
 LSN when last average rates are computed. More...
 
std::chrono::steady_clock::time_point prev_time
 Time stamp when last average rates are computed. More...
 
ulint n_iterations = 0
 Number of iteration till average rates are computed. More...
 
ulint sum_pages = 0
 Pages flushed till last average rates are computed. More...
 

Function Documentation

◆ get_pct_for_dirty()

ulint Adaptive_flush::get_pct_for_dirty ( )

Calculates if flushing is required based on number of dirty pages in the buffer pool.

Returns
percent of io_capacity to flush to manage dirty page ratio

◆ get_pct_for_lsn()

ulint Adaptive_flush::get_pct_for_lsn ( lsn_t  age)

Calculates if flushing is required based on redo generation rate.

Returns
percent of io_capacity to flush to manage redo space
Parameters
agein: current age of LSN.

◆ initialize()

bool Adaptive_flush::initialize ( ulint  n_pages_last)

Initialize flush parameters for current iteration.

Parameters
[in]n_pages_lastnumber of pages flushed in last iteration
Returns
true if current iteration should be skipped.

◆ page_recommendation()

ulint Adaptive_flush::page_recommendation ( ulint  last_pages_in,
bool  is_sync_flush,
lsn_t  sync_flush_limit_lsn 
)

This function is called approximately once every second by the page_cleaner thread, unless it is sync flushing mode, in which case it is called every small round.

Based on various factors it decides if there is a need to do flushing.

Parameters
last_pages_inthe number of pages flushed by the last flush_list flushing
is_sync_flushtrue iff this is sync flush mode
sync_flush_limit_lsnlow limit for oldest_modification if is_sync_flush is true
Returns
number of pages recommended to be flushed

◆ set_average()

void Adaptive_flush::set_average ( )

Set average LSN and page flush speed across multiple iterations.

◆ set_flush_target_by_lsn()

ulint Adaptive_flush::set_flush_target_by_lsn ( bool  sync_flush,
lsn_t  sync_flush_limit_lsn 
)

Set page flush target based on LSN change and checkpoint age.

Parameters
[in]sync_flushtrue iff this is sync flush mode
[in]sync_flush_limit_lsnlow limit for oldest_modification if sync_flush is true
Returns
number of pages requested to flush

◆ set_flush_target_by_page()

ulint Adaptive_flush::set_flush_target_by_page ( ulint  n_pages_lsn)

Set page flush target based on dirty pages in buffer pool.

Set only if the target are is found to be higher than the target evaluated based on LSN.

Parameters
[in]n_pages_lsnnumber of pages estimated and set based on LSN
Returns
page flush target.

Variable Documentation

◆ cur_iter_dirty_pct

ulint Adaptive_flush::cur_iter_dirty_pct = 0

Dirty page percentage in buffer pool.

◆ cur_iter_lsn

lsn_t Adaptive_flush::cur_iter_lsn = 0

LSN at current iteration.

◆ cur_iter_pages_dirty

ulint Adaptive_flush::cur_iter_pages_dirty = 0

Number of dirty pages in flush list in current iteration.

◆ cur_iter_time

std::chrono::steady_clock::time_point Adaptive_flush::cur_iter_time

Time stamp of current iteration.

◆ lsn_avg_rate

lsn_t Adaptive_flush::lsn_avg_rate = 0

Average redo generation rate.

◆ n_iterations

ulint Adaptive_flush::n_iterations = 0

Number of iteration till average rates are computed.

◆ page_avg_rate

ulint Adaptive_flush::page_avg_rate = 0

Average page flush rate.

◆ prev_iter_pages_dirty

ulint Adaptive_flush::prev_iter_pages_dirty = 0

Number of dirty pages in flush list at previous iteration.

◆ prev_iter_pages_flushed

ulint Adaptive_flush::prev_iter_pages_flushed = 0

Actual number of pages flushed by last iteration.

◆ prev_iter_time

std::chrono::steady_clock::time_point Adaptive_flush::prev_iter_time

Time stamp of previous iteration.

◆ prev_lsn

lsn_t Adaptive_flush::prev_lsn = 0

LSN when last average rates are computed.

◆ prev_time

std::chrono::steady_clock::time_point Adaptive_flush::prev_time

Time stamp when last average rates are computed.

◆ sum_pages

ulint Adaptive_flush::sum_pages = 0

Pages flushed till last average rates are computed.