76#define log_checkpointer_mutex_enter(log) \
77 mutex_enter(&((log).checkpointer_mutex))
79#define log_checkpointer_mutex_exit(log) mutex_exit(&((log).checkpointer_mutex))
81#define log_checkpointer_mutex_own(log) \
82 (mutex_own(&((log).checkpointer_mutex)) || !log_checkpointer_is_active())
116 if (current_lsn <= last_checkpoint_lsn) {
127 return current_lsn - last_checkpoint_lsn;
388 lsn_t checkpoint_lsn,
389 lsn_t file_start_lsn);
Handle which allows to do reads / writes for the opened file.
Definition: log0types.h:309
dberr_t
Definition: db0err.h:39
lsn_t log_get_checkpoint_age(const log_t &log)
Calculates age of current checkpoint as number of bytes since last checkpoint.
Definition: log0chkp.h:111
bool log_request_latest_checkpoint(log_t &log, lsn_t &requested_lsn)
Requests a checkpoint at the current lsn.
Definition: log0chkp.cc:666
void log_free_check_validate()
Performs debug checks to validate some of the assumptions.
Definition: log0chkp.cc:1254
bool log_free_check_is_required(const log_t &log)
Checks if log_free_check() call should better be executed.
Definition: log0chkp.h:254
lsn_t log_get_checkpoint_lsn(const log_t &log)
Gets the last checkpoint lsn stored and flushed to disk.
Definition: log0chkp.h:96
void log_update_concurrency_margin(log_t &log)
Updates log.concurrency_margin and log.concurrency_margin_is_safe for the current capacity of the red...
Definition: log0chkp.cc:1160
dberr_t log_files_write_first_data_block_low(log_t &log, Log_file_handle &file_handle, lsn_t checkpoint_lsn, lsn_t file_start_lsn)
Writes the first data block to the log file using the provided handle to the opened log file.
Definition: log0chkp.cc:519
lsn_t log_free_check_capacity(const log_t &log, lsn_t free_check_margin)
Computes capacity of redo log available until log_free_check() needs to wait.
Definition: log0chkp.cc:1209
void log_request_checkpoint_in_next_file(log_t &log)
Requests a checkpoint written in the next log file (not in the one, to which current log....
Definition: log0chkp.cc:660
void log_free_check_wait(log_t &log)
Waits until there is free space in log files which includes concurrency margin required for all threa...
Definition: log0chkp.cc:1221
void log_set_dict_max_allowed_checkpoint_lsn(log_t &log, lsn_t max_lsn)
Updates the field log.dict_max_allowed_checkpoint_lsn.
Definition: log0chkp.cc:323
lsn_t log_free_check_margin(const log_t &log)
Provides current margin used in the log_free_check calls.
Definition: log0chkp.cc:1201
void log_free_check(log_t &log)
Reserves free_check_margin in the redo space for the current thread.
Definition: log0chkp.h:277
bool log_checkpointer_is_active()
Checks if log checkpointer thread is active.
Definition: log0chkp.h:72
sn_t log_concurrency_margin(lsn_t log_capacity, bool &is_safe)
Computes concurrency margin to be used within log_free_check calls, for a given redo log capacity (so...
Definition: log0chkp.cc:1085
void log_update_limits_low(log_t &log)
Updates log.free_check_limit_lsn in the log.
Definition: log0chkp.cc:1174
dberr_t log_files_next_checkpoint(log_t &log, lsn_t lsn)
Writes the next checkpoint to the log file, by writing a single checkpoint header with the checkpoint...
Definition: log0chkp.cc:350
bool log_make_latest_checkpoint(log_t &log)
Make a checkpoint at the current lsn.
Definition: log0chkp.cc:689
void log_checkpointer(log_t *log_ptr)
The log checkpointer thread routine.
Definition: log0chkp.cc:977
void log_set_dict_persist_margin(log_t &log, sn_t margin)
Updates log.dict_persist_margin and recompute free check limit.
Definition: log0chkp.cc:1194
void log_request_checkpoint(log_t &log, bool sync)
Requests a fuzzy checkpoint write (for currently available lsn).
Definition: log0chkp.cc:594
dberr_t log_files_write_checkpoint_low(log_t &log, Log_file_handle &checkpoint_file_handle, Log_checkpoint_header_no checkpoint_header_no, lsn_t next_checkpoint_lsn)
Writes checkpoint to the file containing the written checkpoint_lsn.
Definition: log0chkp.cc:440
Log_checkpoint_header_no log_next_checkpoint_header(Log_checkpoint_header_no checkpoint_header_no)
Provides opposite checkpoint header number to the given checkpoint header number.
Definition: log0chkp.cc:428
lsn_t log_sync_flush_lsn(log_t &log)
Computes lsn up to which sync flush should be done or returns 0 if there is no need to execute sync f...
Definition: log0chkp.cc:761
Redo log - the main header.
lsn_t log_get_lsn(const log_t &log)
Gets the current lsn value.
Definition: log0log.h:168
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
uint64_t sn_t
Type used for sn values, which enumerate bytes of data stored in the log.
Definition: log0types.h:86
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:63
bool srv_thread_is_active(const IB_thread &thread)
Check if given thread is still active.
Definition: srv0srv.cc:3261
bool srv_read_only_mode
Set if InnoDB must operate in read-only mode.
Definition: srv0srv.cc:200
Srv_threads srv_threads
Structure with state of srv background threads.
Definition: srv0srv.cc:104
IB_thread m_log_checkpointer
Redo checkpointer thread.
Definition: srv0srv.h:176
Redo log - single data structure with state of the redo log system.
Definition: log0sys.h:77
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_lsn_t last_checkpoint_lsn
Latest checkpoint lsn.
Definition: log0sys.h:701
Debug checks for latches, header file.
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:107
static uint64_t lsn
Definition: xcom_base.cc:446