MySQL 8.0.39
Source Code Documentation
buf0types.h File Reference

The database buffer pool global types for the directory. More...

#include "os0event.h"
#include "sync0rw.h"
#include "ut0byte.h"
#include "ut0mutex.h"
#include "ut0rnd.h"
#include "ut0ut.h"

Go to the source code of this file.

Classes

class  page_id_t
 Page identifier. More...
 

Typedefs

typedef byte buf_frame_t
 A buffer frame. More...
 
typedef ib_bpmutex_t BPageMutex
 
typedef ib_mutex_t BufListMutex
 
typedef ib_mutex_t FlushListMutex
 
typedef BPageMutex BufPoolZipMutex
 
typedef rw_lock_t BPageLock
 

Enumerations

enum  buf_flush_t : uint8_t { BUF_FLUSH_LRU = 0 , BUF_FLUSH_LIST , BUF_FLUSH_SINGLE_PAGE , BUF_FLUSH_N_TYPES }
 Flags for flush types. More...
 
enum  buf_remove_t { BUF_REMOVE_NONE , BUF_REMOVE_ALL_NO_WRITE , BUF_REMOVE_FLUSH_NO_WRITE , BUF_REMOVE_FLUSH_WRITE }
 Algorithm to remove the pages for a tablespace from the buffer pool. More...
 
enum  buf_io_fix : uint8_t { BUF_IO_NONE = 0 , BUF_IO_READ , BUF_IO_WRITE , BUF_IO_PIN }
 Flags for io_fix types. More...
 
enum  srv_checksum_algorithm_t {
  SRV_CHECKSUM_ALGORITHM_CRC32 , SRV_CHECKSUM_ALGORITHM_STRICT_CRC32 , SRV_CHECKSUM_ALGORITHM_INNODB , SRV_CHECKSUM_ALGORITHM_STRICT_INNODB ,
  SRV_CHECKSUM_ALGORITHM_NONE , SRV_CHECKSUM_ALGORITHM_STRICT_NONE
}
 Alternatives for srv_checksum_algorithm, which can be changed by setting innodb_checksum_algorithm. More...
 
enum  buf_pool_resize_status_code_t {
  BUF_POOL_RESIZE_COMPLETE = 0 , BUF_POOL_RESIZE_START = 1 , BUF_POOL_RESIZE_DISABLE_AHI = 2 , BUF_POOL_RESIZE_WITHDRAW_BLOCKS = 3 ,
  BUF_POOL_RESIZE_GLOBAL_LOCK = 4 , BUF_POOL_RESIZE_IN_PROGRESS = 5 , BUF_POOL_RESIZE_HASH = 6 , BUF_POOL_RESIZE_FAILED = 7
}
 Enumerate possible status codes during buffer pool resize. More...
 

Functions

bool is_checksum_strict (srv_checksum_algorithm_t algo)
 
bool is_checksum_strict (ulint algo)
 
std::ostream & operator<< (std::ostream &out, const page_id_t &page_id)
 Print the given page_id_t object. More...
 

Variables

constexpr uint32_t BUF_NO_CHECKSUM_MAGIC = 0xDEADBEEFUL
 Magic value to use instead of checksums when they are disabled. More...
 
std::atomic_uint32_t buf_pool_resize_status_code
 Buffer pool resize status code and progress are tracked using these atomic variables to ensure thread synchronization between innodb_buffer_pool_size_update (raising srv_buf_resize_event) and buf_resize_thread (handling srv_buf_resize_event) More...
 
std::atomic_uint32_t buf_pool_resize_status_progress
 
#define BUF_BUDDY_SIZES   (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
 Actual number of buddy sizes based on current page size. More...
 
#define BUF_BUDDY_HIGH   (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
 twice the maximum block size of the buddy system; the underlying memory is aligned by this amount: this must be equal to UNIV_PAGE_SIZE More...
 
constexpr uint32_t BUF_BUDDY_LOW_SHIFT = UNIV_ZIP_SIZE_SHIFT_MIN
 Parameters of binary buddy system for compressed pages (buf0buddy.h) More...
 
constexpr uint32_t BUF_BUDDY_LOW = (1U << BUF_BUDDY_LOW_SHIFT)
 Smallest buddy page size. More...
 
constexpr uint32_t BUF_BUDDY_SIZES_MAX
 Maximum number of buddy sizes based on the max page size. More...
 

Detailed Description

The database buffer pool global types for the directory.

Created 11/17/1995 Heikki Tuuri

Macro Definition Documentation

◆ BUF_BUDDY_HIGH

#define BUF_BUDDY_HIGH   (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)

twice the maximum block size of the buddy system; the underlying memory is aligned by this amount: this must be equal to UNIV_PAGE_SIZE

◆ BUF_BUDDY_SIZES

#define BUF_BUDDY_SIZES   (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)

Actual number of buddy sizes based on current page size.

Typedef Documentation

◆ BPageLock

◆ BPageMutex

typedef ib_bpmutex_t BPageMutex

◆ buf_frame_t

typedef byte buf_frame_t

A buffer frame.

See also
page_t

◆ BufListMutex

typedef ib_mutex_t BufListMutex

◆ BufPoolZipMutex

◆ FlushListMutex

typedef ib_mutex_t FlushListMutex

Enumeration Type Documentation

◆ buf_flush_t

enum buf_flush_t : uint8_t

Flags for flush types.

Enumerator
BUF_FLUSH_LRU 

Flush via the LRU list.

BUF_FLUSH_LIST 

Flush via the flush list of dirty blocks.

BUF_FLUSH_SINGLE_PAGE 

Flush via the LRU list but only a single page.

BUF_FLUSH_N_TYPES 

Index of last element + 1

◆ buf_io_fix

enum buf_io_fix : uint8_t

Flags for io_fix types.

Enumerator
BUF_IO_NONE 

no pending I/O

BUF_IO_READ 

read pending

BUF_IO_WRITE 

write pending

BUF_IO_PIN 

disallow relocation of block and its removal from the flush_list

◆ buf_pool_resize_status_code_t

Enumerate possible status codes during buffer pool resize.

This is used to identify the resize status using the corresponding code.

Enumerator
BUF_POOL_RESIZE_COMPLETE 

Resize completed or Resize not in progress.

BUF_POOL_RESIZE_START 

Resize started.

BUF_POOL_RESIZE_DISABLE_AHI 

Disabling Adaptive Hash Index.

BUF_POOL_RESIZE_WITHDRAW_BLOCKS 

Withdrawing blocks.

BUF_POOL_RESIZE_GLOBAL_LOCK 

Acquiring global lock.

BUF_POOL_RESIZE_IN_PROGRESS 

Resizing pool.

BUF_POOL_RESIZE_HASH 

Resizing hash.

BUF_POOL_RESIZE_FAILED 

Resizing failed.

◆ buf_remove_t

Algorithm to remove the pages for a tablespace from the buffer pool.

See buf_LRU_flush_or_remove_pages().

Enumerator
BUF_REMOVE_NONE 

Don't remove any pages.

BUF_REMOVE_ALL_NO_WRITE 

Remove all pages from the buffer pool, don't write or sync to disk.

BUF_REMOVE_FLUSH_NO_WRITE 

Remove only from the flush list, don't write or sync to disk.

BUF_REMOVE_FLUSH_WRITE 

Flush dirty pages to disk only don't remove from the buffer pool.

◆ srv_checksum_algorithm_t

Alternatives for srv_checksum_algorithm, which can be changed by setting innodb_checksum_algorithm.

Enumerator
SRV_CHECKSUM_ALGORITHM_CRC32 

Write crc32, allow crc32, innodb or none when reading.

SRV_CHECKSUM_ALGORITHM_STRICT_CRC32 

Write crc32, allow crc32 when reading.

SRV_CHECKSUM_ALGORITHM_INNODB 

Write innodb, allow crc32, innodb or none when reading.

SRV_CHECKSUM_ALGORITHM_STRICT_INNODB 

Write innodb, allow innodb when reading.

SRV_CHECKSUM_ALGORITHM_NONE 

Write none, allow crc32, innodb or none when reading.

SRV_CHECKSUM_ALGORITHM_STRICT_NONE 

Write none, allow none when reading.

Function Documentation

◆ is_checksum_strict() [1/2]

bool is_checksum_strict ( srv_checksum_algorithm_t  algo)
inline

◆ is_checksum_strict() [2/2]

bool is_checksum_strict ( ulint  algo)
inline

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const page_id_t page_id 
)

Print the given page_id_t object.

Parameters
[in,out]outthe output stream
[in]page_idthe page_id_t object to be printed
Returns
the output stream

Variable Documentation

◆ BUF_BUDDY_LOW

constexpr uint32_t BUF_BUDDY_LOW = (1U << BUF_BUDDY_LOW_SHIFT)
constexpr

Smallest buddy page size.

◆ BUF_BUDDY_LOW_SHIFT

constexpr uint32_t BUF_BUDDY_LOW_SHIFT = UNIV_ZIP_SIZE_SHIFT_MIN
constexpr

Parameters of binary buddy system for compressed pages (buf0buddy.h)

Zip shift value for the smallest page size

◆ BUF_BUDDY_SIZES_MAX

constexpr uint32_t BUF_BUDDY_SIZES_MAX
constexpr
Initial value:
=
constexpr uint32_t BUF_BUDDY_LOW_SHIFT
Parameters of binary buddy system for compressed pages (buf0buddy.h)
Definition: buf0types.h:180
constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_MAX
Maximum Page Size Shift (power of 2)
Definition: univ.i:312

Maximum number of buddy sizes based on the max page size.

◆ BUF_NO_CHECKSUM_MAGIC

constexpr uint32_t BUF_NO_CHECKSUM_MAGIC = 0xDEADBEEFUL
constexpr

Magic value to use instead of checksums when they are disabled.

◆ buf_pool_resize_status_code

std::atomic_uint32_t buf_pool_resize_status_code
extern

Buffer pool resize status code and progress are tracked using these atomic variables to ensure thread synchronization between innodb_buffer_pool_size_update (raising srv_buf_resize_event) and buf_resize_thread (handling srv_buf_resize_event)

Buffer pool resize status code and progress are tracked using these atomic variables to ensure thread synchronization between innodb_buffer_pool_size_update (raising srv_buf_resize_event) and buf_resize_thread (handling srv_buf_resize_event)

◆ buf_pool_resize_status_progress

std::atomic_uint32_t buf_pool_resize_status_progress
extern