InnoDB Plugin  1.0
Data Fields
log_t Struct Reference

#include <log0log.h>

Collaboration diagram for log_t:
Collaboration graph
[legend]

Data Fields

byte pad [64]
lsn_t lsn
ulint buf_free
ib_mutex_t mutex
ib_mutex_t log_flush_order_mutex
byte * buf_ptr
byte * buf
ulint buf_size
ulint max_buf_free
ibool check_flush_or_checkpoint
ut_list_base< log_group_tlog_groups
ulint buf_next_to_write
volatile bool is_extending
lsn_t written_to_some_lsn
lsn_t written_to_all_lsn
lsn_t write_lsn
ulint write_end_offset
lsn_t current_flush_lsn
lsn_t flushed_to_disk_lsn
ulint n_pending_writes
os_event_t no_flush_event
ibool one_flushed
os_event_t one_flushed_event
ulint n_log_ios
ulint n_log_ios_old
time_t last_printout_time
lsn_t log_group_capacity
lsn_t max_modified_age_async
lsn_t max_modified_age_sync
lsn_t max_checkpoint_age_async
lsn_t max_checkpoint_age
ib_uint64_t next_checkpoint_no
lsn_t last_checkpoint_lsn
lsn_t next_checkpoint_lsn
ulint n_pending_checkpoint_writes
rw_lock_t checkpoint_lock
byte * checkpoint_buf_ptr
byte * checkpoint_buf

Detailed Description

Redo log buffer

Field Documentation

byte* log_t::buf

log buffer

ulint log_t::buf_free

first free offset within the log buffer

ulint log_t::buf_next_to_write

The fields involved in the log buffer flush first offset in the log buffer where the byte content may not exist written to file, e.g., the start offset of a log record catenated later; this is advanced when a flush operation is completed to all the log groups

ulint log_t::buf_size

log buffer size in bytes

ibool log_t::check_flush_or_checkpoint

this is set to TRUE when there may be need to flush the log buffer, or preflush buffer pool pages, or make a checkpoint; this MUST be TRUE when lsn - last_checkpoint_lsn > max_checkpoint_age; this flag is peeked at by log_free_check(), which does not reserve the log mutex

byte* log_t::checkpoint_buf

checkpoint header is read to this buffer

rw_lock_t log_t::checkpoint_lock

this latch is x-locked when a checkpoint write is running; a thread should wait for this without owning the log mutex

lsn_t log_t::current_flush_lsn

end lsn for the current running write + flush operation

lsn_t log_t::flushed_to_disk_lsn

how far we have written the log AND flushed to disk

volatile bool log_t::is_extending

this is set to true during extend the log buffer size

lsn_t log_t::last_checkpoint_lsn

latest checkpoint lsn

time_t log_t::last_printout_time

when log_print was last time called

ib_mutex_t log_t::log_flush_order_mutex

mutex to serialize access to the flush list when we are putting dirty blocks in the list. The idea behind this mutex is to be able to release log_sys->mutex during mtr_commit and still ensure that insertions in the flush_list happen in the LSN order.

lsn_t log_t::log_group_capacity

Fields involved in checkpoints capacity of the log group; if the checkpoint age exceeds this, it is a serious error because it is possible we will then overwrite log and spoil crash recovery

ut_list_base< log_group_t > log_t::log_groups

log groups

lsn_t log_t::lsn

log sequence number

ulint log_t::max_buf_free

recommended maximum value of buf_free, after which the buffer is flushed

lsn_t log_t::max_checkpoint_age

this is the maximum allowed value for lsn - last_checkpoint_lsn when a new query step is started

lsn_t log_t::max_checkpoint_age_async

when this checkpoint age is exceeded we start an asynchronous writing of a new checkpoint

lsn_t log_t::max_modified_age_async

when this recommended value for lsn - buf_pool_get_oldest_modification() is exceeded, we start an asynchronous preflush of pool pages

lsn_t log_t::max_modified_age_sync

when this recommended value for lsn - buf_pool_get_oldest_modification() is exceeded, we start a synchronous preflush of pool pages

ib_mutex_t log_t::mutex

mutex protecting the log

ulint log_t::n_log_ios

number of log i/os initiated thus far

ulint log_t::n_log_ios_old

number of log i/o's at the previous printout

ulint log_t::n_pending_checkpoint_writes

number of currently pending checkpoint writes

ulint log_t::n_pending_writes

number of currently pending flushes or writes

lsn_t log_t::next_checkpoint_lsn

next checkpoint lsn

ib_uint64_t log_t::next_checkpoint_no

next checkpoint number

os_event_t log_t::no_flush_event

this event is in the reset state when a flush or a write is running; a thread should wait for this without owning the log mutex, but NOTE that to set or reset this event, the thread MUST own the log mutex!

ibool log_t::one_flushed

during a flush, this is first FALSE and becomes TRUE when one log group has been written or flushed

os_event_t log_t::one_flushed_event

this event is reset when the flush or write has not yet completed for any log group; e.g., this means that a transaction has been committed when this is set; a thread should wait for this without owning the log mutex, but NOTE that to set or reset this event, the thread MUST own the log mutex!

byte log_t::pad[64]

padding to prevent other memory update hotspots from residing on the same memory cache line

ulint log_t::write_end_offset

the data in buffer has been written up to this offset when the current write ends: this field will then be copied to buf_next_to_write

lsn_t log_t::write_lsn

end lsn for the current running write

lsn_t log_t::written_to_all_lsn

first log sequence number not yet written to some log group; for this to be advanced, it is enough that the write i/o has been completed for all log groups. Note that since InnoDB currently has only one log group therefore this value is redundant. Also it is possible that this value falls behind the flushed_to_disk_lsn transiently. It is appropriate to use either flushed_to_disk_lsn or write_lsn which are always up-to-date and accurate.

lsn_t log_t::written_to_some_lsn

first log sequence number not yet written to any log group; for this to be advanced, it is enough that the write i/o has been completed for any one log group


The documentation for this struct was generated from the following file: