MySQL 8.0.39
Source Code Documentation
|
Redo log management of log files. More...
#include "log0files_dict.h"
#include "log0files_finder.h"
#include "log0types.h"
#include "os0file.h"
#include "srv0srv.h"
Go to the source code of this file.
Macros | |
#define | log_files_mutex_enter(log) mutex_enter(&((log).m_files_mutex)) |
#define | log_files_mutex_exit(log) mutex_exit(&((log).m_files_mutex)) |
#define | log_files_mutex_own(log) mutex_own(&((log).m_files_mutex)) |
Functions | |
bool | log_files_governor_is_active () |
Checks if log file governor thread is active. More... | |
dberr_t | log_files_create (log_t &log, lsn_t flushed_lsn) |
Creates a new set of redo log files. More... | |
void | log_files_remove (log_t &log) |
Removes all log files. More... | |
dberr_t | log_files_produce_file (log_t &log) |
Creates a next log file, ready for writes. More... | |
dberr_t | log_files_persist_flags (log_t &log, Log_flags log_flags) |
Persists log flags to the newest log file. More... | |
dberr_t | log_files_reset_creator_and_set_full (log_t &log) |
Resets creator name to the current creator and marks all files as full in their headers by setting LOG_HEADER_FLAG_FILE_FULL bit in the log_flags field. More... | |
void | log_files_wait_for_next_file_available (log_t &log) |
Waits until a next log file is available and can be produced. More... | |
void | log_files_governor (log_t *log_ptr) |
The log files governor thread routine. More... | |
dberr_t | log_files_start (log_t &log) |
Starts the log file management. More... | |
void | log_files_initialize_on_empty_redo (log_t &log) |
Computes initial capacity limits and size suggested for the next log file. More... | |
void | log_files_initialize_on_existing_redo (log_t &log) |
Computes initial capacity limits and size suggested for the next log file. More... | |
void | log_files_resize_requested (log_t &log) |
Updates capacity limitations after srv_redo_log_capacity_used has been changed. More... | |
void | log_files_thread_concurrency_updated (log_t &log) |
Updates capacity limitations after srv_thread_concurrency has been changed. More... | |
void | log_files_dummy_records_disable (log_t &log) |
Disallows to generate dummy redo records and waits until the log_files_governor thread promised not to generate them. More... | |
void | log_files_dummy_records_request_disable (log_t &log) |
Disallows to generate dummy redo records but does not wait until the log_files_governor promised not to generate them anymore. More... | |
void | log_files_update_encryption (log_t &log, const Encryption_metadata &encryption_metadata) |
Updates the encryption metadata stored in-memory for all redo log files. More... | |
Redo log management of log files.
#define log_files_mutex_enter | ( | log | ) | mutex_enter(&((log).m_files_mutex)) |
#define log_files_mutex_exit | ( | log | ) | mutex_exit(&((log).m_files_mutex)) |
#define log_files_mutex_own | ( | log | ) | mutex_own(&((log).m_files_mutex)) |
Creates a new set of redo log files.
[in,out] | log | redo log |
[in] | flushed_lsn | the new set of log files should start with log block in which flushed_lsn is located, and flushed_lsn should point right after this block header. |
void log_files_dummy_records_disable | ( | log_t & | log | ) |
Disallows to generate dummy redo records and waits until the log_files_governor thread promised not to generate them.
[in,out] | log | redo log |
void log_files_dummy_records_request_disable | ( | log_t & | log | ) |
Disallows to generate dummy redo records but does not wait until the log_files_governor promised not to generate them anymore.
[in,out] | log | redo log |
void log_files_governor | ( | log_t * | log_ptr | ) |
The log files governor thread routine.
[in,out] | log_ptr | pointer to redo log |
|
inline |
Checks if log file governor thread is active.
void log_files_initialize_on_empty_redo | ( | log_t & | log | ) |
Computes initial capacity limits and size suggested for the next log file.
Called when logically empty redo log is being initialized.
[in,out] | log | redo log |
void log_files_initialize_on_existing_redo | ( | log_t & | log | ) |
Computes initial capacity limits and size suggested for the next log file.
Called after existing redo log files have been discovered (log.m_files).
[in,out] | log | redo log |
Persists log flags to the newest log file.
Flushes header of the log file and updates log.m_log_flags if succeeded.
[in,out] | log | redo log |
[in] | log_flags | log_flags to persist |
Creates a next log file, ready for writes.
Updates log.m_current_file.
[in,out] | log | redo log |
DB_SUCCESS | if created successfully |
DB_OUT_OF_DISK_SPACE | if there was no free space to create next file, according to limitations we have for redo files, or according to space physically available on the disk |
other | errors are possible |
void log_files_remove | ( | log_t & | log | ) |
Removes all log files.
[in,out] | log | redo log |
Resets creator name to the current creator and marks all files as full in their headers by setting LOG_HEADER_FLAG_FILE_FULL bit in the log_flags field.
Flushes headers of all log files and updates log.m_creator_name and log.m_files accordingly if succeeded (if fails, then some files might remain updated and some not; metadata stored in log.m_files should reflect that).
[in,out] | log | redo log |
void log_files_resize_requested | ( | log_t & | log | ) |
Updates capacity limitations after srv_redo_log_capacity_used has been changed.
It is called when user requests to change innodb_redo_log_capacity in runtime.
[in,out] | log | redo log |
Starts the log file management.
[in] | log | redo log |
Existing log files are marked as not consumed.
void log_files_thread_concurrency_updated | ( | log_t & | log | ) |
Updates capacity limitations after srv_thread_concurrency has been changed.
It is called when user requests to change innodb_thread_concurrency in runtime.
[in,out] | log | redo log |
void log_files_update_encryption | ( | log_t & | log, |
const Encryption_metadata & | encryption_metadata | ||
) |
Updates the encryption metadata stored in-memory for all redo log files.
Caller needs to have the log.m_files_mutex acquired before calling this.
[in,out] | log | redo log |
[in] | encryption_metadata | encryption metadata |
void log_files_wait_for_next_file_available | ( | log_t & | log | ) |
Waits until a next log file is available and can be produced.
[in] | log | redo log |