77struct alignas(ut::INNODB_CACHE_LINE_SIZE)
log_t {
126#ifdef UNIV_PFS_RWLOCK
325#ifndef UNIV_HOTBACKUP
492#ifndef UNIV_HOTBACKUP
728#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:34
Lightweight convenience wrapper which manages a dynamically allocated array of over-aligned types.
Definition: ut0new.h:2018
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:435
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:2888
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:189
uint64_t os_offset_t
File offset in bytes.
Definition: os0file.h:84
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:709
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:254
lsn_t recovered_lsn
Lsn from which recovery has been started.
Definition: log0sys.h:554
lsn_t dict_max_allowed_checkpoint_lsn
Maximum lsn allowed for checkpoint by dict_persist or zero.
Definition: log0sys.h:628
os_event_t flusher_event
Definition: log0sys.h:259
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:281
os_event_t next_checkpoint_event
Event signaled when last_checkpoint_lsn is advanced by the log_checkpointer thread.
Definition: log0sys.h:705
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:449
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:717
bool periodical_checkpoints_enabled
If should perform checkpoints every innodb_log_checkpoint_every ms.
Definition: log0sys.h:634
ib_mutex_t limits_mutex
Mutex which protects fields: available_for_checkpoint_lsn, requested_checkpoint_lsn.
Definition: log0sys.h:596
Log_format m_format
Format of the redo log: e.g., Log_format::CURRENT.
Definition: log0sys.h:557
uint64_t n_log_ios_old
Number of total I/O operations performed when we printed the statistics last time.
Definition: log0sys.h:538
std::string m_creator_name
Log creator name.
Definition: log0sys.h:560
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:297
lsn_t m_scanned_lsn
Used only in recovery: recovery scan succeeded up to this lsn.
Definition: log0sys.h:569
std::atomic< uint64_t > write_to_file_requests_total
Approx.
Definition: log0sys.h:195
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:689
std::atomic< std::chrono::microseconds > write_to_file_requests_interval
How often redo write/flush is requested in average.
Definition: log0sys.h:201
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:462
Log_clock_point last_flush_start_time
Last flush start time.
Definition: log0sys.h:247
Log_files_dict m_files
The in-memory dictionary of log files.
Definition: log0sys.h:419
os_event_t checkpointer_event
Event used by the log checkpointer thread to wait for requests.
Definition: log0sys.h:684
int64_t current_ready_waiting_sig_count
current_ready_waiting_lsn is waited using this sig_count.
Definition: log0sys.h:153
Log_checkpoint_header_no next_checkpoint_header_no
Next checkpoint header to use.
Definition: log0sys.h:701
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:285
std::atomic_bool should_stop_threads
Used for stopping the log background threads.
Definition: log0sys.h:525
ut::unordered_set< Log_consumer * > m_consumers
Set of registered redo log consumers.
Definition: log0sys.h:512
ib_mutex_t closer_mutex
Mutex which can be used to pause log closer thread.
Definition: log0sys.h:359
atomic_sn_t concurrency_margin
Margin used in calculation of.
Definition: log0sys.h:660
atomic_lsn_t free_check_limit_lsn
Maximum lsn up to which there is free space in the redo log.
Definition: log0sys.h:656
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:174
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:476
atomic_lsn_t write_notifier_resume_lsn
Used for resuming write notifier thread.
Definition: log0sys.h:531
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:575
uint32_t write_ahead_buf_size
Size of buffer used for the write-ahead (in bytes).
Definition: log0sys.h:272
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:455
os_event_t writer_event
Definition: log0sys.h:335
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:332
Encryption_metadata m_encryption_metadata
Encryption metadata.
Definition: log0sys.h:490
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:150
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:534
std::atomic_bool m_allow_checkpoints
If checkpoints are allowed.
Definition: log0sys.h:641
Log_clock_point last_flush_end_time
Last flush end time.
Definition: log0sys.h:251
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:616
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:696
size_t flush_events_size
Number of entries in the array with events.
Definition: log0sys.h:226
lsn_t m_oldest_need_lsn_lowerbound
A recently seen value of log_consumer_get_oldest()->get_consumed_lsn().
Definition: log0sys.h:343
ib_mutex_t writer_mutex
Mutex which can be used to pause log writer thread.
Definition: log0sys.h:328
THD * m_files_governor_thd
THD used by the log_files_governor thread.
Definition: log0sys.h:466
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:223
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:665
atomic_lsn_t flushed_to_disk_lsn
Up to this lsn data has been flushed to disk (fsynced).
Definition: log0sys.h:234
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:231
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:566
os_event_t m_file_removed_event
Event used for waiting on next file available.
Definition: log0sys.h:472
Log_file_handle m_current_file_handle
Handle for the opened m_current_file.
Definition: log0sys.h:311
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 the log closer thread to wait for tasks.
Definition: log0sys.h:356
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:713
atomic_sn_t dict_persist_margin
Margin used in calculation of.
Definition: log0sys.h:671
Log_flags m_log_flags
Log flags.
Definition: log0sys.h:563
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:528
time_t last_printout_time
Wall time when we printed the statistics last time.
Definition: log0sys.h:541
ib_mutex_t flusher_mutex
Mutex which can be used to pause log flusher thread.
Definition: log0sys.h:257
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:188
lsn_t available_for_checkpoint_lsn
A new checkpoint could be written for this lsn value.
Definition: log0sys.h:608
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:323
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:191
Link_buf< lsn_t > recent_closed
The recent closed buffer.
Definition: log0sys.h:157
atomic_lsn_t write_lsn
Up to this lsn, data has been written to disk (fsync not required).
Definition: log0sys.h:178
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:318
InnoDB condition variable.
Definition: os0event.cc:63
The structure used in the spin lock implementation of a read-write lock.
Definition: sync0rw.h:360
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...