MySQL 9.1.0
Source Code Documentation
log_files Namespace Reference

Functions

static os_offset_t physical_size (const log_t &log, os_offset_t unused_file_size)
 
static bool physical_capacity_allows_to_recycle (const log_t &log, os_offset_t removed_file_size, os_offset_t unused_file_size)
 
static bool physical_capacity_allows_to_create (const log_t &log, os_offset_t unused_file_size)
 
static size_t number_of_files (const log_t &log)
 
static bool is_newest_lsn_nearby_the_end (const log_t &log)
 
static bool number_of_files_enforced_to_allow (const log_t &log)
 
static bool number_of_files_allows_to_recycle (const log_t &log)
 Checks if current number of redo files allows to recycle the oldest one. More...
 
static bool number_of_files_allows_to_create (const log_t &log)
 Checks if current number of redo files allows to create a new unused file. More...
 
static bool might_recycle_file (const log_t &log, os_offset_t removed_file_size, os_offset_t unused_file_size)
 
static bool might_create_unused_file (const log_t &log, os_offset_t unused_file_size)
 
bool is_consumption_needed (const log_t &log)
 Checks if consumption of the oldest redo log files needs to be done or might be postponed. More...
 

Function Documentation

◆ is_consumption_needed()

bool log_files::is_consumption_needed ( const log_t log)

Checks if consumption of the oldest redo log files needs to be done or might be postponed.

Remarks
This check is being used in order to keep more log files, even if according to all registered redo log consumers, they are not needed anymore. The motivation for that is to support external redo consumers which are not being registered and preserve for them comparable chances to succeed to chances they had in older versions of MySQL. This is just to be gentle, and this is not always guaranteed. In particular, we do not provide such properties when it is not comfortable for the InnoDB. This function is supposed to tell when it is comfortable for InnoDB to provide such properties. The log files consumption must not be postponed in any of the following cases:
  1. The log_files_governor has been explicitly requested to consume more files, which could happen e.g. in mtr test awaiting until there is just one file, or when there is no next file (in which case requested by log_writer).
  2. There are no spare (unused) log files (at least one is needed for log_writer so it could switch to a next log file smoothly if it needed to do so).
  3. Redo log is supposed to be resized down (current_capacity hasn't yet reached the target_capacity).
  4. Redo log is supposed to be resized up (unused files might be resized easily so it is preferable to consume files).
Parameters
[in]logredo log
Returns
true iff redo log files consumption is needed

◆ is_newest_lsn_nearby_the_end()

static bool log_files::is_newest_lsn_nearby_the_end ( const log_t log)
static

◆ might_create_unused_file()

static bool log_files::might_create_unused_file ( const log_t log,
os_offset_t  unused_file_size 
)
static

◆ might_recycle_file()

static bool log_files::might_recycle_file ( const log_t log,
os_offset_t  removed_file_size,
os_offset_t  unused_file_size 
)
static

◆ number_of_files()

static size_t log_files::number_of_files ( const log_t log)
static

◆ number_of_files_allows_to_create()

static bool log_files::number_of_files_allows_to_create ( const log_t log)
static

Checks if current number of redo files allows to create a new unused file.

See also
number_of_files_allows_to_recycle
Returns
true iff allowed to create unused file according to number of files

◆ number_of_files_allows_to_recycle()

static bool log_files::number_of_files_allows_to_recycle ( const log_t log)
static

Checks if current number of redo files allows to recycle the oldest one.

Remarks
The strategy is to keep the total number of log files equal to LOG_N_FILES (including unused files), unless the newest_lsn is close to the end of file and there are no unused files (in which case, the creation is also allowed, because at least one unused file is allowed, as long as we won't exceed current_physical_capacity, which is checked by the caller).
Returns
true iff allowed to recycle log file according to number of files

◆ number_of_files_enforced_to_allow()

static bool log_files::number_of_files_enforced_to_allow ( const log_t log)
static

◆ physical_capacity_allows_to_create()

static bool log_files::physical_capacity_allows_to_create ( const log_t log,
os_offset_t  unused_file_size 
)
static

◆ physical_capacity_allows_to_recycle()

static bool log_files::physical_capacity_allows_to_recycle ( const log_t log,
os_offset_t  removed_file_size,
os_offset_t  unused_file_size 
)
static

◆ physical_size()

static os_offset_t log_files::physical_size ( const log_t log,
os_offset_t  unused_file_size 
)
static