![]() |
MySQL 26.7.0
Source Code Documentation
|
#include "fil0pages_persistence_interface.h"#include "log0log.h"#include "log0sys.h"#include "log0types.h"#include "srv0srv.h"#include "sync0debug.h"#include "sync0types.h"#include "ut0new.h"Go to the source code of this file.
Classes | |
| class | Log_checkpointing |
Macros | |
Log - checkpointer mutex | |
| #define | log_checkpointer_mutex_enter() mutex_enter(&(log_checkpointing->checkpoint_mutex)) |
| #define | log_checkpointer_mutex_exit() mutex_exit(&(log_checkpointing->checkpoint_mutex)) |
| #define | log_checkpointer_mutex_own() |
Log - limits mutex | |
| #define | log_limits_mutex_enter() mutex_enter(&(log_checkpointing->limits_mutex)) |
| #define | log_limits_mutex_exit() mutex_exit(&(log_checkpointing->limits_mutex)) |
| #define | log_limits_mutex_own() mutex_own(&(log_checkpointing->limits_mutex)) |
Functions | |
| lsn_t | log_get_checkpoint_age () |
| Calculates age of current checkpoint as number of bytes since last checkpoint. More... | |
| void | log_update_exported_lsns () |
| Updates: More... | |
Log - checkpointer thread | |
Redo log functions related to checkpointing and log free check. | |
| bool | log_checkpointer_is_active () |
| Checks if log checkpointer thread is active. More... | |
Log - basic information about checkpoints. | |
| Log_checkpoint_header_no | log_next_checkpoint_header (Log_checkpoint_header_no checkpoint_header_no) |
| Provides opposite checkpoint header number to the given checkpoint header number. More... | |
Log - other functions related to checkpoints. | |
| dberr_t | log_files_write_checkpoint_low (log_t &log, Log_file_handle &checkpoint_file_handle, Log_checkpoint_header_no checkpoint_header_no, lsn_t next_checkpoint_lsn) |
| Writes checkpoint to the file containing the written checkpoint_lsn. More... | |
| dberr_t | log_files_write_first_data_block_low (log_t &log, Log_file_handle &file_handle, lsn_t checkpoint_lsn, lsn_t file_start_lsn) |
| Writes the first data block to the log file using the provided handle to the opened log file. More... | |
| dberr_t | log_files_next_checkpoint (log_t &log, lsn_t lsn) |
| Writes the next checkpoint to the log file, by writing a single checkpoint header with the checkpoint lsn. More... | |
Variables | |
| Log_checkpointing * | log_checkpointing |
| Redo log checkpointing. More... | |
| #define log_checkpointer_mutex_enter | ( | ) | mutex_enter(&(log_checkpointing->checkpoint_mutex)) |
| #define log_checkpointer_mutex_exit | ( | ) | mutex_exit(&(log_checkpointing->checkpoint_mutex)) |
| #define log_checkpointer_mutex_own | ( | ) |
| #define log_limits_mutex_enter | ( | ) | mutex_enter(&(log_checkpointing->limits_mutex)) |
| #define log_limits_mutex_exit | ( | ) | mutex_exit(&(log_checkpointing->limits_mutex)) |
| #define log_limits_mutex_own | ( | ) | mutex_own(&(log_checkpointing->limits_mutex)) |
|
inline |
Checks if log checkpointer thread is active.
Writes the next checkpoint to the log file, by writing a single checkpoint header with the checkpoint lsn.
Flushes the file after the write and updates the log.last_checkpoint_lsn.
| [in,out] | log | redo log |
| [in] | lsn | writes checkpoint at this lsn |
| dberr_t log_files_write_checkpoint_low | ( | log_t & | log, |
| Log_file_handle & | checkpoint_file_handle, | ||
| Log_checkpoint_header_no | checkpoint_header_no, | ||
| lsn_t | next_checkpoint_lsn | ||
| ) |
Writes checkpoint to the file containing the written checkpoint_lsn.
The checkpoint is written to the given checkpoint header. Unless InnoDB is starting: checkpointer, writer and files mutexes must be acquired before calling this function.
| [in,out] | log | redo log |
| [in] | checkpoint_file_handle | handle to opened file |
| [in] | checkpoint_header_no | checkpoint header to be written |
| [in] | next_checkpoint_lsn | the checkpoint lsn to write |
| dberr_t log_files_write_first_data_block_low | ( | log_t & | log, |
| Log_file_handle & | file_handle, | ||
| lsn_t | checkpoint_lsn, | ||
| lsn_t | file_start_lsn | ||
| ) |
Writes the first data block to the log file using the provided handle to the opened log file.
The block is addressed by the given checkpoint_lsn, filled with 0x00 and its data length points to checkpoint_lsn inside, making the block logically empty.
| [in,out] | log | redo log |
| [in] | file_handle | handle to the opened log file |
| [in] | checkpoint_lsn | the checkpoint lsn |
| [in] | file_start_lsn | start_lsn of the file |
|
inline |
Calculates age of current checkpoint as number of bytes since last checkpoint.
This includes bytes for headers and footers of all log blocks. The calculation is based on the latest written checkpoint lsn, and the current lsn, which points to the first non reserved data byte. Note that the current lsn could not fit the free space in the log files. This means that the checkpoint age could potentially be larger than capacity of the log files. However we do the best effort to avoid such situations, and if they happen, user threads wait until the space is reclaimed.
| Log_checkpoint_header_no log_next_checkpoint_header | ( | Log_checkpoint_header_no | checkpoint_header_no | ) |
Provides opposite checkpoint header number to the given checkpoint header number.
| [in] | checkpoint_header_no | the given checkpoint header number |
| void log_update_exported_lsns | ( | ) |
Updates:
|
extern |
Redo log checkpointing.