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