![]() |
MySQL 9.1.0
Source Code Documentation
|
Redo log - finding log files and inspecting their meta data. More...
#include <string>
#include "log0files_finder.h"
#include "log0files_io.h"
#include "log0pre_8_0_30.h"
#include "log0types.h"
#include "os0file.h"
Functions | |
Log - multiple files analysis | |
static bool | log_files_validate_format (const Log_files_context &files_ctx, const ut::vector< Log_file_id_and_header > &files, Log_format &format) |
Validates that all redo files have the same format and the format is in range [Log_format::VERSION_8_0_30, Log_format::CURRENT]. More... | |
static bool | log_files_validate_start_lsn (const Log_files_context &files_ctx, const ut::vector< Log_file_id_and_header > &file_headers) |
Validates that all log files have start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0,. More... | |
static bool | log_files_validate_lsn_chain (const Log_files_context &files_ctx, const ut::vector< Log_file_id_and_size > &file_sizes, const ut::vector< Log_file_id_and_header > &file_headers) |
Validates that all log files create a chain of consecutive lsn ranges. More... | |
static bool | log_files_validate_log_uuid (const Log_files_context &files_ctx, const ut::vector< Log_file_id_and_header > &files, Log_uuid &log_uuid) |
Validates if all existing redo log files have the same log_uuid. More... | |
static bool | log_files_validate_file_sizes_equal (const Log_files_context &files_ctx, const ut::vector< Log_file_id_and_size > &files) |
Validates if a set of redo log files consists of files of equal size. More... | |
Log - files finder | |
Log_files_find_result | log_files_find_and_analyze (bool read_only, Encryption_metadata &encryption_metadata, Log_files_dict &files, Log_format &format, std::string &creator_name, Log_flags &log_flags, Log_uuid &log_uuid) |
Scans for existing log files on disk. More... | |
Redo log - finding log files and inspecting their meta data.
Log_files_find_result log_files_find_and_analyze | ( | bool | read_only, |
Encryption_metadata & | encryption_metadata, | ||
Log_files_dict & | files, | ||
Log_format & | format, | ||
std::string & | creator_name, | ||
Log_flags & | log_flags, | ||
Log_uuid & | log_uuid | ||
) |
Scans for existing log files on disk.
Performs basic validation for the files that have been found. Clears and builds the Log_files_dict. Determines global properties of the redo log files: format, creator, flags and uuid.
[in] | read_only | T: check file permissions only for reading, F: check for both reading and writing |
[in] | encryption_metadata | pointer to encryption metadata to be used by all redo log file IO operations except those related to the first LOG_FILE_HDR_SIZE bytes of each log file |
[out] | files | dictionary of files that have been found when FOUND_VALID_FILES is returned; otherwise stays untouched |
[out] | format | discovered format of the redo log files |
[out] | creator_name | name of creator of the files |
[out] | log_flags | discovered flags of the redo log files |
[out] | log_uuid | discovered uuid of the redo log files |
The size_capacity was computed by iterating files_list, in which we potentially could have two files with the same m_id if some bug was introduced. This should be caught easily by this check.
|
static |
Validates if a set of redo log files consists of files of equal size.
This is used for files with older redo format.
[in] | files_ctx | context within which files exist |
[in] | files | non-empty list of file headers of existing log files, ordered by file_id |
|
static |
Validates that all redo files have the same format and the format is in range [Log_format::VERSION_8_0_30, Log_format::CURRENT].
[in] | files_ctx | context within which files exist |
[in] | files | non-empty list of file headers of existing log files, ordered by file_id |
[out] | format | discovered format if true was returned |
|
static |
Validates if all existing redo log files have the same log_uuid.
[in] | files_ctx | context within which files exist |
[in] | files | non-empty list of file headers of existing log files, ordered by file_id |
[out] | log_uuid | the log_uuid that has been discovered |
|
static |
Validates that all log files create a chain of consecutive lsn ranges.
[in] | files_ctx | context within which files exist |
[in] | file_sizes | non-empty list of file sizes of existing log files, ordered by file_id |
[in] | file_headers | non-empty list of file headers of existing log files, ordered by file_id |
|
static |
Validates that all log files have start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0,.
[in] | files_ctx | context within which files exist |
[in] | file_headers | non-empty list of file headers of existing log files, ordered by file_id |