77struct alignas(ut::INNODB_CACHE_LINE_SIZE)
log_t {
126#ifdef UNIV_PFS_RWLOCK
315#ifndef UNIV_HOTBACKUP
496#ifndef UNIV_HOTBACKUP
733#ifdef UNIV_PFS_MEMORY
Concurrent data structure, which allows to track concurrently performed operations which locally migh...
Definition: ut0link_buf.h:78
Definition: log0consumer.h:82
Handle which allows to do reads / writes for the opened file.
Definition: log0types.h:309
Responsible for the redo log capacity computations.
Definition: log0files_capacity.h:56
In-memory dictionary of meta data of existing log files.
Definition: log0files_dict.h:57
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Lightweight convenience wrapper which manages a dynamically allocated array of over-aligned types.
Definition: ut0new.h:2019
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49
Redo log functions and types related to the log consumption.
Redo log management of capacity.
In-memory dictionary of log files (keeps their meta data).
PSI_memory_key log_buffer_memory_key
log_t * log_sys
Redo log system (singleton).
Definition: log0log.cc:431
Log_checkpoint_header_no
Enumerates checkpoint headers in the redo log file.
Definition: log0types.h:95
std::chrono::time_point< Log_clock > Log_clock_point
Time point defined by the Log_clock.
Definition: log0types.h:135
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
std::atomic< lsn_t > atomic_lsn_t
Alias for atomic based on lsn_t.
Definition: log0types.h:82
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:63
std::atomic< sn_t > atomic_sn_t
Alias for atomic based on sn_t.
Definition: log0types.h:89
uint32_t Log_flags
Log flags (stored in file header of log file).
Definition: log0types.h:69
Definition: buf0block_hint.cc:30
constexpr size_t INNODB_CACHE_LINE_SIZE
CPU cache line size.
Definition: ut0cpu_cache.h:41
std::unordered_set< Key, std::hash< Key >, std::equal_to< Key >, ut::allocator< Key > > unordered_set
Definition: ut0new.h:2889
The interface to the operating system condition variables.
The interface to the operating system file io.
constexpr uint32_t OS_FILE_LOG_BLOCK_SIZE
The next value should be smaller or equal to the smallest sector size used on any disk.
Definition: os0file.h:192
uint64_t os_offset_t
File offset in bytes.
Definition: os0file.h:87
Meta information about single log file.
Definition: log0types.h:454
Configures path to the root directory, where redo subdirectory might be located (or redo log files if...
Definition: log0types.h:204
Runtime statistics related to redo log files management.
Definition: log0types.h:577
Interface for an instrumented rwlock.
Definition: psi_rwlock_bits.h:71
Redo log - single data structure with state of the redo log system.
Definition: log0sys.h:77
Log_clock_point last_checkpoint_time
Latest checkpoint wall time.
Definition: log0sys.h:714
size_t m_unused_files_count
Number of existing unused files (those with _tmp suffix).
Definition: log0sys.h:423
double flush_avg_time
Flushing average time (in microseconds).
Definition: log0sys.h:244
lsn_t recovered_lsn
Lsn from which recovery has been started.
Definition: log0sys.h:558
lsn_t dict_max_allowed_checkpoint_lsn
Maximum lsn allowed for checkpoint by dict_persist or zero.
Definition: log0sys.h:633
os_event_t flusher_event
Definition: log0sys.h:249
ut::aligned_array_pointer< byte, LOG_WRITE_AHEAD_BUFFER_ALIGNMENT > write_ahead_buf
Aligned buffer used for some of redo log writes.
Definition: log0sys.h:271
os_event_t next_checkpoint_event
Event signaled when last_checkpoint_lsn is advanced by the log_checkpointer thread.
Definition: log0sys.h:710
os_event_t m_files_governor_iteration_event
Event used by other threads to wait until log files governor finished its next iteration.
Definition: log0sys.h:453
atomic_sn_t sn
Current sn value.
Definition: log0sys.h:103
THD * m_checkpointer_thd
THD used by the log_checkpointer thread.
Definition: log0sys.h:722
bool periodical_checkpoints_enabled
If should perform checkpoints every innodb_log_checkpoint_every ms.
Definition: log0sys.h:639
ib_mutex_t limits_mutex
Mutex which protects fields: available_for_checkpoint_lsn, requested_checkpoint_lsn.
Definition: log0sys.h:600
Log_format m_format
Format of the redo log: e.g., Log_format::CURRENT.
Definition: log0sys.h:561
uint64_t n_log_ios_old
Number of total I/O operations performed when we printed the statistics last time.
Definition: log0sys.h:542
std::string m_creator_name
Log creator name.
Definition: log0sys.h:564
Log_file m_current_file
File within which write_lsn is located, so the newest file in m_files in the same time - updates are ...
Definition: log0sys.h:287
lsn_t m_scanned_lsn
Used only in recovery: recovery scan succeeded up to this lsn.
Definition: log0sys.h:573
std::atomic< uint64_t > write_to_file_requests_total
Approx.
Definition: log0sys.h:185
os_event_t sn_lock_event
Event used for locking sn.
Definition: log0sys.h:89
ib_mutex_t checkpointer_mutex
Mutex which can be used to pause log checkpointer thread.
Definition: log0sys.h:694
std::atomic< std::chrono::microseconds > write_to_file_requests_interval
How often redo write/flush is requested in average.
Definition: log0sys.h:191
atomic_sn_t buf_size_sn
Size of the log buffer expressed in number of data bytes, that is excluding bytes for headers and foo...
Definition: log0sys.h:120
std::atomic_bool m_no_more_dummy_records_promised
False if the log files governor thread is allowed to add new dummy redo records.
Definition: log0sys.h:466
Log_clock_point last_flush_start_time
Last flush start time.
Definition: log0sys.h:237
Log_files_dict m_files
The in-memory dictionary of log files.
Definition: log0sys.h:419
ib_mutex_t governor_iteration_mutex
Mutex which can be used to pause log governor thread.
Definition: log0sys.h:446
os_event_t checkpointer_event
Event used by the log checkpointer thread to wait for requests.
Definition: log0sys.h:689
int64_t current_ready_waiting_sig_count
current_ready_waiting_lsn is waited using this sig_count.
Definition: log0sys.h:359
Log_checkpoint_header_no next_checkpoint_header_no
Next checkpoint header to use.
Definition: log0sys.h:706
atomic_sn_t sn_locked
Intended sn value while x-locked.
Definition: log0sys.h:106
os_offset_t write_ahead_end_offset
Up to this file offset in the log files, the write-ahead has been done or is not required (for any ot...
Definition: log0sys.h:275
std::atomic_bool should_stop_threads
Used for stopping the log background threads.
Definition: log0sys.h:529
ut::unordered_set< Log_consumer * > m_consumers
Set of registered redo log consumers.
Definition: log0sys.h:516
ib_mutex_t closer_mutex
Mutex protecting closer_event, current_ready_waiting_lsn, and current_ready_waiting_sig_count.
Definition: log0sys.h:351
atomic_sn_t concurrency_margin
Margin used in calculation of.
Definition: log0sys.h:665
atomic_lsn_t free_check_limit_lsn
Maximum lsn up to which there is free space in the redo log.
Definition: log0sys.h:661
atomic_sn_t buf_limit_sn
Maximum sn up to which there is free space in both the log buffer and the log files.
Definition: log0sys.h:164
std::atomic_bool writer_threads_paused
Used for pausing the log writer threads.
Definition: log0sys.h:147
byte m_encryption_buf[OS_FILE_LOG_BLOCK_SIZE]
Buffer that contains encryption meta data encrypted with master key.
Definition: log0sys.h:480
atomic_lsn_t write_notifier_resume_lsn
Used for resuming write notifier thread.
Definition: log0sys.h:535
os_offset_t m_unused_file_size
Size of each unused redo log file, to which recently all unused redo log files became resized.
Definition: log0sys.h:427
bool disable_redo_writes
When this is set, writing to the redo log should be disabled.
Definition: log0sys.h:579
uint32_t write_ahead_buf_size
Size of buffer used for the write-ahead (in bytes).
Definition: log0sys.h:262
std::atomic_bool m_no_more_dummy_records_requested
False if log files governor thread is allowed to add new redo records.
Definition: log0sys.h:459
os_event_t writer_event
Definition: log0sys.h:325
ib_mutex_t m_files_mutex
Mutex protecting set of existing log files and their meta data.
Definition: log0sys.h:412
THD * m_writer_thd
THD used by the log_writer thread.
Definition: log0sys.h:322
Encryption_metadata m_encryption_metadata
Encryption metadata.
Definition: log0sys.h:494
int64_t current_flush_sig_count
The next flushed_to_disk_lsn can be waited using this sig_count.
Definition: log0sys.h:378
lsn_t current_ready_waiting_lsn
Some threads waiting for the ready for write lsn by closer_event.
Definition: log0sys.h:355
bool m_requested_files_consumption
True iff log_writer is waiting for a next log file available.
Definition: log0sys.h:435
atomic_lsn_t flush_notifier_resume_lsn
Used for resuming flush notifier thread.
Definition: log0sys.h:538
std::atomic_bool m_allow_checkpoints
If checkpoints are allowed.
Definition: log0sys.h:646
Log_clock_point last_flush_end_time
Last flush end time.
Definition: log0sys.h:241
lsn_t requested_checkpoint_lsn
When this is larger than the latest checkpoint, the log checkpointer thread will be forced to write a...
Definition: log0sys.h:621
os_event_t write_notifier_event
Event used by the log writer thread to notify the log write notifier thread, that it should proceed w...
Definition: log0sys.h:399
Log_files_context m_files_ctx
Context for all operations on redo log files from log0files_io.h.
Definition: log0sys.h:415
os_event_t flush_notifier_event
Event used by the log flusher thread to notify the log flush notifier thread, that it should proceed ...
Definition: log0sys.h:375
struct PSI_rwlock * pfs_psi
The instrumentation hook.
Definition: log0sys.h:138
atomic_lsn_t last_checkpoint_lsn
Latest checkpoint lsn.
Definition: log0sys.h:701
size_t flush_events_size
Number of entries in the array with events.
Definition: log0sys.h:216
lsn_t m_oldest_need_lsn_lowerbound
A recently seen value of log_consumer_get_oldest()->get_consumed_lsn().
Definition: log0sys.h:333
ib_mutex_t writer_mutex
Mutex which can be used to pause log writer thread.
Definition: log0sys.h:318
THD * m_files_governor_thd
THD used by the log_files_governor thread.
Definition: log0sys.h:470
os_event_t * flush_events
Unaligned pointer to array with events, which are used for notifications sent from the log flush noti...
Definition: log0sys.h:213
os_event_t m_files_governor_event
Event used by log files governor thread to wait.
Definition: log0sys.h:442
std::atomic< bool > concurrency_margin_is_safe
True iff current concurrency_margin isn't truncated because of too small redo log capacity.
Definition: log0sys.h:670
atomic_lsn_t flushed_to_disk_lsn
Up to this lsn data has been flushed to disk (fsynced).
Definition: log0sys.h:224
ib_mutex_t flush_notifier_mutex
Mutex which can be used to pause log flush notifier thread.
Definition: log0sys.h:381
os_event_t old_flush_event
This event is in the reset state when a flush is running; a thread should wait for this without ownin...
Definition: log0sys.h:221
ib_mutex_t write_notifier_mutex
Mutex which can be used to pause log write notifier thread.
Definition: log0sys.h:394
Log_uuid m_log_uuid
Log UUID.
Definition: log0sys.h:570
os_event_t m_file_removed_event
Event used for waiting on next file available.
Definition: log0sys.h:476
Log_file_handle m_current_file_handle
Handle for the opened m_current_file.
Definition: log0sys.h:301
ib_mutex_t sn_x_lock_mutex
Mutex which can be used for x-lock sn value.
Definition: log0sys.h:109
Log_files_capacity m_capacity
Capacity limits for the redo log.
Definition: log0sys.h:431
os_event_t closer_event
Event used by threads to wait for recent_written.tail() to advance.
Definition: log0sys.h:347
size_t buf_size
Size of the log buffer expressed in number of total bytes, that is including bytes for headers and fo...
Definition: log0sys.h:124
Log_checkpoint_consumer m_checkpoint_consumer
Redo log consumer which is always registered and which is responsible for protecting redo log records...
Definition: log0sys.h:718
atomic_sn_t dict_persist_margin
Margin used in calculation of.
Definition: log0sys.h:676
Log_flags m_log_flags
Log flags.
Definition: log0sys.h:567
rw_lock_t * sn_lock_inst
The rw_lock instance only for the debug info list.
Definition: log0sys.h:95
os_event_t writer_threads_resume_event
Event used for pausing the log writer threads.
Definition: log0sys.h:532
time_t last_printout_time
Wall time when we printed the statistics last time.
Definition: log0sys.h:545
ib_mutex_t flusher_mutex
Mutex which can be used to pause log flusher thread.
Definition: log0sys.h:247
os_event_t * write_events
Unaligned pointer to array with events, which are used for notifications sent from the log write noti...
Definition: log0sys.h:178
lsn_t available_for_checkpoint_lsn
A new checkpoint could be written for this lsn value.
Definition: log0sys.h:613
Link_buf< lsn_t > recent_written
The recent written buffer.
Definition: log0sys.h:143
uint64_t n_log_ios
Number of performed IO operations (only for printing stats).
Definition: log0sys.h:313
Log_files_stats m_files_stats
Statistics related to redo log files consumption and creation.
Definition: log0sys.h:439
size_t write_events_size
Number of entries in the array with writer_events.
Definition: log0sys.h:181
atomic_lsn_t write_lsn
Up to this lsn, data has been written to disk (fsync not required).
Definition: log0sys.h:168
bool m_writer_inside_extra_margin
True iff the log writer has entered extra writer margin and still hasn't exited since then.
Definition: log0sys.h:308
InnoDB condition variable.
Definition: os0event.cc:63
The structure used in the spin lock implementation of a read-write lock.
Definition: sync0rw.h:363
The read-write lock (for threads, not for database transactions)
Version control for database, common definitions, and include files.
Utilities related to CPU cache.
Link buffer - concurrent data structure which allows:
Dynamic memory allocation routines and custom allocators specifically crafted to support memory instr...