MySQL  8.0.20
Source Code Documentation
log0types.h File Reference

Redo log types. More...

#include <atomic>
#include <chrono>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <string>
#include "os0event.h"
#include "os0file.h"
#include "sync0sharded_rw.h"
#include "univ.i"
#include "ut0link_buf.h"
#include "ut0mutex.h"

Go to the source code of this file.

Classes

struct  Log_handle
 
struct  log_t
 Redo log - single data structure with state of the redo log system. More...
 

Macros

#define LSN_PF   UINT64PF
 Print format for lsn_t values, used in functions like printf. More...
 

Typedefs

typedef uint64_t lsn_t
 Type used for all log sequence number storage and arithmetics. More...
 
using atomic_lsn_t = std::atomic< lsn_t >
 Alias for atomic based on lsn_t. More...
 
typedef uint64_t sn_t
 Type used for sn values, which enumerate bytes of data stored in the log. More...
 
using atomic_sn_t = std::atomic< sn_t >
 Alias for atomic based on sn_t. More...
 
typedef uint64_t checkpoint_no_t
 Type used for checkpoint numbers (consecutive checkpoints receive a number which is increased by one). More...
 
typedef std::atomic< int64_t > log_flushes_t
 Type used for counters in log_t: flushes_requested and flushes_expected. More...
 
typedef std::atomic< uint32_t(*)(const byte *log_block)> log_checksum_func_t
 Function used to calculate checksums of log blocks. More...
 
using Log_clock = std::chrono::high_resolution_clock
 Clock used to measure time spent in redo log (e.g. More...
 
using Log_clock_point = std::chrono::time_point< Log_clock >
 Time point defined by the Log_clock. More...
 
typedef size_t log_lock_no_t
 

Enumerations

enum  log_header_format_t {
  LOG_HEADER_FORMAT_5_7_9 = 1, LOG_HEADER_FORMAT_8_0_1 = 2, LOG_HEADER_FORMAT_8_0_3 = 3, LOG_HEADER_FORMAT_8_0_19 = 4,
  LOG_HEADER_FORMAT_CURRENT = LOG_HEADER_FORMAT_8_0_19
}
 Supported redo log formats. More...
 
enum  log_state_t { log_state_t::OK, log_state_t::CORRUPTED }
 The state of a log group. More...
 

Detailed Description

Redo log types.

Created 2013-03-15 Sunny Bains

Macro Definition Documentation

◆ LSN_PF

#define LSN_PF   UINT64PF

Print format for lsn_t values, used in functions like printf.

Typedef Documentation

◆ atomic_lsn_t

using atomic_lsn_t = std::atomic<lsn_t>

Alias for atomic based on lsn_t.

◆ atomic_sn_t

using atomic_sn_t = std::atomic<sn_t>

Alias for atomic based on sn_t.

◆ checkpoint_no_t

typedef uint64_t checkpoint_no_t

Type used for checkpoint numbers (consecutive checkpoints receive a number which is increased by one).

◆ log_checksum_func_t

typedef std::atomic<uint32_t (*)(const byte *log_block)> log_checksum_func_t

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

using Log_clock_point = std::chrono::time_point<Log_clock>

Time point defined by the Log_clock.

◆ log_flushes_t

typedef std::atomic<int64_t> 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_lock_no_t

typedef size_t log_lock_no_t

◆ lsn_t

typedef uint64_t lsn_t

Type used for all log sequence number storage and arithmetics.

◆ sn_t

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

Enumeration Type Documentation

◆ log_header_format_t

Supported redo log formats.

Stored in LOG_HEADER_FORMAT.

Enumerator
LOG_HEADER_FORMAT_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).

LOG_HEADER_FORMAT_8_0_1 

Remove MLOG_FILE_NAME and MLOG_CHECKPOINT, introduce MLOG_FILE_OPEN redo log record.

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

LOG_HEADER_FORMAT_8_0_19 

Expand ulint compressed form.

LOG_HEADER_FORMAT_CURRENT 

The redo log format identifier corresponding to the current format version.

◆ log_state_t

enum log_state_t
strong

The state of a log group.

Enumerator
OK 

No corruption detected.

CORRUPTED 

Corrupted.