MySQL 8.0.40
Source Code Documentation
log0files_finder.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2019, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/**************************************************/ /**
29 @file include/log0files_finder.h
30
31 *******************************************************/
32
33#ifndef log0files_finder_h
34#define log0files_finder_h
35
36#include <string>
37
38/* Log_files_dict */
39#include "log0files_dict.h"
40
41/* Log_format, Log_flags */
42#include "log0types.h"
43
44/** Result returned by the @see log_files_find_and_analyze(). */
46 /** We have found valid log files. */
48
49 /** There were log files which have not been fully initialized. */
51
52 /** There were no log files at all. */
54
55 /** Found valid log files, but discovered that some of the newest are missing.
56 When this is reported, it means that the only reason why the FOUND_VALID_FILES
57 was not returned, is that the newest found log file has been already marked as
58 full. */
60
61 /** Found log files, but marked as "crash unsafe" (disabled redo) */
63
64 /** Found log files, but structure is corrupted. */
66
67 /** System error occurred when scanning files on disk. */
69};
70
71/** Scans for existing log files on disk. Performs basic validation for the
72files that have been found. Clears and builds the Log_files_dict. Determines
73global properties of the redo log files: format, creator, flags and uuid.
74@param[in] read_only T: check file permissions only for reading,
75 F: check for both reading and writing
76@param[in] encryption_metadata pointer to encryption metadata to be used by
77 all redo log file IO operations except those
78 related to the first LOG_FILE_HDR_SIZE bytes
79 of each log file
80 @see Log_file_handle::m_encryption_metadata
81@param[out] files dictionary of files that have been found
82 when FOUND_VALID_FILES is returned;
83 otherwise stays untouched
84@param[out] format discovered format of the redo log files
85@param[out] creator_name name of creator of the files
86@param[out] log_flags discovered flags of the redo log files
87@param[out] log_uuid discovered uuid of the redo log files
88@return result of the scan and validation - @see Log_files_find_result */
90 bool read_only, Encryption_metadata &encryption_metadata,
91 Log_files_dict &files, Log_format &format, std::string &creator_name,
92 Log_flags &log_flags, Log_uuid &log_uuid);
93
94#endif /* !log0files_finder_h */
In-memory dictionary of meta data of existing log files.
Definition: log0files_dict.h:57
In-memory dictionary of log files (keeps their meta data).
Log_files_find_result
Result returned by the.
Definition: log0files_finder.h:45
@ FOUND_VALID_FILES
We have found valid log files.
@ FOUND_UNINITIALIZED_FILES
There were log files which have not been fully initialized.
@ FOUND_CORRUPTED_FILES
Found log files, but structure is corrupted.
@ FOUND_NO_FILES
There were no log files at all.
@ FOUND_DISABLED_FILES
Found log files, but marked as "crash unsafe" (disabled redo)
@ FOUND_VALID_FILES_BUT_MISSING_NEWEST
Found valid log files, but discovered that some of the newest are missing.
@ SYSTEM_ERROR
System error occurred when scanning files on disk.
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.
Definition: log0files_finder.cc:225
Redo log basic types.
uint32_t Log_uuid
Number which tries to uniquely identify a created set of redo log files.
Definition: log0types.h:76
Log_format
Supported redo log formats.
Definition: log0types.h:138
uint32_t Log_flags
Log flags (stored in file header of log file).
Definition: log0types.h:69
constexpr value_type read_only
Definition: classic_protocol_constants.h:213
Encryption metadata.
Definition: os0enc.h:445