MySQL 8.0.32
Source Code Documentation
log0files_capacity.cc File Reference

physical_capacity (total size on disk except tmp files) | +- *2/LOG_N_FILES | ("snake's head&tail cages") | +- *FREE_RATIO ("the snake's body") | +- OVERHEAD | (space which shouldn't be used for deltas) | | | +- (LOG_N_FILES - 1) * LOG_FILE_HDR_SIZE | | (file headers in cages with snake's body) | | | +- LOG_EXTRA_SAFETY_MARGIN | (just in case) | +- lsn_capacity (space to use for deltas) | +- next_file_earlier_margin | ("snake's tongue" - we want to never need more than LOG_N_FILES-1) | +- hard_logical_capacity (this is how log writer sees the capacity) | +- *LOG_EXTRA_WRITER_MARGIN_PCT/100 | (log writer's private workspace to pull of "desperate rescue") | +- soft_logical_capacity (this is how threads other than log writer see the capacity) | +- free_check_margin | (it's "reserved" - you may write to it, if you did reservation) | | | +- concurrency_margin More...

#include <cmath>
#include "arch0arch.h"
#include "log0chkp.h"
#include "log0files_capacity.h"
#include "log0log.h"
#include "log0sys.h"
#include "log0test.h"
#include "log0types.h"
#include "srv0conc.h"
#include "srv0mon.h"
#include "srv0start.h"
#include "ut0byte.h"

Functions

void log_files_capacity_get_limits (const log_t &log, lsn_t &limit_for_free_check, lsn_t &limit_for_dirty_page_age)
 Retrieves limitations determined by the current state of log.m_capacity. More...
 

Detailed Description

physical_capacity (total size on disk except tmp files) | +- *2/LOG_N_FILES | ("snake's head&tail cages") | +- *FREE_RATIO ("the snake's body") | +- OVERHEAD | (space which shouldn't be used for deltas) | | | +- (LOG_N_FILES - 1) * LOG_FILE_HDR_SIZE | | (file headers in cages with snake's body) | | | +- LOG_EXTRA_SAFETY_MARGIN | (just in case) | +- lsn_capacity (space to use for deltas) | +- next_file_earlier_margin | ("snake's tongue" - we want to never need more than LOG_N_FILES-1) | +- hard_logical_capacity (this is how log writer sees the capacity) | +- *LOG_EXTRA_WRITER_MARGIN_PCT/100 | (log writer's private workspace to pull of "desperate rescue") | +- soft_logical_capacity (this is how threads other than log writer see the capacity) | +- free_check_margin | (it's "reserved" - you may write to it, if you did reservation) | | | +- concurrency_margin

(space jointly reserved by threads in log_free_check_wait)
+- margin_per_thread * max_total_threads
+- LOG_FILES_DUMMY_INTAKE_SIZE

| | | (dummy intake which might be required during redo resize) | | | | | +- LOG_EXTRA_CONC_MARGIN_PCT / 100.0 * soft_logical_capacity | | (just in case) | | | +- dict_persist_margin | (reserved for future dd metadata changes writes on checkpoint) | +- log_free_check_capacity (if redo is this long threads should wait in log_free_check_wait)

Function Documentation

◆ log_files_capacity_get_limits()

void log_files_capacity_get_limits ( const log_t log,
lsn_t limit_for_free_check,
lsn_t limit_for_dirty_page_age 
)

Retrieves limitations determined by the current state of log.m_capacity.

These values are retrieved atomically (are consistent with each other).

Parameters
[in]logredo log
[out]limit_for_free_checksoft capacity of the redo decreased by the current free check margin; this is limit for size of redo until which the log_free_check calls do not force waits
[out]limit_for_dirty_page_agelimit for the oldest dirty page until which the async (adaptive) flushing is not forced to be started (it might be started if turned on explicitly by the innodb_adaptive_flushing); note that computation of this value include doing the subtraction of the current log free check margin