MySQL 9.1.0
Source Code Documentation
|
Implements a buffer pool dump/load. More...
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <algorithm>
#include "buf0buf.h"
#include "buf0dump.h"
#include "dict0dict.h"
#include "my_io.h"
#include "my_psi_config.h"
#include "my_sys.h"
#include "my_thread.h"
#include "mysql/psi/mysql_stage.h"
#include "os0file.h"
#include "os0thread-create.h"
#include "os0thread.h"
#include "srv0srv.h"
#include "srv0start.h"
#include "sync0rw.h"
#include "univ.i"
#include "ut0byte.h"
Macros | |
#define | SHOULD_QUIT() (SHUTTING_DOWN() && obey_shutdown) |
Typedefs | |
typedef uint64_t | buf_dump_t |
Enumerations | |
enum | status_severity { STATUS_VERBOSE , STATUS_INFO , STATUS_ERR } |
Functions | |
static bool | SHUTTING_DOWN () |
uint64_t | BUF_DUMP_CREATE (space_id_t space, page_no_t page) |
constexpr space_id_t | BUF_DUMP_SPACE (uint64_t a) |
constexpr page_no_t | BUF_DUMP_PAGE (uint64_t a) |
void | buf_dump_start () |
Wakes up the buffer pool dump/load thread and instructs it to start a dump. More... | |
void | buf_load_start () |
Wakes up the buffer pool dump/load thread and instructs it to start a load. More... | |
static void | buf_dump_status (enum status_severity severity, const char *fmt,...) |
Sets the global variable that feeds MySQL's innodb_buffer_pool_dump_status to the specified string. More... | |
static void | buf_load_status (enum status_severity severity, const char *fmt,...) |
Sets the global variable that feeds MySQL's innodb_buffer_pool_load_status to the specified string. More... | |
static const char * | get_buf_dump_dir () |
Returns the directory path where the buffer pool dump file will be created. More... | |
void | buf_dump_generate_path (char *path, size_t path_size) |
Generate the path to the buffer pool dump/load file. More... | |
static void | buf_dump (bool obey_shutdown) |
Perform a buffer pool dump into the file specified by innodb_buffer_pool_filename. More... | |
static void | buf_load_throttle_if_needed (std::chrono::steady_clock::time_point *last_check_time, ulint *last_activity_count, ulint n_io) |
Artificially delay the buffer pool loading if necessary. More... | |
static void | buf_load () |
Perform a buffer pool load from the file specified by innodb_buffer_pool_filename. More... | |
void | buf_load_abort () |
Aborts a currently running buffer pool load. More... | |
void | buf_dump_thread () |
This is the main thread for buffer pool dump/load. More... | |
Variables | |
static bool | buf_dump_should_start = false |
static bool | buf_load_should_start = false |
static bool | buf_load_abort_flag = false |
Implements a buffer pool dump/load.
Created April 08, 2011 Vasil Dimov
#define SHOULD_QUIT | ( | ) | (SHUTTING_DOWN() && obey_shutdown) |
typedef uint64_t buf_dump_t |
enum status_severity |
|
static |
Perform a buffer pool dump into the file specified by innodb_buffer_pool_filename.
If any errors occur then the value of innodb_buffer_pool_dump_status will be set accordingly, see buf_dump_status(). The dump filename can be specified by (relative to srv_data_home): SET GLOBAL innodb_buffer_pool_filename='filename';
[in] | obey_shutdown | quit if we are in a shutting down state |
|
inline |
void buf_dump_generate_path | ( | char * | path, |
size_t | path_size | ||
) |
Generate the path to the buffer pool dump/load file.
[out] | path | generated path |
[in] | path_size | size of 'path', used as in snprintf(3). |
|
constexpr |
|
constexpr |
void buf_dump_start | ( | ) |
Wakes up the buffer pool dump/load thread and instructs it to start a dump.
This function is called by MySQL code via buffer_pool_dump_now() and it should return immediately because the whole MySQL is frozen during its execution.
|
static |
Sets the global variable that feeds MySQL's innodb_buffer_pool_dump_status to the specified string.
The format and the following parameters are the same as the ones used for printf(3). The value of this variable can be retrieved by: SELECT variable_value FROM performance_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'; or by: SHOW STATUS LIKE 'innodb_buffer_pool_dump_status';
severity | in: status severity |
fmt | in: format |
... | in: extra parameters according to fmt |
void buf_dump_thread | ( | ) |
This is the main thread for buffer pool dump/load.
It waits for an event and when waked up either performs a dump or load and sleeps again.
|
static |
Perform a buffer pool load from the file specified by innodb_buffer_pool_filename.
If any errors occur then the value of innodb_buffer_pool_load_status will be set accordingly, see buf_load_status(). The dump filename can be specified by (relative to srv_data_home): SET GLOBAL innodb_buffer_pool_filename='filename';
void buf_load_abort | ( | ) |
Aborts a currently running buffer pool load.
This function is called by MySQL code via buffer_pool_load_abort() and it should return immediately because the whole MySQL is frozen during its execution.
void buf_load_start | ( | ) |
Wakes up the buffer pool dump/load thread and instructs it to start a load.
This function is called by MySQL code via buffer_pool_load_now() and it should return immediately because the whole MySQL is frozen during its execution.
|
static |
Sets the global variable that feeds MySQL's innodb_buffer_pool_load_status to the specified string.
The format and the following parameters are the same as the ones used for printf(3). The value of this variable can be retrieved by: SELECT variable_value FROM performance_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS'; or by: SHOW STATUS LIKE 'innodb_buffer_pool_load_status';
severity | in: status severity |
fmt | in: format |
... | in: extra parameters according to fmt |
|
inlinestatic |
Artificially delay the buffer pool loading if necessary.
The idea of this function is to prevent hogging the server with IO and slowing down too much normal client queries.
[in,out] | last_check_time | milliseconds since epoch of the last time we did check if throttling is needed, we do the check every srv_io_capacity IO ops. |
[in] | last_activity_count | activity count |
[in] | n_io | number of IO ops done since buffer pool load has started |
|
static |
Returns the directory path where the buffer pool dump file will be created.
|
inlinestatic |
|
static |
|
static |
|
static |