Redo log basic types.
More...
#include <atomic>
#include <chrono>
#include <string>
#include "univ.i"
#include "os0file.h"
#include "ut0cpu_cache.h"
#include "log0constants.h"
Go to the source code of this file.
|
enum class | Log_checkpoint_header_no : uint32_t { HEADER_1
, HEADER_2
} |
| Enumerates checkpoint headers in the redo log file. More...
|
|
enum class | Log_file_type { NORMAL
, UNUSED
} |
| Type of redo log file. More...
|
|
enum class | Log_format : uint32_t {
LEGACY = 0
, VERSION_5_7_9 = 1
, VERSION_8_0_1 = 2
, VERSION_8_0_3 = 3
,
VERSION_8_0_19 = 4
, VERSION_8_0_28 = 5
, VERSION_8_0_30 = 6
, CURRENT = VERSION_8_0_30
} |
| Supported redo log formats. More...
|
|
enum class | Log_files_ruleset { PRE_8_0_30
, CURRENT
} |
| Ruleset defining how redo log files are named, where they are stored, when they are created and what sizes could they have. More...
|
|
enum class | Log_resize_mode { NONE
, RESIZING_DOWN
} |
| Direction of resize operation. More...
|
|
enum class | Log_file_access_mode { READ_WRITE
, READ_ONLY
, WRITE_ONLY
} |
| Type of access allowed for the opened redo log file. More...
|
|
◆ LSN_PF
Print format for lsn_t values, used in functions like printf.
◆ atomic_lsn_t
Alias for atomic based on lsn_t.
◆ atomic_sn_t
Alias for atomic based on sn_t.
◆ Log_checksum_algorithm_atomic_ptr
Function used to calculate checksums of log blocks.
◆ Log_clock
using Log_clock = std::chrono::high_resolution_clock |
Clock used to measure time spent in redo log (e.g.
when flushing).
◆ Log_clock_point
Time point defined by the Log_clock.
◆ Log_file_id
Log file id (0 for ib_redo0)
◆ Log_file_io_callback
Callback called on each read or write operation on a redo log file.
- Parameters
-
[in] | file_id | id of the redo log file (target of the IO operation) |
[in] | file_type | type of the redo log file |
[in] | offset | offset in the file, at which read or write operation is going to start (expressed in bytes and computed from the beginning of the file) |
[in] | size | size of data that is going to be read or written in the IO operation |
◆ Log_flags
Log flags (stored in file header of log file).
◆ log_flushes_t
Type used for counters in log_t: flushes_requested and flushes_expected.
They represent number of requests to flush the redo log to disk.
◆ Log_uuid
Number which tries to uniquely identify a created set of redo log files.
Redo log files, which have different values of Log_uuid, most likely have been created for different directories and cannot be mixed. This way foreign redo files might be easily recognized. When that is the case, most likely something went wrong when copying files.
◆ lsn_t
Type used for all log sequence number storage and arithmetic.
◆ sn_t
Type used for sn values, which enumerate bytes of data stored in the log.
Note that these values skip bytes of headers and footers of log blocks.
◆ Log_checkpoint_header_no
Enumerates checkpoint headers in the redo log file.
Enumerator |
---|
HEADER_1 | The first checkpoint header.
|
HEADER_2 | The second checkpoint header.
|
◆ Log_file_access_mode
Type of access allowed for the opened redo log file.
Enumerator |
---|
READ_WRITE | The opened file can be both read and written.
|
READ_ONLY | The opened file can be only read.
|
WRITE_ONLY | The opened file can be only written.
|
◆ Log_file_type
Type of redo log file.
Enumerator |
---|
NORMAL | Usual redo log file, most likely with important redo data.
|
UNUSED | Unused redo log file, might always be removed.
|
◆ Log_files_ruleset
Ruleset defining how redo log files are named, where they are stored, when they are created and what sizes could they have.
Enumerator |
---|
PRE_8_0_30 | Redo log files were named ib_logfile0, ib_logfile1, ... ib_logfile99.
Redo log files were pre-created during startup and re-used after wrapping. Redo log files had the same file size and supported formats < VERSION_8_0_30. The non-initialized set of redo log files was denoted by existence of the ib_logfile101. The log files were located directly in the root directory (innodb_log_group_home_dir if specified; else: datadir).
|
CURRENT | Redo log files are named ib_redo0, ib_redo1, ... and no longer wrapped.
Redo log files are created on-demand during runtime and might have different sizes. Formats >= VERSION_8_0_30 are supported. The redo log files are located in innodb_redo subdirectory in the root directory - for example:
- if innodb_log_group_home_dir = '/srv/my_db/logs', then redo files are in '/srv/my_db/logs/innodb_redo/',
- if innodb_log_group_home_dir is not specified and datadir='/srv/my_db', then redo files are in '/srv/my_db/innodb_redo'.
|
◆ Log_format
Supported redo log formats.
Stored in LOG_HEADER_FORMAT.
Enumerator |
---|
LEGACY | Unknown format of redo file.
|
VERSION_5_7_9 | The MySQL 5.7.9 redo log format identifier.
We can support recovery from this format if the redo log is clean (logically empty).
|
VERSION_8_0_1 | Remove MLOG_FILE_NAME and MLOG_CHECKPOINT, introduce MLOG_FILE_OPEN redo log record.
|
VERSION_8_0_3 | Allow checkpoint_lsn to point any data byte within redo log (before it had to point the beginning of a group of log records).
|
VERSION_8_0_19 | Expand ulint compressed form.
|
VERSION_8_0_28 | Row versioning header.
|
VERSION_8_0_30 | Introduced with innodb_redo_log_capacity:
- write LSN does not re-enter file with checkpoint_lsn,
- epoch_no is checked strictly during recovery.
|
CURRENT | The redo log format identifier corresponding to the current format version.
|
◆ Log_resize_mode
Direction of resize operation.
Enumerator |
---|
NONE | No pending resize.
|
RESIZING_DOWN | Resizing down.
|