MySQL 8.0.40
Source Code Documentation
|
The database buffer pool high-level routines. More...
#include "buf0types.h"
#include "fil0fil.h"
#include "hash0hash.h"
#include "mtr0types.h"
#include "os0proc.h"
#include "page0types.h"
#include "srv0shutdown.h"
#include "srv0srv.h"
#include "univ.i"
#include "ut0byte.h"
#include "ut0rbt.h"
#include "buf/buf.h"
#include <ostream>
#include "buf0buf.ic"
Go to the source code of this file.
Classes | |
struct | buf_pool_info_t |
This structure defines information we will fetch from each buffer pool. More... | |
struct | buf_pools_list_size_t |
The occupied bytes of lists in all buffer pools. More... | |
class | copyable_atomic_t< T > |
class | buf_page_t |
class | buf_page_t::io_responsibility_t |
struct | btr_search_prefix_info_t |
Structure used by AHI to contain information on record prefixes to be considered in hash index subsystem. More... | |
struct | buf_block_t |
The buffer control block structure. More... | |
struct | buf_block_t::ahi_t |
Structure that holds most AHI-related fields. More... | |
class | HazardPointer |
A "Hazard Pointer" class used to iterate over page lists inside the buffer pool. More... | |
class | FlushHp |
Class implementing buf_pool->flush_list hazard pointer. More... | |
class | LRUHp |
Class implementing buf_pool->LRU hazard pointer. More... | |
class | LRUItr |
Special purpose iterators to be used when scanning the LRU list. More... | |
struct | buf_buddy_free_t |
Struct that is embedded in the free zip blocks. More... | |
struct | buf_pool_stat_t |
The buffer pool statistics structure. More... | |
struct | buf_buddy_stat_t |
Statistics of buddy blocks of a given size. More... | |
struct | buf_buddy_stat_t::snapshot_t |
struct | buf_pool_t |
The buffer pool structure. More... | |
struct | CheckInLRUList |
Functor to validate the LRU list. More... | |
struct | CheckInFreeList |
Functor to validate the LRU list. More... | |
struct | CheckUnzipLRUAndLRUList |
Macros | |
#define | BUF_POOL_WATCH_SIZE (srv_n_purge_threads + 1) |
Maximum number of concurrent buffer pool watches. More... | |
Typedefs | |
using | buf_fix_count_atomic_t = copyable_atomic_t< uint32_t > |
Enumerations | |
enum | buf_page_state : uint8_t { BUF_BLOCK_POOL_WATCH , BUF_BLOCK_ZIP_PAGE , BUF_BLOCK_ZIP_DIRTY , BUF_BLOCK_NOT_USED , BUF_BLOCK_READY_FOR_USE , BUF_BLOCK_FILE_PAGE , BUF_BLOCK_MEMORY , BUF_BLOCK_REMOVE_HASH } |
States of a control block. More... | |
enum | buf_page_print_flags { BUF_PAGE_PRINT_NO_CRASH = 1 , BUF_PAGE_PRINT_NO_FULL = 2 } |
Modes for buf_page_get_gen | |
enum class | Page_fetch { NORMAL , SCAN , IF_IN_POOL , PEEK_IF_IN_POOL , NO_LATCH , IF_IN_POOL_OR_WATCH , POSSIBLY_FREED } |
Modes for buf_page_get_known_nowait | |
enum class | Cache_hint { MAKE_YOUNG = 51 , KEEP_OLD = 52 } |
Functions | |
dberr_t | buf_pool_init (ulint total_size, ulint n_instances) |
Creates the buffer pool. More... | |
void | buf_pool_free_all () |
Frees the buffer pool at shutdown. More... | |
bool | buf_block_will_withdrawn (buf_pool_t *buf_pool, const buf_block_t *block) |
Determines if a block is intended to be withdrawn. More... | |
bool | buf_frame_will_withdrawn (buf_pool_t *buf_pool, const byte *ptr) |
Determines if a frame is intended to be withdrawn. More... | |
void | buf_resize_thread () |
This is the thread for resizing buffer pool. More... | |
void | buf_pool_update_madvise () |
Checks if innobase_should_madvise_buf_pool() value has changed since we've last check and if so, then updates buf_pool_should_madvise and calls madvise for all chunks in all srv_buf_pool_instances. More... | |
void | buf_pool_clear_hash_index (void) |
Clears the adaptive hash index on all pages in the buffer pool. More... | |
static ulint | buf_pool_get_curr_size (void) |
Gets the current size of buffer buf_pool in bytes. More... | |
static ulint | buf_pool_get_n_pages (void) |
Gets the current size of buffer buf_pool in frames. More... | |
lsn_t | buf_pool_get_oldest_modification_approx (void) |
Gets the smallest oldest_modification lsn among all of the earliest added pages in flush lists. More... | |
lsn_t | buf_pool_get_oldest_modification_lwm (void) |
Gets a safe low watermark for oldest_modification. More... | |
static buf_page_t * | buf_page_alloc_descriptor (void) |
Allocates a buf_page_t descriptor. More... | |
void | buf_page_free_descriptor (buf_page_t *bpage) |
Free a buf_page_t descriptor. More... | |
buf_block_t * | buf_block_alloc (buf_pool_t *buf_pool) |
Allocates a buffer block. More... | |
static void | buf_block_free (buf_block_t *block) |
Frees a buffer block which does not contain a file page. More... | |
static byte * | buf_frame_copy (byte *buf, const buf_frame_t *frame) |
Copies contents of a buffer frame to a given buffer. More... | |
bool | buf_page_optimistic_get (ulint rw_latch, buf_block_t *block, uint64_t modify_clock, Page_fetch fetch_mode, const char *file, ulint line, mtr_t *mtr) |
This is the general function used to get optimistic access to a database page. More... | |
bool | buf_page_get_known_nowait (ulint rw_latch, buf_block_t *block, Cache_hint hint, const char *file, ulint line, mtr_t *mtr) |
This is used to get access to a known database page, when no waiting can be done. More... | |
const buf_block_t * | buf_page_try_get (const page_id_t &page_id, ut::Location location, mtr_t *mtr) |
Given a tablespace id and page number tries to get that page. More... | |
buf_page_t * | buf_page_get_zip (const page_id_t &page_id, const page_size_t &page_size) |
Get read access to a compressed page (usually of type FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2). More... | |
buf_block_t * | buf_page_get_gen (const page_id_t &page_id, const page_size_t &page_size, ulint rw_latch, buf_block_t *guess, Page_fetch mode, ut::Location location, mtr_t *mtr, bool dirty_with_no_latch=false) |
This is the general function used to get access to a database page. More... | |
buf_block_t * | buf_page_get (const page_id_t &id, const page_size_t &size, ulint latch, ut::Location location, mtr_t *mtr) |
NOTE! The following macros should be used instead of buf_page_get_gen, to improve debugging. More... | |
buf_block_t * | buf_page_get_with_no_latch (const page_id_t &id, const page_size_t &size, ut::Location location, mtr_t *mtr) |
Use these macros to bufferfix a page with no latching. More... | |
buf_block_t * | buf_page_create (const page_id_t &page_id, const page_size_t &page_size, rw_lock_type_t rw_latch, mtr_t *mtr) |
Initializes a page to the buffer buf_pool. More... | |
static void | buf_page_release_zip (buf_page_t *bpage) |
Releases a compressed-only page acquired with buf_page_get_zip(). More... | |
static void | buf_page_release_latch (buf_block_t *block, ulint rw_latch) |
Releases a latch, if specified. More... | |
void | buf_page_make_young (buf_page_t *bpage) |
Moves a page to the start of the buffer pool LRU list. More... | |
void | buf_page_make_old (buf_page_t *bpage) |
Moved a page to the end of the buffer pool LRU list so that it can be flushed out at the earliest. More... | |
static bool | buf_page_peek (const page_id_t &page_id) |
Returns true if the page can be found in the buffer pool hash table. More... | |
buf_page_t * | buf_page_set_file_page_was_freed (const page_id_t &page_id) |
Sets file_page_was_freed true if the page is found in the buffer pool. More... | |
buf_page_t * | buf_page_reset_file_page_was_freed (const page_id_t &page_id) |
Sets file_page_was_freed false if the page is found in the buffer pool. More... | |
static ulint | buf_page_get_freed_page_clock (const buf_page_t *bpage) |
Reads the freed_page_clock of a buffer block. More... | |
static ulint | buf_block_get_freed_page_clock (const buf_block_t *block) |
Reads the freed_page_clock of a buffer block. More... | |
static bool | buf_page_peek_if_young (const buf_page_t *bpage) |
Tells, for heuristics, if a block is still close enough to the MRU end of the LRU list meaning that it is not in danger of getting evicted and also implying that it has been accessed recently. More... | |
static bool | buf_page_peek_if_too_old (const buf_page_t *bpage) |
Recommends a move of a block to the start of the LRU list if there is danger of dropping from the buffer pool. More... | |
static lsn_t | buf_page_get_newest_modification (const buf_page_t *bpage) |
Gets the youngest modification log sequence number for a frame. More... | |
static void | buf_block_modify_clock_inc (buf_block_t *block) |
Increment the modify clock. More... | |
static void | buf_block_buf_fix_inc_func (ut::Location location, buf_block_t *block) |
Increments the bufferfix count. More... | |
static ulint | buf_block_fix (buf_page_t *bpage) |
Increments the bufferfix count. More... | |
static ulint | buf_block_fix (buf_block_t *block) |
Increments the bufferfix count. More... | |
static ulint | buf_block_unfix (buf_page_t *bpage) |
Decrements the bufferfix count. More... | |
static ulint | buf_block_unfix (buf_block_t *block) |
Decrements the bufferfix count. More... | |
void | buf_read_page_handle_error (buf_page_t *bpage) |
Unfixes the page, unlatches the page, removes it from page_hash and removes it from LRU. More... | |
void | buf_block_buf_fix_inc (buf_block_t *b, ut::Location l) |
Increments the bufferfix count. More... | |
static void | buf_ptr_get_fsp_addr (const void *ptr, space_id_t *space, fil_addr_t *addr) |
Gets the space id, page offset, and byte offset within page of a pointer pointing to a buffer frame containing a file page. More... | |
buf_block_t * | buf_pool_contains_zip (buf_pool_t *buf_pool, const void *data) |
Finds a block in the buffer pool that points to a given compressed page. More... | |
static buf_frame_t * | buf_frame_align (byte *ptr) |
bool | buf_validate (void) |
Validates the buffer pool data structure. More... | |
void | buf_print (void) |
Prints info of the buffer pool data structure. More... | |
void | buf_page_print (const byte *read_buf, const page_size_t &page_size, ulint flags) |
Prints a page to stderr. More... | |
bool | buf_zip_decompress (buf_block_t *block, bool check) |
Decompress a block. More... | |
ulint | buf_get_latched_pages_number (void) |
Returns the number of latched pages in the buffer pool. More... | |
ulint | buf_get_n_pending_read_ios (void) |
Returns the number of pending buf pool read ios. More... | |
void | buf_print_io (FILE *file) |
Prints info of the buffer i/o. More... | |
void | buf_stats_get_pool_info (buf_pool_t *buf_pool, ulint pool_id, buf_pool_info_t *all_pool_info) |
Collect buffer pool stats information for a buffer pool. More... | |
double | buf_get_modified_ratio_pct (void) |
Return the ratio in percents of modified pages in the buffer pool / database pages in the buffer pool. More... | |
void | buf_refresh_io_stats_all () |
Refresh the statistics used to print per-second averages. More... | |
void | buf_must_be_all_freed (void) |
Assert that all file pages in the buffer are in a replaceable state. More... | |
size_t | buf_pool_pending_io_reads_count () |
Computes number of pending I/O read operations for the buffer pool. More... | |
size_t | buf_pool_pending_io_writes_count () |
Computes number of pending I/O write operations for the buffer pool. More... | |
void | buf_pool_wait_for_no_pending_io () |
Waits until there are no pending I/O operations for the buffer pool. More... | |
void | buf_pool_invalidate (void) |
Invalidates the file pages in the buffer pool when an archive recovery is completed. More... | |
static void | buf_block_dbg_add_level (buf_block_t *block, latch_level_t level) |
Adds latch level info for the rw-lock protecting the buffer frame. More... | |
static enum buf_page_state | buf_page_get_state (const buf_page_t *bpage) |
Gets the state of a block. More... | |
static enum buf_page_state | buf_block_get_state (const buf_block_t *block) |
Gets the state of a block. More... | |
static void | buf_page_set_state (buf_page_t *bpage, enum buf_page_state state) |
Sets the state of a block. More... | |
static void | buf_block_set_state (buf_block_t *block, enum buf_page_state state) |
Sets the state of a block. More... | |
static bool | buf_page_in_file (const buf_page_t *bpage) |
Determines if a block is mapped to a tablespace. More... | |
static bool | buf_page_belongs_to_unzip_LRU (const buf_page_t *bpage) |
Determines if a block should be on unzip_LRU list. More... | |
static BPageMutex * | buf_page_get_mutex (const buf_page_t *bpage) |
Gets the mutex of a block. More... | |
static buf_flush_t | buf_page_get_flush_type (const buf_page_t *bpage) |
Get the flush type of a page. More... | |
static void | buf_page_set_flush_type (buf_page_t *bpage, buf_flush_t flush_type) |
Set the flush type of a page. More... | |
static void | buf_block_set_file_page (buf_block_t *block, const page_id_t &page_id) |
Map a block to a file page. More... | |
static enum buf_io_fix | buf_page_get_io_fix (const buf_page_t *bpage) |
Gets the io_fix state of a block. More... | |
static enum buf_io_fix | buf_block_get_io_fix (const buf_block_t *block) |
Gets the io_fix state of a block. More... | |
static void | buf_page_set_io_fix (buf_page_t *bpage, enum buf_io_fix io_fix) |
Sets the io_fix state of a block. More... | |
static void | buf_block_set_io_fix (buf_block_t *block, enum buf_io_fix io_fix) |
Sets the io_fix state of a block. More... | |
static void | buf_page_set_sticky (buf_page_t *bpage) |
Makes a block sticky. More... | |
static void | buf_page_unset_sticky (buf_page_t *bpage) |
Removes stickiness of a block. More... | |
static bool | buf_page_can_relocate (const buf_page_t *bpage) |
Determine if a buffer block can be relocated in memory. More... | |
static bool | buf_page_is_old (const buf_page_t *bpage) |
Determine if a block has been flagged old. More... | |
static void | buf_page_set_old (buf_page_t *bpage, bool old) |
Flag a block old. More... | |
static std::chrono::steady_clock::time_point | buf_page_is_accessed (const buf_page_t *bpage) |
Determine the time of first access of a block in the buffer pool. More... | |
static void | buf_page_set_accessed (buf_page_t *bpage) |
Flag a block accessed. More... | |
static buf_block_t * | buf_page_get_block (buf_page_t *bpage) |
Gets the buf_block_t handle of a buffered file block if an uncompressed page frame exists, or NULL. More... | |
static buf_frame_t * | buf_block_get_frame (const buf_block_t *block) |
Gets a pointer to the memory frame of a block. More... | |
buf_block_t * | buf_block_from_ahi (const byte *ptr) |
Get a buffer block from an adaptive hash index pointer. More... | |
bool | buf_is_block_in_instance (const buf_pool_t *buf_pool, const buf_block_t *ptr) |
Find out if a block pointer points into one of currently used chunks of the buffer pool. More... | |
buf_page_t * | buf_page_init_for_read (ulint mode, const page_id_t &page_id, const page_size_t &page_size, bool unzip) |
Inits a page for read to the buffer buf_pool. More... | |
bool | buf_page_io_complete (buf_page_t *bpage, bool evict) |
Completes an asynchronous read or write request of a file page to or from the buffer pool. More... | |
bool | buf_page_free_stale (buf_pool_t *buf_pool, buf_page_t *bpage) noexcept |
Free a stale page. More... | |
bool | buf_page_free_stale (buf_pool_t *buf_pool, buf_page_t *bpage, rw_lock_t *hash_lock) noexcept |
Free a stale page. More... | |
void | buf_page_free_stale_during_write (buf_page_t *bpage, bool owns_sx_lock=false) noexcept |
Free a stale page that is being written. More... | |
static ulint | buf_pool_index (const buf_pool_t *buf_pool) |
Calculates the index of a buffer pool to the buf_pool[] array. More... | |
static buf_pool_t * | buf_pool_from_bpage (const buf_page_t *bpage) |
Returns the buffer pool instance given a page instance. More... | |
static buf_pool_t * | buf_pool_from_block (const buf_block_t *block) |
Returns the buffer pool instance given a block instance. More... | |
static buf_pool_t * | buf_pool_get (const page_id_t &page_id) |
Returns the buffer pool instance given a page id. More... | |
static buf_pool_t * | buf_pool_from_array (ulint index) |
Returns the buffer pool instance given its array index. More... | |
static buf_page_t * | buf_page_hash_get_low (buf_pool_t *buf_pool, const page_id_t &page_id) |
Returns the control block of a file page, NULL if not found. More... | |
static buf_page_t * | buf_page_hash_get_locked (buf_pool_t *buf_pool, const page_id_t &page_id, rw_lock_t **lock, ulint lock_mode, bool watch=false) |
Returns the control block of a file page, NULL if not found. More... | |
static buf_block_t * | buf_block_hash_get_locked (buf_pool_t *buf_pool, const page_id_t &page_id, rw_lock_t **lock, ulint lock_mode) |
Returns the control block of a file page, NULL if not found. More... | |
buf_page_t * | buf_page_hash_get_s_locked (buf_pool_t *b, const page_id_t &page_id, rw_lock_t **l) |
buf_page_t * | buf_page_hash_get_x_locked (buf_pool_t *b, const page_id_t &page_id, rw_lock_t **l) |
buf_page_t * | buf_page_hash_get (buf_pool_t *b, const page_id_t &page_id) |
buf_page_t * | buf_page_get_also_watch (buf_pool_t *b, const page_id_t &page_id) |
buf_block_t * | buf_block_hash_get_s_locked (buf_pool_t *b, const page_id_t &page_id, rw_lock_t **l) |
buf_block_t * | buf_block_hash_get_x_locked (buf_pool_t *b, const page_id_t &page_id, rw_lock_t **l) |
buf_block_t * | buf_block_hash_get (buf_pool_t *b, const page_id_t &page_id) |
ulint | buf_get_free_list_len (void) |
Gets the current length of the free list of buffer blocks. More... | |
bool | buf_pool_watch_is_sentinel (const buf_pool_t *buf_pool, const buf_page_t *bpage) |
Determine if a block is a sentinel for a buffer pool watch. More... | |
void | buf_pool_watch_unset (const page_id_t &page_id) |
Stop watching if the page has been read in. More... | |
bool | buf_pool_watch_occurred (const page_id_t &page_id) |
Check if the page has been read in. More... | |
void | buf_get_total_list_len (ulint *LRU_len, ulint *free_len, ulint *flush_list_len) |
Get total buffer pool statistics. More... | |
void | buf_get_total_list_size_in_bytes (buf_pools_list_size_t *buf_pools_list_size) |
Get total list size in bytes from all buffer pools. More... | |
void | buf_get_total_stat (buf_pool_stat_t *tot_stat) |
Get total buffer pool statistics. More... | |
static buf_block_t * | buf_get_nth_chunk_block (const buf_pool_t *buf_pool, ulint n, ulint *chunk_size) |
Get the nth chunk's buffer block in the specified buffer pool. More... | |
static ulint | buf_pool_size_align (ulint size) |
Calculate aligned buffer pool size based on srv_buf_pool_chunk_unit, if needed. More... | |
ulonglong | buf_pool_adjust_chunk_unit (ulonglong size) |
Adjust the proposed chunk unit size so that it satisfies all invariants. More... | |
void | buf_flush_update_zip_checksum (buf_frame_t *page, ulint size, lsn_t lsn, bool skip_lsn_check) |
Calculate the checksum of a page from compressed table and update the page. More... | |
static ulint | buf_get_withdraw_depth (buf_pool_t *buf_pool) |
Return how many more pages must be added to the withdraw list to reach the withdraw target of the currently ongoing buffer pool resize. More... | |
bool | buf_block_state_valid (buf_block_t *block) |
Check if a buf_block_t object is in a valid state. More... | |
std::ostream & | operator<< (std::ostream &out, const buf_pool_t &buf_pool) |
Print the given buf_pool_t object. More... | |
void | buf_page_prepare_for_free (buf_page_t *bpage) noexcept |
Prepare a page before adding to the free list. More... | |
page_zip_des_t * | buf_block_get_page_zip (buf_block_t *block) noexcept |
Gets the compressed page descriptor corresponding to an uncompressed page if applicable. More... | |
const page_zip_des_t * | buf_block_get_page_zip (const buf_block_t *block) noexcept |
Gets the compressed page descriptor corresponding to an uncompressed page if applicable. More... | |
void | buf_block_reset_page_type_on_mismatch (buf_block_t &block, page_type_t type, mtr_t &mtr) |
Verify the page contained by the block. More... | |
static uint64_t | buf_pool_hash_zip_frame (void *ptr) |
Compute the hash value for blocks in buf_pool->zip_hash. More... | |
static uint64_t | buf_pool_hash_zip (buf_block_t *b) |
Variables | |
constexpr ulint | MAX_BUFFER_POOLS_BITS = 6 |
Number of bits to representing a buffer pool ID. More... | |
constexpr ulint | MAX_BUFFER_POOLS = (1 << MAX_BUFFER_POOLS_BITS) |
The maximum number of buffer pools that can be defined. More... | |
constexpr ulint | MAX_PAGE_HASH_LOCKS = 1024 |
The maximum number of page_hash locks. More... | |
buf_pool_t * | buf_pool_ptr |
The buffer pools of the database. More... | |
constexpr uint32_t | BUF_PAGE_STATE_BITS = 3 |
The common buffer control block structure for compressed and uncompressed frames. More... | |
Accessors for buffer pool mutexes | |
Use these instead of accessing buffer pool mutexes directly. | |
#define | buf_flush_list_mutex_own(b) mutex_own(&(b)->flush_list_mutex) |
Test if flush list mutex is owned. More... | |
#define | buf_flush_list_mutex_enter(b) |
Acquire the flush list mutex. More... | |
#define | buf_flush_list_mutex_exit(b) |
Release the flush list mutex. More... | |
#define | buf_page_mutex_enter(b) |
Acquire the block->mutex. More... | |
#define | buf_page_mutex_exit(b) |
Release the block->mutex. More... | |
rw_lock_t * | buf_page_hash_lock_get (const buf_pool_t *buf_pool, const page_id_t page_id) |
Get appropriate page_hash_lock. More... | |
rw_lock_t * | buf_page_hash_lock_s_confirm (rw_lock_t *hash_lock, const buf_pool_t *buf_pool, const page_id_t page_id) |
If not appropriate page_hash_lock, relock until appropriate. More... | |
rw_lock_t * | buf_page_hash_lock_x_confirm (rw_lock_t *hash_lock, buf_pool_t *buf_pool, const page_id_t &page_id) |
ulint | buf_page_hash_lock_held_s (const buf_pool_t *buf_pool, const buf_page_t *bpage) |
Test if page_hash lock is held in s-mode. More... | |
ulint | buf_page_hash_lock_held_x (const buf_pool_t *buf_pool, const buf_page_t *bpage) |
Test if page_hash lock is held in x-mode. More... | |
bool | buf_page_hash_lock_held_s_or_x (const buf_pool_t *buf_pool, const buf_page_t *bpage) |
Test if page_hash lock is held in x or s-mode. More... | |
bool | buf_block_hash_lock_held_s (const buf_pool_t *buf_pool, const buf_block_t *block) |
bool | buf_block_hash_lock_held_x (const buf_pool_t *buf_pool, const buf_block_t *block) |
bool | buf_block_hash_lock_held_s_or_x (const buf_pool_t *buf_pool, const buf_block_t *block) |
The database buffer pool high-level routines.
Created 11/5/1995 Heikki Tuuri
#define buf_flush_list_mutex_enter | ( | b | ) |
Acquire the flush list mutex.
#define buf_flush_list_mutex_exit | ( | b | ) |
Release the flush list mutex.
#define buf_flush_list_mutex_own | ( | b | ) | mutex_own(&(b)->flush_list_mutex) |
Test if flush list mutex is owned.
#define buf_page_mutex_enter | ( | b | ) |
Acquire the block->mutex.
#define buf_page_mutex_exit | ( | b | ) |
Release the block->mutex.
#define BUF_POOL_WATCH_SIZE (srv_n_purge_threads + 1) |
Maximum number of concurrent buffer pool watches.
using buf_fix_count_atomic_t = copyable_atomic_t<uint32_t> |
enum buf_page_print_flags |
enum buf_page_state : uint8_t |
States of a control block.
The enumeration values must be 0..7.
|
strong |
|
strong |
buf_block_t * buf_block_alloc | ( | buf_pool_t * | buf_pool | ) |
Allocates a buffer block.
buf_pool | in/out: buffer pool instance, or NULL for round-robin selection of the buffer pool |
|
inline |
Increments the bufferfix count.
[in,out] | b | block to bufferfix |
[in] | l | location where requested |
|
inlinestatic |
Increments the bufferfix count.
[in] | location | location |
[in,out] | block | block to bufferfix |
|
inlinestatic |
Adds latch level info for the rw-lock protecting the buffer frame.
This should be called in the debug version after a successful latching of a page if we know the latching order level of the acquired latch.
[in] | block | buffer page where we have acquired latch |
[in] | level | latching order level |
|
inlinestatic |
Increments the bufferfix count.
[in,out] | block | block to bufferfix |
|
inlinestatic |
Increments the bufferfix count.
[in,out] | bpage | block to bufferfix |
|
inlinestatic |
Frees a buffer block which does not contain a file page.
in, own: block to be freed
buf_block_t * buf_block_from_ahi | ( | const byte * | ptr | ) |
Get a buffer block from an adaptive hash index pointer.
This function does not return if the block is not identified.
[in] | ptr | pointer to within a page frame |
|
inlinestatic |
Gets a pointer to the memory frame of a block.
|
inlinestatic |
Reads the freed_page_clock of a buffer block.
|
inlinestatic |
Gets the io_fix state of a block.
|
inlinenoexcept |
Gets the compressed page descriptor corresponding to an uncompressed page if applicable.
[in] | block | Get the zip descriptor for this block. |
|
inlinenoexcept |
Gets the compressed page descriptor corresponding to an uncompressed page if applicable.
Const version.
[in] | block | Get the zip descriptor for this block. |
|
inlinestatic |
Gets the state of a block.
|
inline |
|
inlinestatic |
Returns the control block of a file page, NULL if not found.
If the block is found and lock is not NULL then the appropriate page_hash lock is acquired in the specified lock mode. Otherwise, mode value is ignored. It is up to the caller to release the lock. If the block is found and the lock is NULL then the page_hash lock is released by this function.
[in] | buf_pool | buffer pool instance |
[in] | page_id | page id |
[in,out] | lock | lock of the page hash acquired if bpage is found, NULL otherwise. If NULL is passed then the hash_lock is released by this function. |
[in] | lock_mode | RW_LOCK_X or RW_LOCK_S. Ignored if lock == NULL |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Increment the modify clock.
The caller must (1) own the buf_pool->mutex and block bufferfix count has to be zero, (2) own X or SX latch on the block->lock, or (3) operate on a thread-private temporary table
[in,out] | block | buffer block |
|
inline |
Verify the page contained by the block.
If there is page type mismatch then reset it to expected page type. Data files created before MySQL 5.7 GA may contain garbage in the FIL_PAGE_TYPE field.
[in,out] | block | block that may possibly have invalid FIL_PAGE_TYPE |
[in] | type | Expected page type |
[in,out] | mtr | Mini-transaction |
|
inlinestatic |
Map a block to a file page.
[in,out] | block | pointer to control block |
[in] | page_id | page id |
|
inlinestatic |
Sets the io_fix state of a block.
[in,out] | block | control block |
[in] | io_fix | io_fix state |
|
inlinestatic |
Sets the state of a block.
[in,out] | block | pointer to control block |
[in] | state | state |
|
inline |
Check if a buf_block_t object is in a valid state.
block | buffer block |
|
inlinestatic |
Decrements the bufferfix count.
[in,out] | block | block to bufferunfix |
|
inlinestatic |
Decrements the bufferfix count.
[in,out] | bpage | block to bufferunfix |
bool buf_block_will_withdrawn | ( | buf_pool_t * | buf_pool, |
const buf_block_t * | block | ||
) |
Determines if a block is intended to be withdrawn.
The caller must ensure that there was a sufficient memory barrier to read curr_size and old_size.
[in] | buf_pool | buffer pool instance |
[in] | block | pointer to control block |
true | if will be withdrawn |
void buf_flush_update_zip_checksum | ( | buf_frame_t * | page, |
ulint | size, | ||
lsn_t | lsn, | ||
bool | skip_lsn_check | ||
) |
Calculate the checksum of a page from compressed table and update the page.
[in,out] | page | page to update |
[in] | size | compressed page size |
[in] | lsn | LSN to stamp on the page |
[in] | skip_lsn_check | true to skip check for lsn (in DEBUG) |
|
inlinestatic |
|
inlinestatic |
Copies contents of a buffer frame to a given buffer.
[in] | buf | buffer to copy to |
[in] | frame | buffer frame |
bool buf_frame_will_withdrawn | ( | buf_pool_t * | buf_pool, |
const byte * | ptr | ||
) |
Determines if a frame is intended to be withdrawn.
The caller must ensure that there was a sufficient memory barrier to read curr_size and old_size.
[in] | buf_pool | buffer pool instance |
[in] | ptr | pointer to a frame |
true | if will be withdrawn |
ulint buf_get_free_list_len | ( | void | ) |
Gets the current length of the free list of buffer blocks.
ulint buf_get_latched_pages_number | ( | void | ) |
Returns the number of latched pages in the buffer pool.
Returns the number of latched pages in the buffer pool.
double buf_get_modified_ratio_pct | ( | void | ) |
Return the ratio in percents of modified pages in the buffer pool / database pages in the buffer pool.
Return the ratio in percents of modified pages in the buffer pool / database pages in the buffer pool.
ulint buf_get_n_pending_read_ios | ( | void | ) |
Returns the number of pending buf pool read ios.
|
inlinestatic |
Get the nth chunk's buffer block in the specified buffer pool.
[in] | buf_pool | buffer pool instance |
[in] | n | nth chunk in the buffer pool |
[in] | chunk_size | chunk_size |
Get total buffer pool statistics.
[out] | LRU_len | Length of all lru lists |
[out] | free_len | Length of all free lists |
[out] | flush_list_len | Length of all flush lists |
void buf_get_total_list_size_in_bytes | ( | buf_pools_list_size_t * | buf_pools_list_size | ) |
Get total list size in bytes from all buffer pools.
out: list sizes in all buffer pools
buf_pools_list_size | out: list sizes in all buffer pools |
void buf_get_total_stat | ( | buf_pool_stat_t * | tot_stat | ) |
Get total buffer pool statistics.
out: buffer pool stats
tot_stat | out: buffer pool stats |
|
inlinestatic |
Return how many more pages must be added to the withdraw list to reach the withdraw target of the currently ongoing buffer pool resize.
[in] | buf_pool | buffer pool instance |
bool buf_is_block_in_instance | ( | const buf_pool_t * | buf_pool, |
const buf_block_t * | ptr | ||
) |
Find out if a block pointer points into one of currently used chunks of the buffer pool.
This is useful if you stored the pointer some time ago, and want to dereference it now, and are afraid that buffer pool resize could free the memory pointed by it. Thus calling this function requires holding at least one of the latches which prevent freeing memory from buffer pool for the duration of the call and until you pin the block in some other way, as otherwise the result of this function might be obsolete by the time you dereference the block (an s-latch on buf_page_hash_lock_get for any hash cell is enough).
buf_pool | The buffer pool instance to search in. |
ptr | A pointer which you want to check. This function will not dereference it. |
block
points inside one of the chunks of the buf_pool
void buf_must_be_all_freed | ( | void | ) |
Assert that all file pages in the buffer are in a replaceable state.
Assert that all file pages in the buffer are in a replaceable state.
|
inlinestatic |
Allocates a buf_page_t descriptor.
This function must succeed. In case of failure we assert in this function.
|
inlinestatic |
Determines if a block should be on unzip_LRU list.
|
inlinestatic |
Determine if a buffer block can be relocated in memory.
The block can be dirty, but it must not be I/O-fixed or bufferfixed. control block being relocated
buf_block_t * buf_page_create | ( | const page_id_t & | page_id, |
const page_size_t & | page_size, | ||
rw_lock_type_t | rw_latch, | ||
mtr_t * | mtr | ||
) |
Initializes a page to the buffer buf_pool.
The page is usually not read from a file even if it cannot be found in the buffer buf_pool. This is one of the functions which perform to a block a state transition NOT_USED => FILE_PAGE (the other is buf_page_get_gen). The page is latched by passed mtr.
[in] | page_id | Page id |
[in] | page_size | Page size |
[in] | rw_latch | RW_SX_LATCH, RW_X_LATCH |
[in] | mtr | Mini-transaction |
void buf_page_free_descriptor | ( | buf_page_t * | bpage | ) |
Free a buf_page_t descriptor.
[in] | bpage | bpage descriptor to free |
|
noexcept |
Free a stale page.
Caller must hold the LRU mutex. Upon successful page free the LRU mutex will be released.
[in,out] | buf_pool | Buffer pool the page belongs to. |
[in,out] | bpage | Page to free. |
|
noexcept |
Free a stale page.
Caller must be holding the hash_lock in S mode if hash_lock parameter is not nullptr. The hash lock will be released upon return always. Caller must hold the LRU mutex if and only if the hash_lock parameter is nullptr. Upon unsuccessful page free the LRU mutex will not be released if hash_lock is nullptr.
[in,out] | buf_pool | Buffer pool the page belongs to. |
[in,out] | bpage | Page to free. |
[in,out] | hash_lock | Hash lock covering the fetch from the hash table if latched in S mode. nullptr otherwise. |
|
noexcept |
Free a stale page that is being written.
The caller must be within the page's write code path.
[in,out] | bpage | Page to free. |
[in] | owns_sx_lock | SX lock on block->lock is set. |
|
inline |
NOTE! The following macros should be used instead of buf_page_get_gen, to improve debugging.
Only values RW_S_LATCH and RW_X_LATCH are allowed in LA!
|
inline |
|
inlinestatic |
Gets the buf_block_t handle of a buffered file block if an uncompressed page frame exists, or NULL.
page frame exists, or NULL. The caller must hold either the appropriate hash lock in any mode, either the LRU list mutex. Note: even though bpage is not declared a const we don't update its value. It is safe to make this pure.
[in] | bpage | control block, or NULL |
|
inlinestatic |
Get the flush type of a page.
|
inlinestatic |
Reads the freed_page_clock of a buffer block.
buf_block_t * buf_page_get_gen | ( | const page_id_t & | page_id, |
const page_size_t & | page_size, | ||
ulint | rw_latch, | ||
buf_block_t * | guess, | ||
Page_fetch | mode, | ||
ut::Location | location, | ||
mtr_t * | mtr, | ||
bool | dirty_with_no_latch = false |
||
) |
This is the general function used to get access to a database page.
[in] | page_id | Page id |
[in] | page_size | Page size |
[in] | rw_latch | RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH |
[in] | guess | Guessed block or NULL |
[in] | mode | Fetch mode. |
[in] | location | Location from where this method was called. |
[in] | mtr | Mini-transaction |
[in] | dirty_with_no_latch | Mark page as dirty even if page is being pinned without any latch |
|
inlinestatic |
Gets the io_fix state of a block.
bool buf_page_get_known_nowait | ( | ulint | rw_latch, |
buf_block_t * | block, | ||
Cache_hint | hint, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
This is used to get access to a known database page, when no waiting can be done.
[in] | rw_latch | RW_S_LATCH or RW_X_LATCH. |
[in] | block | The known page. |
[in] | hint | Cache_hint::MAKE_YOUNG or Cache_hint::KEEP_OLD |
[in] | file | File name from where it was called. |
[in] | line | Line from where it was called. |
[in,out] | mtr | Mini-transaction covering the fetch |
|
inlinestatic |
Gets the mutex of a block.
|
inlinestatic |
Gets the youngest modification log sequence number for a frame.
Returns zero if not file page or no modification occurred yet.
|
inlinestatic |
Gets the state of a block.
|
inline |
Use these macros to bufferfix a page with no latching.
Remember not to read the contents of the page unless you know it is safe. Do not modify the contents of the page! We have separated this case, because it is error-prone programming not to set a latch, and it should be used with care.
buf_page_t * buf_page_get_zip | ( | const page_id_t & | page_id, |
const page_size_t & | page_size | ||
) |
Get read access to a compressed page (usually of type FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2).
The page must be released with buf_page_release_zip(). NOTE: the page is not protected by any latch. Mutual exclusion has to be implemented at a higher level. In other words, all possible accesses to a given page through this function must be protected by the same set of mutexes or latches.
[in] | page_id | page id |
[in] | page_size | page size |
|
inline |
|
inlinestatic |
Returns the control block of a file page, NULL if not found.
If the block is found and lock is not NULL then the appropriate page_hash lock is acquired in the specified lock mode. Otherwise, mode value is ignored. It is up to the caller to release the lock. If the block is found and the lock is NULL then the page_hash lock is released by this function.
[in] | buf_pool | buffer pool instance |
[in] | page_id | page id |
[in,out] | lock | lock of the page hash acquired if bpage is found, NULL otherwise. If NULL is passed then the hash_lock is released by this function. |
[in] | lock_mode | RW_LOCK_X or RW_LOCK_S. Ignored if lock == NULL |
[in] | watch | if true, return watch sentinel also. |
|
inlinestatic |
Returns the control block of a file page, NULL if not found.
[in] | buf_pool | buffer pool instance |
[in] | page_id | page id |
|
inline |
|
inline |
|
inline |
Get appropriate page_hash_lock.
|
inline |
Test if page_hash lock is held in s-mode.
|
inline |
Test if page_hash lock is held in x or s-mode.
|
inline |
Test if page_hash lock is held in x-mode.
|
inline |
If not appropriate page_hash_lock, relock until appropriate.
|
inline |
|
inlinestatic |
Determines if a block is mapped to a tablespace.
buf_page_t * buf_page_init_for_read | ( | ulint | mode, |
const page_id_t & | page_id, | ||
const page_size_t & | page_size, | ||
bool | unzip | ||
) |
Inits a page for read to the buffer buf_pool.
If the page is (1) already in buf_pool, or (2) if we specify to read only ibuf pages and the page is not an ibuf page, or (3) if the space is deleted or being deleted, then this function does nothing. Sets the io_fix flag to BUF_IO_READ and sets a non-recursive exclusive lock on the buffer frame. The io-handler must take care that the flag is cleared and the lock released later.
[in] | mode | BUF_READ_IBUF_PAGES_ONLY, ... |
[in] | page_id | page id |
[in] | page_size | page size |
[in] | unzip | true=request uncompressed page |
bool buf_page_io_complete | ( | buf_page_t * | bpage, |
bool | evict | ||
) |
Completes an asynchronous read or write request of a file page to or from the buffer pool.
[in] | bpage | pointer to the block in question |
[in] | evict | whether or not to evict the page from LRU list |
|
inlinestatic |
Determine the time of first access of a block in the buffer pool.
|
inlinestatic |
Determine if a block has been flagged old.
[in] | bpage | control block |
void buf_page_make_old | ( | buf_page_t * | bpage | ) |
Moved a page to the end of the buffer pool LRU list so that it can be flushed out at the earliest.
[in] | bpage | buffer block of a file page |
void buf_page_make_young | ( | buf_page_t * | bpage | ) |
Moves a page to the start of the buffer pool LRU list.
This high-level function can be used to prevent an important page from slipping out of the buffer pool.
[in,out] | bpage | buffer block of a file page |
bool buf_page_optimistic_get | ( | ulint | rw_latch, |
buf_block_t * | block, | ||
uint64_t | modify_clock, | ||
Page_fetch | fetch_mode, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
This is the general function used to get optimistic access to a database page.
[in] | rw_latch | RW_S_LATCH, RW_X_LATCH |
[in,out] | block | Guessed block |
[in] | modify_clock | Modify clock value |
[in] | fetch_mode | Fetch mode |
[in] | file | File name |
[in] | line | Line where called |
[in,out] | mtr | Mini-transaction |
|
inlinestatic |
Returns true if the page can be found in the buffer pool hash table.
NOTE that it is possible that the page is not yet read from disk, though.
[in] | page_id | page id |
|
inlinestatic |
Recommends a move of a block to the start of the LRU list if there is danger of dropping from the buffer pool.
NOTE: does not reserve the LRU list mutex.
[in] | bpage | block to make younger |
|
inlinestatic |
Tells, for heuristics, if a block is still close enough to the MRU end of the LRU list meaning that it is not in danger of getting evicted and also implying that it has been accessed recently.
The page must be either buffer-fixed, either its page hash must be locked.
[in] | bpage | block |
|
inlinenoexcept |
Prepare a page before adding to the free list.
[in,out] | bpage | Buffer page to prepare for freeing. |
void buf_page_print | ( | const byte * | read_buf, |
const page_size_t & | page_size, | ||
ulint | flags | ||
) |
Prints a page to stderr.
[in] | read_buf | a database page |
[in] | page_size | page size |
[in] | flags | 0 or BUF_PAGE_PRINT_NO_CRASH or BUF_PAGE_PRINT_NO_FULL |
|
inlinestatic |
Releases a latch, if specified.
[in] | block | buffer block |
[in] | rw_latch | RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH |
|
inlinestatic |
Releases a compressed-only page acquired with buf_page_get_zip().
in: buffer block
buf_page_t * buf_page_reset_file_page_was_freed | ( | const page_id_t & | page_id | ) |
Sets file_page_was_freed false if the page is found in the buffer pool.
This function should be called when we free a file page and want the debug version to check that it is not accessed any more unless reallocated.
[in] | page_id | page id |
|
inlinestatic |
Flag a block accessed.
in/out: control block
buf_page_t * buf_page_set_file_page_was_freed | ( | const page_id_t & | page_id | ) |
Sets file_page_was_freed true if the page is found in the buffer pool.
This function should be called when we free a file page and want the debug version to check that it is not accessed any more unless reallocated.
[in] | page_id | page id |
|
inlinestatic |
Set the flush type of a page.
[in] | bpage | buffer page |
[in] | flush_type | flush type |
|
inlinestatic |
Sets the io_fix state of a block.
[in,out] | bpage | control block |
[in] | io_fix | io_fix state |
|
inlinestatic |
Flag a block old.
[in,out] | bpage | control block |
[in] | old | old |
|
inlinestatic |
Sets the state of a block.
[in,out] | bpage | pointer to control block |
[in] | state | state |
|
inlinestatic |
Makes a block sticky.
A sticky block implies that even after we release the buf_pool->LRU_list_mutex and the block->mutex: it cannot be removed from the flush_list the block descriptor cannot be relocated it cannot be removed from the LRU list Note that: the block can still change its position in the LRU list the next and previous pointers can change.
[in,out] | bpage | control block |
const buf_block_t * buf_page_try_get | ( | const page_id_t & | page_id, |
ut::Location | location, | ||
mtr_t * | mtr | ||
) |
Given a tablespace id and page number tries to get that page.
If the page is not in the buffer pool it is not loaded and NULL is returned. Suitable for using when holding the lock_sys latches (as it avoids deadlock).
[in] | page_id | page Id |
[in] | location | Location where called |
[in] | mtr | Mini-transaction |
|
inlinestatic |
Removes stickiness of a block.
in/out: control block
Adjust the proposed chunk unit size so that it satisfies all invariants.
[in] | size | proposed size of buffer pool chunk unit in bytes |
void buf_pool_clear_hash_index | ( | void | ) |
Clears the adaptive hash index on all pages in the buffer pool.
buf_block_t * buf_pool_contains_zip | ( | buf_pool_t * | buf_pool, |
const void * | data | ||
) |
Finds a block in the buffer pool that points to a given compressed page.
Used only to confirm that buffer pool does not contain a given pointer, thus protected by zip_free_mutex.
[in] | buf_pool | buffer pool instance |
[in] | data | pointer to compressed page |
void buf_pool_free_all | ( | ) |
Frees the buffer pool at shutdown.
This must not be invoked before freeing all mutexes.
Frees the buffer pool at shutdown.
|
inlinestatic |
Returns the buffer pool instance given its array index.
|
inlinestatic |
Returns the buffer pool instance given a block instance.
|
inlinestatic |
Returns the buffer pool instance given a page instance.
|
inlinestatic |
Returns the buffer pool instance given a page id.
[in] | page_id | page id |
|
inlinestatic |
Gets the current size of buffer buf_pool in bytes.
|
inlinestatic |
Gets the current size of buffer buf_pool in frames.
lsn_t buf_pool_get_oldest_modification_approx | ( | void | ) |
Gets the smallest oldest_modification lsn among all of the earliest added pages in flush lists.
In other words - takes the last dirty page from each flush list, and calculates minimum oldest_modification among all of them. Does not acquire global lock for the whole process, so the result might come from inconsistent view on flush lists.
Returns zero if there were no dirty pages (flush lists were empty).
lsn_t buf_pool_get_oldest_modification_lwm | ( | void | ) |
Gets a safe low watermark for oldest_modification.
It's guaranteed that there were no dirty pages with smaller oldest_modification in the whole flush lists.
Returns zero if flush lists were empty, be careful in such case, because taking the newest lsn is probably not a good idea. If you wanted to rely on some lsn in such case, you would need to follow pattern:
dpa_lsn = log_buffer_dirty_pages_added_up_to_lsn(*log_sys); lwm_lsn = buf_pool_get_oldest_modification_lwm(); if (lwm_lsn == 0) lwm_lsn = dpa_lsn;
The order is important to avoid race conditions.
|
inlinestatic |
|
inlinestatic |
Compute the hash value for blocks in buf_pool->zip_hash.
|
inlinestatic |
Calculates the index of a buffer pool to the buf_pool[] array.
Creates the buffer pool.
[in] | total_size | Size of the total pool in bytes. |
[in] | n_instances | Number of buffer pool instances to create. |
void buf_pool_invalidate | ( | void | ) |
Invalidates the file pages in the buffer pool when an archive recovery is completed.
All the file pages buffered must be in a replaceable state when this function is called: not latched and not modified.
size_t buf_pool_pending_io_reads_count | ( | ) |
Computes number of pending I/O read operations for the buffer pool.
size_t buf_pool_pending_io_writes_count | ( | ) |
Computes number of pending I/O write operations for the buffer pool.
Calculate aligned buffer pool size based on srv_buf_pool_chunk_unit, if needed.
[in] | size | size in bytes |
void buf_pool_update_madvise | ( | ) |
Checks if innobase_should_madvise_buf_pool() value has changed since we've last check and if so, then updates buf_pool_should_madvise and calls madvise for all chunks in all srv_buf_pool_instances.
void buf_pool_wait_for_no_pending_io | ( | ) |
Waits until there are no pending I/O operations for the buffer pool.
Keep waiting in loop with sleeps, emitting information every minute. This is used to avoid risk of some pending async IO (e.g. enqueued by the linear read-ahead), which would involve ibuf merge and create new redo records.
bool buf_pool_watch_is_sentinel | ( | const buf_pool_t * | buf_pool, |
const buf_page_t * | bpage | ||
) |
Determine if a block is a sentinel for a buffer pool watch.
[in] | buf_pool | buffer pool instance |
[in] | bpage | block |
bool buf_pool_watch_occurred | ( | const page_id_t & | page_id | ) |
Check if the page has been read in.
This may only be called after buf_pool_watch_set(same_page_id) has returned NULL and before invoking buf_pool_watch_unset(same_page_id).
[in] | page_id | page id |
void buf_pool_watch_unset | ( | const page_id_t & | page_id | ) |
Stop watching if the page has been read in.
buf_pool_watch_set(same_page_id) must have returned NULL before.
[in] | page_id | page id |
void buf_print | ( | void | ) |
Prints info of the buffer pool data structure.
Prints info of the buffer pool data structure.
void buf_print_io | ( | FILE * | file | ) |
Prints info of the buffer i/o.
in: file where to print
file | in/out: buffer where to print |
|
inlinestatic |
Gets the space id, page offset, and byte offset within page of a pointer pointing to a buffer frame containing a file page.
[in] | ptr | pointer to a buffer frame |
[out] | space | space id |
[out] | addr | page offset and byte offset |
void buf_read_page_handle_error | ( | buf_page_t * | bpage | ) |
Unfixes the page, unlatches the page, removes it from page_hash and removes it from LRU.
[in,out] | bpage | pointer to the block |
void buf_refresh_io_stats_all | ( | void | ) |
Refresh the statistics used to print per-second averages.
Refresh the statistics used to print per-second averages.
void buf_resize_thread | ( | ) |
This is the thread for resizing buffer pool.
It waits for an event and when waked up either performs a resizing and sleeps again.
void buf_stats_get_pool_info | ( | buf_pool_t * | buf_pool, |
ulint | pool_id, | ||
buf_pool_info_t * | all_pool_info | ||
) |
Collect buffer pool stats information for a buffer pool.
Also record aggregated stats if there are more than one buffer pool in the server in/out: buffer pool info to fill
Also record aggregated stats if there are more than one buffer pool in the server
buf_pool | in: buffer pool |
pool_id | in: buffer pool ID |
all_pool_info | in/out: buffer pool info to fill |
bool buf_validate | ( | void | ) |
Validates the buffer pool data structure.
Validates the buffer pool data structure.
bool buf_zip_decompress | ( | buf_block_t * | block, |
bool | check | ||
) |
Decompress a block.
block | in/out: block |
check | in: true=verify the page checksum |
std::ostream & operator<< | ( | std::ostream & | out, |
const buf_pool_t & | buf_pool | ||
) |
Print the given buf_pool_t object.
[in,out] | out | the output stream |
[in] | buf_pool | the buf_pool_t object to be printed |
|
constexpr |
The common buffer control block structure for compressed and uncompressed frames.
Number of bits used for buffer page states.
|
extern |
The buffer pools of the database.
|
constexpr |
The maximum number of buffer pools that can be defined.
|
constexpr |
Number of bits to representing a buffer pool ID.
|
constexpr |
The maximum number of page_hash locks.