76struct alignas(ut::INNODB_CACHE_LINE_SIZE)
log_t {
125#ifdef UNIV_PFS_RWLOCK
324#ifndef UNIV_HOTBACKUP
491#ifndef UNIV_HOTBACKUP
727#ifdef UNIV_PFS_MEMORY
Concurrent data structure, which allows to track concurrently performed operations which locally migh...
Definition: ut0link_buf.h:77
Definition: log0consumer.h:81
Handle which allows to do reads / writes for the opened file.
Definition: log0types.h:308
Responsible for the redo log capacity computations.
Definition: log0files_capacity.h:55
In-memory dictionary of meta data of existing log files.
Definition: log0files_dict.h:56
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
Lightweight convenience wrapper which manages a dynamically allocated array of over-aligned types.
Definition: ut0new.h:2016
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:48
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:434
Log_checkpoint_header_no
Enumerates checkpoint headers in the redo log file.
Definition: log0types.h:94
std::chrono::time_point< Log_clock > Log_clock_point
Time point defined by the Log_clock.
Definition: log0types.h:134
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
std::atomic< lsn_t > atomic_lsn_t
Alias for atomic based on lsn_t.
Definition: log0types.h:81
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:62
std::atomic< sn_t > atomic_sn_t
Alias for atomic based on sn_t.
Definition: log0types.h:88
uint32_t Log_flags
Log flags (stored in file header of log file).
Definition: log0types.h:68
Definition: buf0block_hint.cc:29
constexpr size_t INNODB_CACHE_LINE_SIZE
CPU cache line size.
Definition: ut0cpu_cache.h:40
std::unordered_set< Key, std::hash< Key >, std::equal_to< Key >, ut::allocator< Key > > unordered_set
Definition: ut0new.h:2886
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:83
Meta information about single log file.
Definition: log0types.h:453
Configures path to the root directory, where redo subdirectory might be located (or redo log files if...
Definition: log0types.h:203
Runtime statistics related to redo log files management.
Definition: log0types.h:576
Interface for an instrumented rwlock.
Definition: psi_rwlock_bits.h:70
Redo log - single data structure with state of the redo log system.
Definition: log0sys.h:76
Log_clock_point last_checkpoint_time
Latest checkpoint wall time.
Definition: log0sys.h:708
size_t m_unused_files_count
Number of existing unused files (those with _tmp suffix).
Definition: log0sys.h:422
double flush_avg_time
Flushing average time (in microseconds).
Definition: log0sys.h:253
lsn_t recovered_lsn
Lsn from which recovery has been started.
Definition: log0sys.h:553
lsn_t dict_max_allowed_checkpoint_lsn
Maximum lsn allowed for checkpoint by dict_persist or zero.
Definition: log0sys.h:627
os_event_t flusher_event
Definition: log0sys.h:258
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:280
os_event_t next_checkpoint_event
Event signaled when last_checkpoint_lsn is advanced by the log_checkpointer thread.
Definition: log0sys.h:704
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:448
atomic_sn_t sn
Current sn value.
Definition: log0sys.h:102
THD * m_checkpointer_thd
THD used by the log_checkpointer thread.
Definition: log0sys.h:716
bool periodical_checkpoints_enabled
If should perform checkpoints every innodb_log_checkpoint_every ms.
Definition: log0sys.h:633
ib_mutex_t limits_mutex
Mutex which protects fields: available_for_checkpoint_lsn, requested_checkpoint_lsn.
Definition: log0sys.h:595
Log_format m_format
Format of the redo log: e.g., Log_format::CURRENT.
Definition: log0sys.h:556
uint64_t n_log_ios_old
Number of total I/O operations performed when we printed the statistics last time.
Definition: log0sys.h:537
std::string m_creator_name
Log creator name.
Definition: log0sys.h:559
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:296
lsn_t m_scanned_lsn
Used only in recovery: recovery scan succeeded up to this lsn.
Definition: log0sys.h:568
std::atomic< uint64_t > write_to_file_requests_total
Approx.
Definition: log0sys.h:194
os_event_t sn_lock_event
Event used for locking sn.
Definition: log0sys.h:88
ib_mutex_t checkpointer_mutex
Mutex which can be used to pause log checkpointer thread.
Definition: log0sys.h:688
std::atomic< std::chrono::microseconds > write_to_file_requests_interval
How often redo write/flush is requested in average.
Definition: log0sys.h:200
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:119
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:461
Log_clock_point last_flush_start_time
Last flush start time.
Definition: log0sys.h:246
Log_files_dict m_files
The in-memory dictionary of log files.
Definition: log0sys.h:418
os_event_t checkpointer_event
Event used by the log checkpointer thread to wait for requests.
Definition: log0sys.h:683
int64_t current_ready_waiting_sig_count
current_ready_waiting_lsn is waited using this sig_count.
Definition: log0sys.h:152
Log_checkpoint_header_no next_checkpoint_header_no
Next checkpoint header to use.
Definition: log0sys.h:700
atomic_sn_t sn_locked
Intended sn value while x-locked.
Definition: log0sys.h:105
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:284
std::atomic_bool should_stop_threads
Used for stopping the log background threads.
Definition: log0sys.h:524
ut::unordered_set< Log_consumer * > m_consumers
Set of registered redo log consumers.
Definition: log0sys.h:511
ib_mutex_t closer_mutex
Mutex which can be used to pause log closer thread.
Definition: log0sys.h:358
atomic_sn_t concurrency_margin
Margin used in calculation of.
Definition: log0sys.h:659
atomic_lsn_t free_check_limit_lsn
Maximum lsn up to which there is free space in the redo log.
Definition: log0sys.h:655
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:173
std::atomic_bool writer_threads_paused
Used for pausing the log writer threads.
Definition: log0sys.h:146
byte m_encryption_buf[OS_FILE_LOG_BLOCK_SIZE]
Buffer that contains encryption meta data encrypted with master key.
Definition: log0sys.h:475
atomic_lsn_t write_notifier_resume_lsn
Used for resuming write notifier thread.
Definition: log0sys.h:530
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:426
bool disable_redo_writes
When this is set, writing to the redo log should be disabled.
Definition: log0sys.h:574
uint32_t write_ahead_buf_size
Size of buffer used for the write-ahead (in bytes).
Definition: log0sys.h:271
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:454
os_event_t writer_event
Definition: log0sys.h:334
ib_mutex_t m_files_mutex
Mutex protecting set of existing log files and their meta data.
Definition: log0sys.h:411
THD * m_writer_thd
THD used by the log_writer thread.
Definition: log0sys.h:331
Encryption_metadata m_encryption_metadata
Encryption metadata.
Definition: log0sys.h:489
int64_t current_flush_sig_count
The next flushed_to_disk_lsn can be waited using this sig_count.
Definition: log0sys.h:377
lsn_t current_ready_waiting_lsn
Some threads waiting for the ready for write lsn by closer_event.
Definition: log0sys.h:149
bool m_requested_files_consumption
True iff log_writer is waiting for a next log file available.
Definition: log0sys.h:434
atomic_lsn_t flush_notifier_resume_lsn
Used for resuming flush notifier thread.
Definition: log0sys.h:533
std::atomic_bool m_allow_checkpoints
If checkpoints are allowed.
Definition: log0sys.h:640
Log_clock_point last_flush_end_time
Last flush end time.
Definition: log0sys.h:250
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:615
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:398
Log_files_context m_files_ctx
Context for all operations on redo log files from log0files_io.h.
Definition: log0sys.h:414
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:374
struct PSI_rwlock * pfs_psi
The instrumentation hook.
Definition: log0sys.h:137
atomic_lsn_t last_checkpoint_lsn
Latest checkpoint lsn.
Definition: log0sys.h:695
size_t flush_events_size
Number of entries in the array with events.
Definition: log0sys.h:225
lsn_t m_oldest_need_lsn_lowerbound
A recently seen value of log_consumer_get_oldest()->get_consumed_lsn().
Definition: log0sys.h:342
ib_mutex_t writer_mutex
Mutex which can be used to pause log writer thread.
Definition: log0sys.h:327
THD * m_files_governor_thd
THD used by the log_files_governor thread.
Definition: log0sys.h:465
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:222
os_event_t m_files_governor_event
Event used by log files governor thread to wait.
Definition: log0sys.h:441
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:664
atomic_lsn_t flushed_to_disk_lsn
Up to this lsn data has been flushed to disk (fsynced).
Definition: log0sys.h:233
ib_mutex_t flush_notifier_mutex
Mutex which can be used to pause log flush notifier thread.
Definition: log0sys.h:380
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:230
ib_mutex_t write_notifier_mutex
Mutex which can be used to pause log write notifier thread.
Definition: log0sys.h:393
Log_uuid m_log_uuid
Log UUID.
Definition: log0sys.h:565
os_event_t m_file_removed_event
Event used for waiting on next file available.
Definition: log0sys.h:471
Log_file_handle m_current_file_handle
Handle for the opened m_current_file.
Definition: log0sys.h:310
ib_mutex_t sn_x_lock_mutex
Mutex which can be used for x-lock sn value.
Definition: log0sys.h:108
Log_files_capacity m_capacity
Capacity limits for the redo log.
Definition: log0sys.h:430
os_event_t closer_event
Event used by the log closer thread to wait for tasks.
Definition: log0sys.h:355
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:123
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:712
atomic_sn_t dict_persist_margin
Margin used in calculation of.
Definition: log0sys.h:670
Log_flags m_log_flags
Log flags.
Definition: log0sys.h:562
rw_lock_t * sn_lock_inst
The rw_lock instance only for the debug info list.
Definition: log0sys.h:94
os_event_t writer_threads_resume_event
Event used for pausing the log writer threads.
Definition: log0sys.h:527
time_t last_printout_time
Wall time when we printed the statistics last time.
Definition: log0sys.h:540
ib_mutex_t flusher_mutex
Mutex which can be used to pause log flusher thread.
Definition: log0sys.h:256
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:187
lsn_t available_for_checkpoint_lsn
A new checkpoint could be written for this lsn value.
Definition: log0sys.h:607
Link_buf< lsn_t > recent_written
The recent written buffer.
Definition: log0sys.h:142
uint64_t n_log_ios
Number of performed IO operations (only for printing stats).
Definition: log0sys.h:322
Log_files_stats m_files_stats
Statistics related to redo log files consumption and creation.
Definition: log0sys.h:438
size_t write_events_size
Number of entries in the array with writer_events.
Definition: log0sys.h:190
Link_buf< lsn_t > recent_closed
The recent closed buffer.
Definition: log0sys.h:156
atomic_lsn_t write_lsn
Up to this lsn, data has been written to disk (fsync not required).
Definition: log0sys.h:177
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:317
InnoDB condition variable.
Definition: os0event.cc:62
The structure used in the spin lock implementation of a read-write lock.
Definition: sync0rw.h:359
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...