![]() |
MySQL 26.7.0
Source Code Documentation
|
#include "log0chkp.h"#include <chrono>#include <cstring>#include "arch0arch.h"#include "buf0buf.h"#include "buf0flu.h"#include "fil0pages_persistence_interface.h"#include "log0buf.h"#include "log0encryption.h"#include "log0files_io.h"#include "log0log.h"#include "log0recv.h"#include "log0handler_interface.h"#include "log0sys.h"#include "log0test.h"#include "log0types.h"#include "log0write.h"#include "mach0data.h"#include "my_dbug.h"#include "os0event.h"#include "os0thread-create.h"#include "sql_thd_internal_api.h"#include "srv0mon.h"#include "srv0srv.h"#include "srv0start.h"#include "ut0byte.h"Functions | |
| static void | log_wait_for_checkpoint (lsn_t lsn) |
| Waits for checkpoint advanced to at least that lsn. More... | |
| static void | log_request_sync_flush () |
| Requests for urgent flush of dirty pages, to advance oldest_lsn in flush lists. More... | |
| static lsn_t | log_compute_available_for_checkpoint_lsn () |
| Calculates lsn at which we might write a next checkpoint. More... | |
| dberr_t | log_files_next_checkpoint (log_t &log, lsn_t next_checkpoint_lsn) |
| Writes the next checkpoint to the log file, by writing a single checkpoint header with the checkpoint lsn. More... | |
| 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... | |
| 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 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... | |
| static bool | log_request_checkpoint_validate () |
| Check if the checkpointing is enabled. More... | |
| static lsn_t | get_soft_logical_capacity () |
| static lsn_t | adaptive_flush_max_age (lsn_t soft_logical_capacity) |
| static lsn_t | adaptive_flush_min_age (lsn_t soft_logical_capacity) |
| static lsn_t | aggressive_checkpoint_min_age (lsn_t soft_logical_capacity) |
| void | log_update_exported_lsns () |
| Updates: More... | |
Variables | |
| Log_checkpointing * | log_checkpointing |
| Redo log checkpointing. More... | |
|
static |
|
static |
Calculates lsn at which we might write a next checkpoint.
It does the best effort, but possibly the maximum allowed lsn, could be even bigger. That's because the order of dirty pages in flush lists has been relaxed, and we don't want to spend time on traversing the whole flush lists here.
Note that some flush lists could be empty, and some additions of dirty pages could be pending (threads have written data to the log buffer and became scheduled out just before adding the dirty pages). That's why the calculated value cannot be larger than the buf_flush_list_added->smallest_not_added_lsn() (only up to this lsn value we are sure, that all the dirty pages have been added).
It is guaranteed, that the returned value will not be smaller than the log_checkpointer.m_checkpoint_lsn.
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 |
| 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 |
|
static |
Check if the checkpointing is enabled.
| true | checkpointing is enabled |
| false | checkpointing is disabled |
|
static |
Requests for urgent flush of dirty pages, to advance oldest_lsn in flush lists.
This should force page cleaners to perform the sync-flush in which case the innodb_max_io_capacity is not respected. This should be called when we are close to running out of space in redo log (close to m_free_check_limit_lsn).
| void log_update_exported_lsns | ( | ) |
Updates:
|
static |
Waits for checkpoint advanced to at least that lsn.
| [in] | lsn | lsn up to which we are waiting |
| Log_checkpointing* log_checkpointing |
Redo log checkpointing.