The buffer control block structure.
More...
#include <buf0buf.h>
|
struct | ahi_t |
| Structure that holds most AHI-related fields. More...
|
|
|
struct buf_block_t::ahi_t | ahi |
|
std::atomic< uint32_t > | n_hash_helps |
| Counter which controls how many times the current prefix recommendation would help in searches. More...
|
|
bool | made_dirty_with_no_latch |
| true if block has been made dirty without acquiring X/SX latch as the block belongs to temporary tablespace and block is always accessed by a single thread. More...
|
|
BPageMutex | mutex |
| mutex protecting this block: state (also protected by the buffer pool mutex), io_fix, buf_fix_count, and accessed; we introduce this new mutex in InnoDB-5.1 to relieve contention on the buffer pool mutex More...
|
|
|
rw_lock_t | debug_latch |
| In the debug version, each thread which bufferfixes the block acquires an s-latch here; so we can use the debug utilities in sync0rw. More...
|
|
|
uint64_t | modify_clock |
| This clock is incremented every time a pointer to a record on the page may become obsolete; this is used in the optimistic cursor positioning: if the modify clock has not changed, we know that the pointer is still valid; this field may be changed if the thread (1) owns the LRU list mutex and the page is not bufferfixed, or (2) the thread has an x-latch on the block, or (3) the block must belong to an intrinsic table. More...
|
|
The buffer control block structure.
◆ get_modify_clock()
uint64_t buf_block_t::get_modify_clock |
( |
bool |
single_threaded | ) |
const |
|
inlinenoexcept |
Get the modified clock (version) value.
- Parameters
-
[in] | single_threaded | Thread can only be written to or read by a single thread |
- Returns
- the modified clock vlue.
◆ get_next_page_no()
page_no_t buf_block_t::get_next_page_no |
( |
| ) |
const |
|
inline |
Get the next page number of the current buffer block.
- Returns
- next page number of the current buffer block.
◆ get_page_id()
const page_id_t & buf_block_t::get_page_id |
( |
| ) |
const |
|
inline |
Get the page number and space id of the current buffer block.
- Returns
- page number of the current buffer block.
◆ get_page_no()
Get the page number of the current buffer block.
- Returns
- page number of the current buffer block.
◆ get_page_type()
Get the page type of the current buffer block.
- Returns
- page type of the current buffer block.
◆ get_page_type_str()
const char * buf_block_t::get_page_type_str |
( |
| ) |
const |
|
noexcept |
Get the page type of the current buffer block as string.
- Returns
- page type of the current buffer block as string.
◆ get_page_zip() [1/2]
Const version.
- Returns
- page descriptor or nullptr.
◆ get_page_zip() [2/2]
Gets the compressed page descriptor corresponding to an uncompressed page if applicable.
- Returns
- page descriptor or nullptr.
◆ get_prev_page_no()
page_no_t buf_block_t::get_prev_page_no |
( |
| ) |
const |
|
inline |
Get the prev page number of the current buffer block.
- Returns
- prev page number of the current buffer block.
◆ UT_LIST_NODE_T()
node of the decompressed LRU list; a block is in the unzip_LRU list if page.state == BUF_BLOCK_FILE_PAGE and page.zip.data != NULL.
Protected by both LRU_list_mutex and the block mutex.
◆ ahi
◆ debug_latch
In the debug version, each thread which bufferfixes the block acquires an s-latch here; so we can use the debug utilities in sync0rw.
◆ frame
pointer to buffer frame which is of size UNIV_PAGE_SIZE, and aligned to an address divisible by UNIV_PAGE_SIZE
◆ in_unzip_LRU_list
bool buf_block_t::in_unzip_LRU_list |
true if the page is in the decompressed LRU list; used in debugging
◆ in_withdraw_list
bool buf_block_t::in_withdraw_list |
◆ lock
read-write lock of the buffer frame
◆ made_dirty_with_no_latch
bool buf_block_t::made_dirty_with_no_latch |
true if block has been made dirty without acquiring X/SX latch as the block belongs to temporary tablespace and block is always accessed by a single thread.
◆ modify_clock
uint64_t buf_block_t::modify_clock |
This clock is incremented every time a pointer to a record on the page may become obsolete; this is used in the optimistic cursor positioning: if the modify clock has not changed, we know that the pointer is still valid; this field may be changed if the thread (1) owns the LRU list mutex and the page is not bufferfixed, or (2) the thread has an x-latch on the block, or (3) the block must belong to an intrinsic table.
◆ mutex
mutex protecting this block: state (also protected by the buffer pool mutex), io_fix, buf_fix_count, and accessed; we introduce this new mutex in InnoDB-5.1 to relieve contention on the buffer pool mutex
◆ n_hash_helps
std::atomic<uint32_t> buf_block_t::n_hash_helps |
Counter which controls how many times the current prefix recommendation would help in searches.
If it is helpful enough, it will be used as the actual prefix to build hash for this block. It is modified similarly as recommended_prefix_info, that is only while having S- or X- latch on block's lock. Because it is modified concurrently, it may not have fully reliable count, but it is enough for this use case. Mind the n_hash_helps is AHI-related, and should be in the ahi_t struct above, but having it outside causes the made_dirty_with_no_latch to occupy the common 8byte aligned 8byte long space, so basically it saves us 8bytes of the object that is used in high volumes.
◆ page
page information; this must be the first field, so that buf_pool->page_hash can point to buf_page_t or buf_block_t
The documentation for this struct was generated from the following files: