136#ifndef UNIV_HOTBACKUP
148 const sn_t sn = log.
sn.load();
242 lsn_t &new_files_lsn);
255 bool allow_checkpoints =
true);
314#define log_limits_mutex_enter(log) mutex_enter(&((log).limits_mutex))
316#define log_limits_mutex_exit(log) mutex_exit(&((log).limits_mutex))
318#define log_limits_mutex_own(log) mutex_own(&(log).limits_mutex)
344 lsn_t *checkpoint_lsn);
dberr_t
Definition: db0err.h:39
static Bigint * diff(Bigint *a, Bigint *b, Stack_alloc *alloc)
Definition: dtoa.cc:1076
constexpr sn_t SN_LOCKED
The sn bit to express locked state.
Definition: log0constants.h:162
constexpr lsn_t LOG_START_LSN
The counting of lsn's starts from this value: this must be non-zero.
Definition: log0constants.h:153
constexpr uint32_t LOG_BLOCK_HDR_SIZE
Size of the log block's header in bytes.
Definition: log0constants.h:297
constexpr uint32_t LOG_BLOCK_DATA_SIZE
Size of log block's data fragment (where actual data is stored).
Definition: log0constants.h:312
constexpr uint32_t LOG_BLOCK_TRL_SIZE
Size of the log block footer (trailer) in bytes.
Definition: log0constants.h:306
Redo log management of capacity.
In-memory dictionary of log files (keeps their meta data).
Redo log management of log files.
void log_update_exported_variables(const log_t &log)
Definition: log0log.cc:1208
void log_position_collect_lsn_info(const log_t &log, lsn_t *current_lsn, lsn_t *checkpoint_lsn)
Collect coordinates in the locked redo log.
Definition: log0log.cc:1466
sn_t log_translate_lsn_to_sn(lsn_t lsn)
Calculates sn value for given lsn value.
Definition: log0log.h:94
dberr_t log_start(log_t &log, lsn_t checkpoint_lsn, lsn_t start_lsn, bool allow_checkpoints=true)
Starts the initialized redo log system using a provided checkpoint_lsn and current lsn.
Definition: log0log.cc:711
void log_persist_crash_safe(log_t &log)
Persist the information that it is safe to restart server.
Definition: log0log.cc:1528
void log_background_threads_inactive_validate()
Validates that all the log background threads are inactive.
Definition: log0log.cc:900
void log_persist_enable(log_t &log)
Enable redo logging and persist the information.
Definition: log0log.cc:1514
void log_crash_safe_validate(log_t &log)
Asserts that the log is not marked as crash-unsafe.
Definition: log0log.cc:1543
void log_make_empty_and_stop_background_threads(log_t &log)
Function similar to.
Definition: log0log.cc:1018
void log_wait_for_space(log_t &log, sn_t end_sn)
Waits until there is free space for range of sn values ending at the provided sn, in both the log buf...
bool log_is_data_lsn(lsn_t lsn)
Validates a given lsn value.
Definition: log0log.h:127
void log_write_ahead_resize(log_t &log, size_t new_size)
Resizes the write ahead buffer in the redo log.
Definition: log0log.cc:1299
void log_background_threads_active_validate(const log_t &log)
Validates that all the log background threads are active.
Definition: log0log.cc:891
void log_position_lock(log_t &log)
Lock redo log.
Definition: log0log.cc:1454
void log_stop_background_threads(log_t &log)
Stops all the log background threads.
Definition: log0log.cc:956
void log_position_unlock(log_t &log)
Unlock the locked redo log.
Definition: log0log.cc:1460
void log_print(const log_t &log, FILE *file)
Prints information about important lsn values used in the redo log, and some statistics about speed o...
Definition: log0log.cc:1133
lsn_t log_get_lsn(const log_t &log)
Gets the current lsn value.
Definition: log0log.h:168
void log_persist_disable(log_t &log)
Disable redo logging and persist the information.
Definition: log0log.cc:1521
static sn_t log_get_sn(const log_t &log)
Definition: log0log.h:147
void log_wake_threads(log_t &log)
Wakes up all log threads which are alive.
Definition: log0log.cc:1034
void log_sys_close()
Close the log system and free all the related memory.
Definition: log0log.cc:1913
void log_persist_initialized(log_t &log)
Marks the redo log files as belonging to the initialized data directory with initialized set of redo ...
Definition: log0log.cc:1535
void log_start_background_threads(log_t &log)
Starts all the log background threads.
Definition: log0log.cc:909
dberr_t log_sys_init(bool expect_no_files, lsn_t flushed_lsn, lsn_t &new_files_lsn)
Initializes log_sys and finds existing redo log files, or creates a new set of redo log files.
Definition: log0log.cc:1661
constexpr lsn_t log_translate_sn_to_lsn(sn_t sn)
Calculates lsn value for given sn value.
Definition: log0log.h:85
void log_stop_background_threads_nowait(log_t &log)
Marks the flag which tells log threads to stop and wakes them.
Definition: log0log.cc:1011
void log_refresh_stats(log_t &log)
Refreshes the statistics used to print per-second averages in log_print().
Definition: log0log.cc:1203
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
const std::string FILE("FILE")
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:196
Redo log - single data structure with state of the redo log system.
Definition: log0sys.h:77
atomic_sn_t sn
Current sn value.
Definition: log0sys.h:103
atomic_sn_t sn_locked
Intended sn value while x-locked.
Definition: log0sys.h:106
static uint64_t lsn
Definition: xcom_base.cc:446