MySQL 9.1.0
Source Code Documentation
|
Tracks the concurrent executions of adding dirty pages to the flush lists. More...
#include <buf0flu.h>
Public Member Functions | |
void | validate_not_added (lsn_t begin, lsn_t end) |
Validates using assertions that the specified LSN range is not yet added to the flush lists. More... | |
void | assume_added_up_to (lsn_t start_lsn) |
Assume that the start_lsn is the start lsn of the first mini-transaction, for which report_added(mtr.start_lsn, mtr.end_lsn) was not yet called. More... | |
void | report_added (lsn_t oldest_modification, lsn_t newest_modification) |
Used to report that we know that all changes in a specified range of lsns were already applied to pages in BP and all these pages were already added to corresponding flush lists. More... | |
uint64_t | order_lag () |
The flush lists are not completely sorted, and the amount of disorder is limited by the order_lag() - which is controlled by immutable srv_buf_flush_list_added_size sysvar - in the following way. More... | |
lsn_t | smallest_not_added_lsn () |
Return lsn up to which we know that all dirty pages with smaller oldest_modification were added to the flush list. More... | |
void | wait_to_add (lsn_t oldest_modification) |
Wait until it is safe to add dirty pages with a given oldest_modification lsn to flush list without exceeding the disorder limit imposed by older_lag(). More... | |
Static Public Member Functions | |
static Buf_flush_list_added_lsns_aligned_ptr | create () |
Factory method that creates a dynamically allocated instance that is aligned to the cache line boundary. More... | |
Private Member Functions | |
Buf_flush_list_added_lsns () | |
Constructor. More... | |
Private Attributes | |
Link_buf< lsn_t > | m_buf_added_lsns |
Ring buffer that keeps track of the ranges of LSNs added to flush_list(s) already. More... | |
Friends | |
template<typename T , typename... Args> | |
T * | ut::aligned_new_withkey (ut::PSI_memory_key_t key, std::size_t alignment, Args &&...args) |
Tracks the concurrent executions of adding dirty pages to the flush lists.
It allows to relax order in which dirty pages have to be added to the flush lists and helps in advancing the checkpoint LSN. Note : Earlier it was known as recent_closed buffer.
|
private |
Constructor.
Clients must use factory method to create an instance
void Buf_flush_list_added_lsns::assume_added_up_to | ( | lsn_t | start_lsn | ) |
Assume that the start_lsn is the start lsn of the first mini-transaction, for which report_added(mtr.start_lsn, mtr.end_lsn) was not yet called.
Before the call smallest_not_added_lsn() can't be larger than start_lsn. During the call smallest_not_added_lsn() becomes start_lsn.
[in] | start_lsn | LSNs that are already flushed. |
|
static |
Factory method that creates a dynamically allocated instance that is aligned to the cache line boundary.
This is needed since C++17 doesn't guarantee allocating aligned types dynamically
uint64_t Buf_flush_list_added_lsns::order_lag | ( | ) |
The flush lists are not completely sorted, and the amount of disorder is limited by the order_lag() - which is controlled by immutable srv_buf_flush_list_added_size sysvar - in the following way.
If page A is added before page B in a flush_list, then it must hold that A.oldest_modification returned value < B.oldest_modification.
void Buf_flush_list_added_lsns::report_added | ( | lsn_t | oldest_modification, |
lsn_t | newest_modification | ||
) |
Used to report that we know that all changes in a specified range of lsns were already applied to pages in BP and all these pages were already added to corresponding flush lists.
The committing mtr should use this function to report that it has added all the pages that it has dirtied to corresponding flush lists already. The newest_modification should be the mtr->commit_lsn(). The oldest_modification should be the start_lsn assigned to the mtr (which equals commit_lsn() of the previous mtr).
Information from these reports is used by smallest_not_added_lsn() to establish the smallest not yet reported lsn, which in turn can be used by page cleaners, or other mtrs which are currently waiting for their turn in wait_to_add().
[in] | oldest_modification | start lsn of the range |
[in] | newest_modification | end lsn fo the range |
lsn_t Buf_flush_list_added_lsns::smallest_not_added_lsn | ( | ) |
Return lsn up to which we know that all dirty pages with smaller oldest_modification were added to the flush list.
Validates using assertions that the specified LSN range is not yet added to the flush lists.
[in] | begin | start LSN of the range |
[in] | end | end LSN of the range |
void Buf_flush_list_added_lsns::wait_to_add | ( | lsn_t | oldest_modification | ) |
Wait until it is safe to add dirty pages with a given oldest_modification lsn to flush list without exceeding the disorder limit imposed by older_lag().
This function will block and wait until all the pages having page.oldest_modification smaller than oldest_modification - older_lag() are reported to be added to flush list by other threads.
[in] | oldest_modification | Oldest LSN that does not violate the order_lag() |
|
friend |
Ring buffer that keeps track of the ranges of LSNs added to flush_list(s) already.