MySQL 8.4.0
Source Code Documentation
log_pre_8_0_30 Namespace Reference

Classes

struct  Checkpoint_header
 Meta data stored in one of two checkpoint headers. More...
 

Functions

os_offset_t compute_real_offset_for_lsn (size_t n_files, os_offset_t file_size, lsn_t some_file_lsn, os_offset_t some_file_offset, lsn_t requested_lsn)
 Provides a file offset for the given lsn. More...
 
bool checkpoint_header_deserialize (const byte *buf, Checkpoint_header &header)
 Deserializes the log checkpoint header stored in the given buffer. More...
 
std::string file_name (Log_file_id file_id)
 Provides name of the log file with the given file id, e.g. More...
 
bool files_validate_format (const Log_files_context &files_ctx, const ut::vector< Log_file_id_and_header > &files, Log_format &format)
 Validates that ib_logfile0 exists and has format older than VERSION_8_0_30. More...
 
static os_offset_t compute_size_offset (os_offset_t file_size, os_offset_t real_offset)
 
static os_offset_t compute_real_offset (os_offset_t file_size, os_offset_t size_offset)
 

Variables

constexpr const char *const FILE_BASE_NAME = "ib_logfile"
 Prefix of log file name in the old redo format (before 8.0.30). More...
 
constexpr Log_file_id FILE_MAX_ID = 99
 Maximum redo log file id in the old format (before 8.0.30). More...
 
constexpr os_offset_t FIELD_CHECKPOINT_NO = 0
 Checkpoint number. More...
 
constexpr os_offset_t FIELD_CHECKPOINT_LSN = 8
 Checkpoint lsn. More...
 
constexpr os_offset_t FIELD_CHECKPOINT_OFFSET = 16
 Offset within the log files, which corresponds to checkpoint lsn. More...
 
constexpr uint32_t FIELD_CHECKPOINT_LOG_BUF_SIZE = 24
 Size of the log buffer, when the checkpoint write was started. More...
 

Function Documentation

◆ checkpoint_header_deserialize()

bool log_pre_8_0_30::checkpoint_header_deserialize ( const byte buf,
Checkpoint_header header 
)

Deserializes the log checkpoint header stored in the given buffer.

Parameters
[in]bufthe buffer to deserialize
[out]headerthe deserialized header

◆ compute_real_offset()

static os_offset_t log_pre_8_0_30::compute_real_offset ( os_offset_t  file_size,
os_offset_t  size_offset 
)
static

◆ compute_real_offset_for_lsn()

os_offset_t log_pre_8_0_30::compute_real_offset_for_lsn ( size_t  n_files,
os_offset_t  file_size,
lsn_t  some_file_lsn,
os_offset_t  some_file_offset,
lsn_t  requested_lsn 
)

Provides a file offset for the given lsn.

For this function to work, some existing file lsn and corresponding offset to that file lsn have to be provided.

Parameters
[in]n_filesnumber of log files
[in]file_sizesize of each log file (in bytes)
[in]some_file_lsnsome file_lsn for which offset is known
[in]some_file_offsetfile offset corresponding to the given some_file_lsn
[in]requested_lsnthe given lsn for which offset is computed
Returns
file offset corresponding to the given requested_lsn

◆ compute_size_offset()

static os_offset_t log_pre_8_0_30::compute_size_offset ( os_offset_t  file_size,
os_offset_t  real_offset 
)
static

◆ file_name()

std::string log_pre_8_0_30::file_name ( Log_file_id  file_id)

Provides name of the log file with the given file id, e.g.

'ib_logfile0'.

Parameters
[in]file_idid of the log file
Returns
file name

◆ files_validate_format()

bool log_pre_8_0_30::files_validate_format ( const Log_files_context files_ctx,
const ut::vector< Log_file_id_and_header > &  files,
Log_format format 
)

Validates that ib_logfile0 exists and has format older than VERSION_8_0_30.

Parameters
[in]files_ctxdefines context within which redo log files exist
[in]filesnon-empty list of file headers of existing log files, ordered by file_id
[out]formatdiscovered redo format if true was returned
Returns
true iff ib_logfile0 exists and has format older than VERSION_8_0_30

Variable Documentation

◆ FIELD_CHECKPOINT_LOG_BUF_SIZE

constexpr uint32_t log_pre_8_0_30::FIELD_CHECKPOINT_LOG_BUF_SIZE = 24
constexpr

Size of the log buffer, when the checkpoint write was started.

It seems it was write-only field in InnoDB. Not used by recovery.

Note
Note that when the log buffer is being resized, all the log background threads were stopped, so there was no concurrent checkpoint write (the log_checkpointer thread was stopped).

◆ FIELD_CHECKPOINT_LSN

constexpr os_offset_t log_pre_8_0_30::FIELD_CHECKPOINT_LSN = 8
constexpr

Checkpoint lsn.

Recovery starts from this lsn and searches for the first log record group that starts since then. In InnoDB < 8.0.5, it was the exact value at which the first log record group started. Since 8.0.5, the order in flush lists became relaxed and because of that checkpoint lsn values were not precise anymore.

◆ FIELD_CHECKPOINT_NO

constexpr os_offset_t log_pre_8_0_30::FIELD_CHECKPOINT_NO = 0
constexpr

Checkpoint number.

It was incremented by one for each next checkpoint. During recovery, all headers were scanned, and one with the maximum checkpoint number was used for the recovery (checkpoint_lsn from that header was used).

◆ FIELD_CHECKPOINT_OFFSET

constexpr os_offset_t log_pre_8_0_30::FIELD_CHECKPOINT_OFFSET = 16
constexpr

Offset within the log files, which corresponds to checkpoint lsn.

Used for calibration of lsn and offset calculations.

◆ FILE_BASE_NAME

constexpr const char* const log_pre_8_0_30::FILE_BASE_NAME = "ib_logfile"
constexpr

Prefix of log file name in the old redo format (before 8.0.30).

For more details

See also
Log_files_ruleset

◆ FILE_MAX_ID

constexpr Log_file_id log_pre_8_0_30::FILE_MAX_ID = 99
constexpr

Maximum redo log file id in the old format (before 8.0.30).