MySQL 8.0.31
Source Code Documentation
log0files_finder.h File Reference
#include <string>
#include "log0files_dict.h"
#include "log0types.h"

Go to the source code of this file.

Enumerations

enum class  Log_files_find_result {
  FOUND_VALID_FILES , FOUND_UNINITIALIZED_FILES , FOUND_NO_FILES , FOUND_VALID_FILES_BUT_MISSING_NEWEST ,
  FOUND_DISABLED_FILES , FOUND_CORRUPTED_FILES , SYSTEM_ERROR
}
 Result returned by the. More...
 

Functions

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...
 

Enumeration Type Documentation

◆ Log_files_find_result

enum class Log_files_find_result
strong

Result returned by the.

See also
log_files_find_and_analyze().
Enumerator
FOUND_VALID_FILES 

We have found valid log files.

FOUND_UNINITIALIZED_FILES 

There were log files which have not been fully initialized.

FOUND_NO_FILES 

There were no log files at all.

FOUND_VALID_FILES_BUT_MISSING_NEWEST 

Found valid log files, but discovered that some of the newest are missing.

When this is reported, it means that the only reason why the FOUND_VALID_FILES was not returned, is that the newest found log file has been already marked as full.

FOUND_DISABLED_FILES 

Found log files, but marked as "crash unsafe" (disabled redo)

FOUND_CORRUPTED_FILES 

Found log files, but structure is corrupted.

SYSTEM_ERROR 

System error occurred when scanning files on disk.

Function Documentation

◆ log_files_find_and_analyze()

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.

Parameters
[in]read_onlyT: check file permissions only for reading, F: check for both reading and writing
[in]encryption_metadatapointer 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
See also
Log_file_handle::m_encryption_metadata
Parameters
[out]filesdictionary of files that have been found when FOUND_VALID_FILES is returned; otherwise stays untouched
[out]formatdiscovered format of the redo log files
[out]creator_namename of creator of the files
[out]log_flagsdiscovered flags of the redo log files
[out]log_uuiddiscovered uuid of the redo log files
Returns
result of the scan and validation -
See also
Log_files_find_result

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.