Drizzled Public API Documentation

buf_page_struct Struct Reference

#include <buf0buf.h>

Public Attributes

page_zip_des_t zip
buf_page_thash
General fields

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

unsigned space:32
unsigned offset:32
unsigned state:3
unsigned flush_type:2
unsigned io_fix:2
unsigned buf_fix_count:19
unsigned buf_pool_index:6

Page flushing fields

All these are protected by buf_pool->mutex.

ib_uint64_t newest_modification
ib_uint64_t oldest_modification
 UT_LIST_NODE_T (buf_page_t) list

LRU replacement algorithm fields

These fields are protected by buf_pool->mutex only (not buf_pool->zip_mutex or buf_block_struct::mutex).

unsigned old:1
unsigned freed_page_clock:31
unsigned access_time:32
 UT_LIST_NODE_T (buf_page_t) LRU

Detailed Description

The common buffer control block structure

for compressed and uncompressed frames

Definition at line 1185 of file buf0buf.h.

Member Function Documentation

buf_page_struct::UT_LIST_NODE_T ( buf_page_t  )

based on state, this is a list node, protected either by buf_pool->mutex or by buf_pool->flush_list_mutex, in one of the following lists in buf_pool:

  • BUF_BLOCK_NOT_USED: free
  • BUF_BLOCK_FILE_PAGE: flush_list
  • BUF_BLOCK_ZIP_DIRTY: flush_list
  • BUF_BLOCK_ZIP_PAGE: zip_clean
  • BUF_BLOCK_ZIP_FREE: zip_free[]

If bpage is part of flush_list then the node pointers are covered by buf_pool->flush_list_mutex. Otherwise these pointers are protected by buf_pool->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.

buf_page_struct::UT_LIST_NODE_T ( buf_page_t  )

node of the LRU list

Member Data Documentation

unsigned buf_page_struct::access_time

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

Definition at line 1329 of file buf0buf.h.

Referenced by buf_pool_watch_set().

unsigned buf_page_struct::buf_pool_index

index number of the buffer pool that this block belongs to

Definition at line 1216 of file buf0buf.h.

Referenced by buf_page_init_for_read().

unsigned buf_page_struct::flush_type

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

See Also
enum buf_flush

Definition at line 1207 of file buf0buf.h.

unsigned buf_page_struct::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

Definition at line 1321 of file buf0buf.h.

buf_page_t* buf_page_struct::hash

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

Definition at line 1230 of file buf0buf.h.

unsigned buf_page_struct::io_fix

type of pending I/O operation; also protected by buf_pool->mutex

See Also
enum buf_io_fix

Definition at line 1211 of file buf0buf.h.

Referenced by buf_LRU_free_block().

ib_uint64_t buf_page_struct::newest_modification

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

Definition at line 1288 of file buf0buf.h.

Referenced by buf_pool_watch_set().

unsigned buf_page_struct::offset
unsigned buf_page_struct::old

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

Definition at line 1319 of file buf0buf.h.

Referenced by buf_LRU_make_block_young(), and buf_relocate().

ib_uint64_t buf_page_struct::oldest_modification

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

Definition at line 1294 of file buf0buf.h.

Referenced by buf_flush_ready_for_replace(), buf_flush_remove(), buf_LRU_free_block(), buf_pool_get_oldest_modification(), buf_pool_watch_set(), and srv_master_thread().

unsigned buf_page_struct::space
unsigned buf_page_struct::state

state of the control block; also protected by buf_pool->mutex. State transitions from BUF_BLOCK_READY_FOR_USE to BUF_BLOCK_MEMORY need not be protected by buf_page_get_mutex().

See Also
enum buf_page_state

Definition at line 1199 of file buf0buf.h.

Referenced by buf_LRU_free_block(), buf_page_get_gen(), buf_page_init_for_read(), and buf_pool_watch_set().

page_zip_des_t buf_page_struct::zip

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

Definition at line 1223 of file buf0buf.h.

Referenced by btr_cur_optimistic_insert(), buf_LRU_block_free_non_file_page(), buf_LRU_free_block(), buf_LRU_get_free_block(), buf_page_create(), buf_page_get_gen(), buf_page_get_zip(), buf_page_init_for_read(), buf_page_io_complete(), buf_pool_watch_is_sentinel(), buf_pool_watch_set(), buf_read_ahead_linear(), buf_read_page_low(), and buf_zip_decompress().


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