MySQL  8.0.22
Source Code Documentation
buf_page_t Class Reference

#include <buf0buf.h>

Public Member Functions

void set_dblwr_batch_id (uint16_t batch_id)
 Set the doublewrite buffer ID. More...
 
uint16_t get_dblwr_batch_id () const
 

Public Attributes

page_zip_des_t zip
 compressed page; zip.data (but not the data it points to) is protected by buf_pool->zip_mutex; state == BUF_BLOCK_ZIP_PAGE and zip.data == NULL means an active buf_pool->watch More...
 
buf_page_thash
 node used in chaining to buf_pool->page_hash or buf_pool->zip_hash More...
 
bool in_page_hash
 TRUE if in buf_pool->page_hash. More...
 
bool in_zip_hash
 TRUE if in buf_pool->zip_hash. More...
 
unsigned access_time
 Time of first access, or 0 if the block was never accessed in the buffer pool. More...
 
bool file_page_was_freed
 This is set to TRUE when fsp frees a page in buffer pool; protected by buf_pool->zip_mutex or buf_block_t::mutex. More...
 
FlushObserverflush_observer
 Flush observer. More...
 
uint16_t m_dblwr_id {}
 Double write instance ordinal value during writes. More...
 
General fields

None of these bit-fields must be modified without holding buf_page_get_mutex() [buf_block_t::mutex or buf_pool->zip_mutex], since they can be stored in the same machine word.

page_id_t id
 Page id. More...
 
page_size_t size
 Page size. More...
 
uint32_t buf_fix_count
 Count of how manyfold this block is currently bufferfixed. More...
 
buf_io_fix io_fix
 type of pending I/O operation. More...
 
buf_page_state state
 Block state. More...
 
unsigned flush_type: 2
 if this block is currently being flushed to disk, this tells the flush_type. More...
 
unsigned buf_pool_index: 6
 index number of the buffer pool that this block belongs to More...
 

Page flushing fields

All these are protected by buf_pool->mutex.

bool in_flush_list
 Based on state, this is a list node, protected by the corresponding list mutex, in one of the following lists in buf_pool: More...
 
bool in_free_list
 
lsn_t newest_modification
 TRUE if in buf_pool->free; when buf_pool->free_list_mutex is free, the following should hold: in_free_list == (state == BUF_BLOCK_NOT_USED) More...
 
lsn_t oldest_modification
 log sequence number of the youngest modification to this block, zero if not modified. More...
 
 UT_LIST_NODE_T (buf_page_t) list
 

LRU replacement algorithm fields

log sequence number of the START of the log entry written of the oldest modification to this block which has not yet been flushed on disk; zero if all modifications are on disk.

Writes to this field must be covered by both block->mutex and buf_pool->flush_list_mutex. Hence reads can happen while holding any one of the two mutexes These fields are protected by both buf_pool->LRU_list_mutex and the block mutex.

bool in_LRU_list
 node of the LRU list More...
 
unsigned old: 1
 true if the block is in the old blocks in buf_pool->LRU_old More...
 
unsigned freed_page_clock: 31
 The value of buf_pool->freed_page_clock when this block was the last time put to the head of the LRU list; a thread is allowed to read this for heuristic purposes without holding any mutex or latch. More...
 
 UT_LIST_NODE_T (buf_page_t) LRU
 

Member Function Documentation

◆ get_dblwr_batch_id()

uint16_t buf_page_t::get_dblwr_batch_id ( ) const
inline
Returns
the double write batch id, or uint16_t max if undefined.

◆ set_dblwr_batch_id()

void buf_page_t::set_dblwr_batch_id ( uint16_t  batch_id)
inline

Set the doublewrite buffer ID.

Parameters
[in]batch_idDouble write batch ID which flushed the page.

◆ UT_LIST_NODE_T() [1/2]

buf_page_t::UT_LIST_NODE_T ( buf_page_t  )

◆ UT_LIST_NODE_T() [2/2]

buf_page_t::UT_LIST_NODE_T ( buf_page_t  )

Member Data Documentation

◆ access_time

unsigned buf_page_t::access_time

Time of first access, or 0 if the block was never accessed in the buffer pool.

Protected by block mutex

◆ buf_fix_count

uint32_t buf_page_t::buf_fix_count

Count of how manyfold this block is currently bufferfixed.

◆ buf_pool_index

unsigned buf_page_t::buf_pool_index

index number of the buffer pool that this block belongs to

◆ file_page_was_freed

bool buf_page_t::file_page_was_freed

This is set to TRUE when fsp frees a page in buffer pool; protected by buf_pool->zip_mutex or buf_block_t::mutex.

◆ flush_observer

FlushObserver* buf_page_t::flush_observer

Flush observer.

◆ flush_type

unsigned buf_page_t::flush_type

if this block is currently being flushed to disk, this tells the flush_type.

See also
buf_flush_t

◆ freed_page_clock

unsigned buf_page_t::freed_page_clock

The value of buf_pool->freed_page_clock when this block was the last time put to the head of the LRU list; a thread is allowed to read this for heuristic purposes without holding any mutex or latch.

◆ hash

buf_page_t* buf_page_t::hash

node used in chaining to buf_pool->page_hash or buf_pool->zip_hash

◆ id

page_id_t buf_page_t::id

Page id.

◆ in_flush_list

bool buf_page_t::in_flush_list

Based on state, this is a list node, protected by the corresponding list mutex, in one of the following lists in buf_pool:

  • BUF_BLOCK_NOT_USED: free, withdraw
  • BUF_BLOCK_FILE_PAGE: flush_list
  • BUF_BLOCK_ZIP_DIRTY: flush_list
  • BUF_BLOCK_ZIP_PAGE: zip_clean

The node pointers are protected by the corresponding list mutex.

The contents of the list node is undefined if !in_flush_list && state == BUF_BLOCK_FILE_PAGE, or if state is one of BUF_BLOCK_MEMORY, BUF_BLOCK_REMOVE_HASH or BUF_BLOCK_READY_IN_USE. TRUE if in buf_pool->flush_list; when buf_pool->flush_list_mutex is free, the following should hold: in_flush_list == (state == BUF_BLOCK_FILE_PAGE || state == BUF_BLOCK_ZIP_DIRTY) Writes to this field must be covered by both block->mutex and buf_pool->flush_list_mutex. Hence reads can happen while holding any one of the two mutexes

◆ in_free_list

bool buf_page_t::in_free_list

◆ in_LRU_list

bool buf_page_t::in_LRU_list

node of the LRU list

TRUE if the page is in the LRU list; used in debugging

◆ in_page_hash

bool buf_page_t::in_page_hash

TRUE if in buf_pool->page_hash.

◆ in_zip_hash

bool buf_page_t::in_zip_hash

TRUE if in buf_pool->zip_hash.

◆ io_fix

buf_io_fix buf_page_t::io_fix

type of pending I/O operation.

◆ m_dblwr_id

uint16_t buf_page_t::m_dblwr_id {}

Double write instance ordinal value during writes.

This is used by IO completion (writes) to select the double write instance.

◆ newest_modification

lsn_t buf_page_t::newest_modification

TRUE if in buf_pool->free; when buf_pool->free_list_mutex is free, the following should hold: in_free_list == (state == BUF_BLOCK_NOT_USED)

◆ old

unsigned buf_page_t::old

true if the block is in the old blocks in buf_pool->LRU_old

◆ oldest_modification

lsn_t buf_page_t::oldest_modification

log sequence number of the youngest modification to this block, zero if not modified.

Protected by block mutex

◆ size

page_size_t buf_page_t::size

Page size.

◆ state

buf_page_state buf_page_t::state

Block state.

See also
buf_page_in_file

◆ zip

page_zip_des_t buf_page_t::zip

compressed page; zip.data (but not the data it points to) is protected by buf_pool->zip_mutex; state == BUF_BLOCK_ZIP_PAGE and zip.data == NULL means an active buf_pool->watch


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