MySQL 9.1.0
Source Code Documentation
|
The database server main program. More...
#include <mysqld.h>
#include <sys/types.h>
#include <time.h>
#include <chrono>
#include <limits>
#include "btr0sea.h"
#include "buf0flu.h"
#include "buf0lru.h"
#include "clone0api.h"
#include "dict0boot.h"
#include "dict0load.h"
#include "dict0stats_bg.h"
#include "fsp0sysspace.h"
#include "ha_prototypes.h"
#include "ibuf0ibuf.h"
#include "lock0lock.h"
#include "log0buf.h"
#include "log0chkp.h"
#include "log0encryption.h"
#include "log0recv.h"
#include "log0write.h"
#include "mem0mem.h"
#include "os0proc.h"
#include "os0thread-create.h"
#include "pars0pars.h"
#include "que0que.h"
#include "row0mysql.h"
#include "sql/sql_class.h"
#include "sql_thd_internal_api.h"
#include "srv0mon.h"
#include "my_dbug.h"
#include "my_psi_config.h"
#include "srv0srv.h"
#include "srv0start.h"
#include "sync0sync.h"
#include "trx0i_s.h"
#include "trx0purge.h"
#include "usr0sess.h"
#include "ut0crc32.h"
#include "ut0mem.h"
Classes | |
struct | srv_sys_t |
The server system struct. More... | |
Macros | |
#define | MAX_MUTEX_NOWAIT 20 |
Maximum number of times allowed to conditionally acquire mutex before switching to blocking wait on the mutex. More... | |
#define | MUTEX_NOWAIT(mutex_skipped) ((mutex_skipped) < MAX_MUTEX_NOWAIT) |
Check whether the number of failed nonblocking mutex acquisition attempts exceeds maximum allowed value. More... | |
#define | srv_sys_mutex_enter() |
Acquire the system_mutex. More... | |
#define | srv_sys_mutex_own() (mutex_own(&srv_sys->mutex) && !srv_read_only_mode) |
Test if the system mutex is owned. More... | |
#define | srv_sys_mutex_exit() |
Release the system mutex. More... | |
Functions | |
std::chrono::seconds | get_srv_fatal_semaphore_wait_threshold () |
std::chrono::microseconds | get_srv_log_wait_for_write_timeout () |
Timeout used when waiting for redo write. More... | |
std::chrono::microseconds | get_srv_log_wait_for_flush_timeout () |
Timeout used when waiting for redo flush. More... | |
std::chrono::microseconds | get_srv_log_writer_timeout () |
Initial timeout used to wait on writer_event. More... | |
std::chrono::milliseconds | get_srv_log_checkpoint_every () |
Period every which a periodical checkpoint is written by the log checkpointer thread (unless periodical checkpoints are disabled, which is a case during initial phase of startup). More... | |
std::chrono::microseconds | get_srv_log_flusher_timeout () |
Initial timeout used to wait on flusher_event. More... | |
std::chrono::microseconds | get_srv_log_write_notifier_timeout () |
Initial timeout used to wait on write_notifier_event. More... | |
std::chrono::microseconds | get_srv_log_flush_notifier_timeout () |
Initial timeout used to wait on flush_notifier_event. More... | |
std::chrono::seconds | get_srv_flush_log_at_timeout () |
std::chrono::milliseconds | get_srv_replication_delay () |
static void | srv_print_master_thread_info (FILE *file) |
Prints counters for work done by srv_master_thread. More... | |
void | srv_set_io_thread_op_info (ulint i, const char *str) |
Sets the info describing an i/o thread current state. More... | |
void | srv_reset_io_thread_op_info () |
Resets the info describing an i/o thread current state. More... | |
static bool | srv_thread_type_validate (srv_thread_type type) |
Validates the type of a thread table slot. More... | |
static srv_thread_type | srv_slot_get_type (const srv_slot_t *slot) |
Gets the type of a thread table slot. More... | |
static srv_slot_t * | srv_reserve_slot (srv_thread_type type) |
Reserves a slot in the thread table for the current thread. More... | |
static int64_t | srv_suspend_thread_low (srv_slot_t *slot) |
Suspends the calling thread to wait for the event in its thread slot. More... | |
static int64_t | srv_suspend_thread (srv_slot_t *slot) |
Suspends the calling thread to wait for the event in its thread slot. More... | |
ulint | srv_release_threads (srv_thread_type type, ulint n) |
Releases threads of the type given from suspension in the thread table. More... | |
static void | srv_free_slot (srv_slot_t *slot) |
Release a thread's slot. More... | |
static void | srv_init (void) |
Initializes the server. More... | |
void | srv_free (void) |
Frees the data structures created in srv_init(). More... | |
static void | srv_general_init () |
Initializes the synchronization primitives, memory system, and the thread local storage. More... | |
void | srv_boot (void) |
Boots the InnoDB server. More... | |
static void | srv_refresh_innodb_monitor_stats (void) |
Refreshes the values used to calculate per-second averages. More... | |
static void | srv_printf_locks_and_transactions (FILE *file, ulint *trx_start_pos) |
Prints info summary and info about all transactions to the file, recording the position where the part about transactions starts. More... | |
bool | srv_printf_innodb_monitor (FILE *file, bool nowait, ulint *trx_start_pos, ulint *trx_end) |
Outputs to a file the output of the InnoDB Monitor. More... | |
void | srv_export_innodb_status (void) |
Function to pass InnoDB status variables to MySQL. More... | |
void | srv_monitor_thread () |
A thread which prints the info output by various InnoDB monitors. More... | |
void | srv_error_monitor_thread () |
A thread which prints warnings about semaphore waits which have lasted too long. More... | |
void | srv_inc_activity_count (void) |
Increment the server activity count. More... | |
bool | srv_master_thread_is_active () |
Check whether the master thread is active. More... | |
void | srv_active_wake_master_thread_low () |
Tells the InnoDB server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). More... | |
void | srv_wake_purge_thread_if_not_active (void) |
Tells the purge thread that there has been activity in the database and wakes up the purge thread if it is suspended (not sleeping). More... | |
void | srv_wake_master_thread (void) |
Wakes up the master thread if it is suspended or being suspended. More... | |
ulint | srv_get_activity_count (void) |
Get current server activity count. More... | |
bool | srv_check_activity (ulint old_activity_count) |
Check if there has been any activity. More... | |
static ulint | srv_master_evict_from_table_cache (ulint pct_check) |
Make room in the table cache by evicting an unused table. More... | |
static void | srv_shutdown_print_master_pending (std::chrono::steady_clock::time_point *last_print_time, ulint n_tables_to_drop, ulint n_bytes_merged) |
This function prints progress message every 60 seconds during server shutdown, for any activities that master thread is pending on. More... | |
static void | srv_master_do_disabled_loop (void) |
Waits in loop as long as master thread is disabled (debug) More... | |
void | srv_master_thread_disabled_debug_update (THD *, SYS_VAR *, void *, const void *save) |
Disables master thread. More... | |
static void | srv_update_cpu_usage () |
static void | srv_master_do_active_tasks (void) |
Perform the tasks that the master thread is supposed to do when the server is active. More... | |
static void | srv_master_do_idle_tasks (void) |
Perform the tasks that the master thread is supposed to do whenever the server is idle. More... | |
static bool | srv_master_do_pre_dd_shutdown_tasks (std::chrono::steady_clock::time_point *last_print_time) |
Perform the tasks during pre_dd_shutdown phase. More... | |
static bool | srv_master_do_shutdown_tasks (std::chrono::steady_clock::time_point *last_print_time) |
Perform the tasks during shutdown. More... | |
bool | srv_enable_redo_encryption () |
Enable REDO log encryption. More... | |
bool | set_undo_tablespace_encryption (space_id_t space_id, mtr_t *mtr) |
Set encryption for UNDO tablespace with given space id. More... | |
bool | srv_enable_undo_encryption () |
Enable UNDO tablespaces encryption. More... | |
static void | srv_master_sleep (void) |
Puts master thread to sleep. More... | |
static void | srv_master_wait (srv_slot_t *slot) |
Waits on event in provided slot. More... | |
static void | srv_master_main_loop (srv_slot_t *slot) |
Executes the main loop of the master thread. More... | |
static void | srv_master_pre_dd_shutdown_loop () |
Executes pre_dd_shutdown tasks in the master thread. More... | |
static void | srv_master_shutdown_loop () |
Executes shutdown tasks in the master thread. More... | |
void | srv_master_thread () |
The master thread controlling the server. More... | |
static bool | srv_purge_should_exit (ulint n_purged) |
Check if purge should stop. More... | |
static bool | srv_task_execute (void) |
Fetch and execute a task from the work queue. More... | |
void | srv_worker_thread () |
Worker thread that reads tasks from the work queue and executes them. More... | |
static ulint | srv_do_purge (ulint *n_total_purged) |
Do the actual purge operation. More... | |
static void | srv_purge_coordinator_suspend (srv_slot_t *slot, ulint rseg_history_len) |
Suspend the purge coordinator thread. More... | |
void | srv_purge_coordinator_thread () |
Purge coordinator thread that schedules the purge tasks. More... | |
void | srv_que_task_enqueue_low (que_thr_t *thr) |
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one. More... | |
ulint | srv_get_task_queue_length (void) |
Get count of tasks in the queue. More... | |
void | srv_purge_wakeup (void) |
Wakeup the purge threads. More... | |
bool | srv_purge_threads_active () |
Check if the purge threads are active, both coordinator and worker threads. More... | |
bool | srv_thread_is_active (const IB_thread &thread) |
Check if given thread is still active. More... | |
bool | srv_thread_is_stopped (const IB_thread &thread) |
Check if given thread is cleaned-up and stopped. More... | |
const char * | srv_get_server_errmsgs (int errcode) |
Get the format string for the logger. More... | |
void | set_srv_redo_log (bool enable) |
Set redo log variable for performance schema global status. More... | |
Variables | |
Srv_threads | srv_threads |
Structure with state of srv background threads. More... | |
Srv_cpu_usage | srv_cpu_usage |
Structure with cpu usage information. More... | |
bool | srv_downgrade_partition_files = false |
ulong | srv_fatal_semaphore_wait_threshold = 600 |
std::atomic< int > | srv_fatal_semaphore_wait_extend {0} |
ulint | srv_dml_needed_delay = 0 |
const char * | srv_main_thread_op_info = "" |
char * | srv_data_home = nullptr |
char * | srv_doublewrite_dir = nullptr |
Separate directory for doublewrite files, if it is not NULL. More... | |
char * | srv_innodb_directories = nullptr |
The innodb_directories variable value. More... | |
uint32_t | srv_rseg_init_threads = 1 |
Number of threads spawned for initializing rollback segments in parallel. More... | |
char * | srv_undo_dir = nullptr |
Undo tablespace directories. More... | |
ulong | srv_undo_tablespaces = FSP_IMPLICIT_UNDO_TABLESPACES |
The number of implicit undo tablespaces to use for rollback segments. More... | |
ulong | srv_rollback_segments = TRX_SYS_N_RSEGS |
The number of rollback segments per tablespace. More... | |
ulong | srv_undo_logs = 0 |
const char * | deprecated_undo_logs |
ulong | srv_purge_rseg_truncate_frequency |
Rate at which UNDO records should be purged. More... | |
bool | srv_undo_log_truncate = false |
Enable or Disable Truncate of UNDO tablespace. More... | |
bool | srv_undo_log_encrypt = false |
Enable or disable Encrypt of UNDO tablespace. More... | |
unsigned long long | srv_max_undo_tablespace_size |
Maximum size of undo tablespace. More... | |
const size_t | CONCURRENT_UNDO_TRUNCATE_LIMIT |
Maximum number of recently truncated undo tablespace IDs for the same undo number. More... | |
bool | srv_read_only_mode |
Set if InnoDB must operate in read-only mode. More... | |
bool | srv_file_per_table |
store to its own file each table created by an user; data dictionary tables are in the system tablespace 0 More... | |
ulong | srv_sort_buf_size = 1048576 |
Sort buffer size in index creation. More... | |
unsigned long long | srv_online_max_size |
Maximum modification log file size for online index creation. More... | |
bool | high_level_read_only |
Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UNDO. More... | |
ulong | srv_parallel_read_threads |
Number of threads to use for parallel reads. More... | |
bool | srv_use_native_aio = false |
If this flag is true, then we will use the native aio of the OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. More... | |
bool | srv_numa_interleave = false |
ulong | srv_debug_compress |
Force all user tables to use page compression. More... | |
bool | innodb_calling_exit |
Set when InnoDB has invoked exit(). More... | |
bool | srv_master_thread_disabled_debug |
Used by SET GLOBAL innodb_master_thread_disabled_debug = X. More... | |
static os_event_t | srv_master_thread_disabled_event |
Event used to inform that master thread is disabled. More... | |
char * | srv_log_group_home_dir = nullptr |
bool | srv_redo_log_encrypt = false |
Enable or disable Encrypt of REDO tablespace. More... | |
ulong | srv_log_n_files = 100 |
Value of innodb_log_files_in_group. More... | |
ulonglong | srv_log_file_size |
Value of innodb_log_file_size. More... | |
ulonglong | srv_redo_log_capacity |
Value of innodb_redo_log_capacity. More... | |
ulonglong | srv_redo_log_capacity_used |
Assumed value of innodb_redo_log_capacity's - value which is used. More... | |
ulong | srv_log_buffer_size |
Space for log buffer, expressed in bytes. More... | |
ulong | srv_log_write_ahead_size |
Size of block, used for writing ahead to avoid read-on-write. More... | |
bool | srv_log_writer_threads |
Whether to activate/pause the log writer threads. More... | |
uint | srv_log_spin_cpu_abs_lwm |
Minimum absolute value of cpu time for which spin-delay is used. More... | |
uint | srv_log_spin_cpu_pct_hwm |
Maximum percentage of cpu time for which spin-delay is used. More... | |
ulong | srv_log_wait_for_flush_spin_hwm |
Maximum value of average log flush time for which spin-delay is used. More... | |
ulong | srv_log_write_max_size = INNODB_LOG_WRITE_MAX_SIZE_DEFAULT |
When log writer follows links in the log recent written buffer, it stops when it has reached at least that many bytes to write, limiting how many bytes can be written in single call. More... | |
ulong | srv_log_write_events = INNODB_LOG_EVENTS_DEFAULT |
Number of events used for notifications about redo write. More... | |
ulong | srv_log_flush_events = INNODB_LOG_EVENTS_DEFAULT |
Number of events used for notifications about redo flush. More... | |
ulong | srv_log_recent_written_size = INNODB_LOG_RECENT_WRITTEN_SIZE_DEFAULT |
Number of slots in a small buffer, which is used to allow concurrent writes to log buffer. More... | |
ulong | srv_buf_flush_list_added_size = INNODB_BUF_FLUSH_LIST_ADDED_SIZE_DEFAULT |
Number of slots in a small buffer, which is used to break requirement for total order of dirty pages, when they are added to flush lists. More... | |
ulong | srv_log_wait_for_write_spin_delay |
Number of spin iterations, when spinning and waiting for log buffer written up to given LSN, before we fallback to loop with sleeps. More... | |
ulong | srv_log_wait_for_write_timeout |
Timeout used when waiting for redo write (microseconds). More... | |
ulong | srv_log_wait_for_flush_spin_delay |
Number of spin iterations, when spinning and waiting for log flushed. More... | |
ulong | srv_log_wait_for_flush_timeout |
Timeout used when waiting for redo flush (microseconds). More... | |
ulong | srv_log_writer_spin_delay = INNODB_LOG_WRITER_SPIN_DELAY_DEFAULT |
Number of spin iterations, for which log writer thread is waiting for new data to write or flush without sleeping. More... | |
ulong | srv_log_writer_timeout = INNODB_LOG_WRITER_TIMEOUT_DEFAULT |
Initial timeout used to wait on writer_event. More... | |
ulong | srv_log_checkpoint_every = INNODB_LOG_CHECKPOINT_EVERY_DEFAULT |
Number of milliseconds every which a periodical checkpoint is written by the log checkpointer thread (unless periodical checkpoints are disabled, which is a case during initial phase of startup). More... | |
ulong | srv_log_flusher_spin_delay = INNODB_LOG_FLUSHER_SPIN_DELAY_DEFAULT |
Number of spin iterations, for which log flusher thread is waiting for new data to flush, without sleeping. More... | |
ulong | srv_log_flusher_timeout = INNODB_LOG_FLUSHER_TIMEOUT_DEFAULT |
Initial timeout used to wait on flusher_event. More... | |
ulong | srv_log_write_notifier_spin_delay |
Number of spin iterations, for which log write notifier thread is waiting for advanced flushed_to_disk_lsn without sleeping. More... | |
ulong | srv_log_write_notifier_timeout |
Initial timeout used to wait on write_notifier_event. More... | |
ulong | srv_log_flush_notifier_spin_delay |
Number of spin iterations, for which log flush notifier thread is waiting for advanced flushed_to_disk_lsn without sleeping. More... | |
ulong | srv_log_flush_notifier_timeout |
Initial timeout used to wait on flush_notifier_event. More... | |
bool | srv_log_checksums |
Whether to generate and require checksums on the redo log pages. More... | |
bool | srv_checkpoint_disabled = false |
If true then disable checkpointing. More... | |
bool | srv_inject_too_many_concurrent_trxs = false |
ulong | srv_flush_log_at_trx_commit = 1 |
uint | srv_flush_log_at_timeout = 1 |
ulong | srv_page_size = UNIV_PAGE_SIZE_DEF |
ulong | srv_page_size_shift = UNIV_PAGE_SIZE_SHIFT_DEF |
page_size_t | univ_page_size (0, 0, false) |
bool | srv_adaptive_flushing = true |
bool | srv_flush_sync = true |
bool | srv_dedicated_server = true |
Dedicated server setting. More... | |
ulint | srv_buf_pool_size = ULINT_MAX |
Requested size in bytes. More... | |
const ulint | srv_buf_pool_min_size = 5 * 1024 * 1024 |
Minimum pool size in bytes. More... | |
const ulint | srv_buf_pool_def_size = 128 * 1024 * 1024 |
Default pool size in bytes. More... | |
const longlong | srv_buf_pool_max_size = LLONG_MAX |
Maximum pool size in bytes. More... | |
ulonglong | srv_buf_pool_chunk_unit |
Requested buffer pool chunk size. More... | |
const ulonglong | srv_buf_pool_chunk_unit_min = (1024 * 1024) |
Minimum buffer pool chunk size. More... | |
const ulonglong | srv_buf_pool_chunk_unit_blk_sz = (1024 * 1024) |
The buffer pool chunk size must be a multiple of this number. More... | |
const ulonglong | srv_buf_pool_chunk_unit_max |
Maximum buffer pool chunk size. More... | |
ulong | srv_buf_pool_instances |
Requested number of buffer pool instances. More... | |
const ulong | srv_buf_pool_instances_default = 0 |
Default number of buffer pool instances. More... | |
ulong | srv_n_page_hash_locks = 16 |
Number of locks to protect buf_pool->page_hash. More... | |
bool | srv_validate_tablespace_paths = true |
Whether to validate InnoDB tablespace paths on startup. More... | |
bool | srv_use_fdatasync = false |
Use fdatasync() instead of fsync(). More... | |
ulong | srv_LRU_scan_depth = 1024 |
Scan depth for LRU flush batch i.e. More... | |
ulong | srv_flush_neighbors = 1 |
Whether or not to flush neighbors of a block. More... | |
ulint | srv_buf_pool_old_size = 0 |
Previously requested size. More... | |
ulint | srv_buf_pool_base_size = 0 |
Current size as scaling factor for the other components. More... | |
long long | srv_buf_pool_curr_size = 0 |
Current size in bytes. More... | |
ulong | srv_buf_pool_dump_pct |
Dump this % of each buffer pool during BP dump. More... | |
ulint | srv_lock_table_size = ULINT_MAX |
Lock table size in bytes. More... | |
const ulong | srv_idle_flush_pct_default = 100 |
Default value of srv_idle_flush_pct. More... | |
ulong | srv_idle_flush_pct = srv_idle_flush_pct_default |
How much flush to be done in case of server is idle. More... | |
ulong | srv_n_read_io_threads |
ulong | srv_n_write_io_threads |
bool | srv_random_read_ahead = false |
ulong | srv_read_ahead_threshold = 56 |
uint | srv_change_buffer_max_size = CHANGE_BUFFER_DEFAULT_SIZE |
Maximum on-disk size of change buffer in terms of percentage of the buffer pool. More... | |
enum srv_unix_flush_t | srv_unix_file_flush_method = SRV_UNIX_FSYNC |
ulong | srv_io_capacity = 200 |
ulong | srv_max_io_capacity = 400 |
ulong | srv_n_page_cleaners = 4 |
double | srv_max_buf_pool_modified_pct = 75.0 |
double | srv_max_dirty_pages_pct_lwm = 0.0 |
ulong | srv_adaptive_flushing_lwm = 10 |
ulong | srv_flushing_avg_loops = 30 |
ulong | srv_n_purge_threads = 4 |
ulong | srv_purge_batch_size = 20 |
ulong | srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL |
bool | tbsp_extend_and_initialize = true |
Enable or disable writing of NULLs while extending a tablespace. More... | |
srv_stats_t | srv_stats |
Global counters. More... | |
export_var_t | export_vars |
Status variables to be passed to MySQL. More... | |
ulong | srv_force_recovery |
Normally 0. More... | |
ulong | srv_force_recovery_crash |
Inject a crash at different steps of the recovery process. More... | |
bool | srv_print_all_deadlocks = false |
Print all user-level transactions deadlocks to mysqld stderr. More... | |
bool | srv_print_ddl_logs = false |
Print all DDL logs to mysqld stderr. More... | |
bool | srv_cmp_per_index_enabled = false |
Enable INFORMATION_SCHEMA.innodb_cmp_per_index. More... | |
bool | srv_redo_log = true |
If innodb redo logging is enabled. More... | |
ulong | srv_fast_shutdown |
The value of the configuration parameter innodb_fast_shutdown, controlling the InnoDB shutdown. More... | |
bool | srv_innodb_status = false |
unsigned long long | srv_stats_transient_sample_pages = 8 |
bool | srv_stats_persistent = true |
bool | srv_stats_include_delete_marked = false |
unsigned long long | srv_stats_persistent_sample_pages = 20 |
bool | srv_stats_auto_recalc = true |
ulong | srv_replication_delay = 0 |
ulong | srv_n_spin_wait_rounds = 30 |
ulong | srv_spin_wait_delay = 6 |
bool | srv_priority_boost = true |
static ulint | srv_n_rows_inserted_old = 0 |
static ulint | srv_n_rows_updated_old = 0 |
static ulint | srv_n_rows_deleted_old = 0 |
static ulint | srv_n_rows_read_old = 0 |
static ulint | srv_n_system_rows_inserted_old = 0 |
static ulint | srv_n_system_rows_updated_old = 0 |
static ulint | srv_n_system_rows_deleted_old = 0 |
static ulint | srv_n_system_rows_read_old = 0 |
ulint | srv_truncated_status_writes = 0 |
bool | srv_print_innodb_monitor = false |
std::atomic_uint32_t | srv_innodb_needs_monitoring {0} |
In contrast to srv_print_innodb_monitor which is controlled by the user, this variable is controlled by InnoDB itself: if some module of InnoDB decides it would be good to print the monitoring information it increments this value, and decrements it when it no longer needs it. More... | |
bool | srv_print_innodb_lock_monitor = false |
const char * | srv_io_thread_op_info [SRV_MAX_N_IO_THREADS] |
const char * | srv_io_thread_function [SRV_MAX_N_IO_THREADS] |
static std::chrono::steady_clock::time_point | srv_monitor_stats_refreshed_at |
static ib_mutex_t | srv_innodb_monitor_mutex |
ib_mutex_t | page_zip_stat_per_index_mutex |
Mutex protecting page_zip_stat_per_index. More... | |
ib_mutex_t | srv_monitor_file_mutex |
FILE * | srv_monitor_file |
Temporary file for innodb monitor output. More... | |
ib_mutex_t | srv_misc_tmpfile_mutex |
Mutex for locking srv_misc_tmpfile. More... | |
FILE * | srv_misc_tmpfile |
Temporary file for miscellaneous diagnostic output. More... | |
static ulint | srv_main_thread_process_no = 0 |
static std::thread::id | srv_main_thread_id {} |
static ulint | srv_main_active_loops = 0 |
Iterations of the loop bounded by 'srv_active' label. More... | |
static ulint | srv_main_idle_loops = 0 |
Iterations of the loop bounded by the 'srv_idle' label. More... | |
static ulint | srv_main_shutdown_loops = 0 |
Iterations of the loop bounded by the 'srv_shutdown' label. More... | |
static ulint | srv_log_writes_and_flush = 0 |
Log writes involving flush. More... | |
constexpr std::chrono::seconds | SRV_MASTER_DICT_LRU_INTERVAL {47} |
static srv_sys_t * | srv_sys = nullptr |
os_event_t | srv_monitor_event |
Event to signal the monitor thread. More... | |
os_event_t | srv_error_event |
Event to signal the error thread. More... | |
os_event_t | srv_buf_dump_event |
Event to signal the buffer pool dump/load thread. More... | |
os_event_t | srv_buf_resize_event |
Event to signal the buffer pool resize thread. More... | |
char * | srv_buf_dump_filename |
The buffer pool dump/load file name. More... | |
bool | srv_buffer_pool_dump_at_shutdown = true |
Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown and/or load it during startup. More... | |
bool | srv_buffer_pool_load_at_startup = true |
static const ulint | SRV_PURGE_SLOT = 1 |
Slot index in the srv_sys->sys_threads array for the purge thread. More... | |
static const ulint | SRV_MASTER_SLOT = 0 |
Slot index in the srv_sys->sys_threads array for the master thread. More... | |
PSI_stage_info | srv_stage_alter_table_end |
Performance schema stage event for monitoring ALTER TABLE progress everything after flush log_make_latest_checkpoint(). More... | |
PSI_stage_info | srv_stage_alter_table_flush |
Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint(). More... | |
PSI_stage_info | srv_stage_alter_table_insert |
Performance schema stage event for monitoring ALTER TABLE progress. More... | |
PSI_stage_info | srv_stage_alter_table_log_index |
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply(). More... | |
PSI_stage_info | srv_stage_alter_table_log_table |
Performance schema stage event for monitoring ALTER TABLE progress row_log_table_apply(). More... | |
PSI_stage_info | srv_stage_alter_table_merge_sort |
Performance schema stage event for monitoring ALTER TABLE progress. More... | |
PSI_stage_info | srv_stage_alter_table_read_pk_internal_sort |
Performance schema stage event for monitoring ALTER TABLE progress. More... | |
PSI_stage_info | srv_stage_alter_tablespace_encryption |
Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress. More... | |
PSI_stage_info | srv_stage_buffer_pool_load |
Performance schema stage event for monitoring buffer pool load progress. More... | |
PSI_stage_info | srv_stage_clone_file_copy |
Performance schema stage event for monitoring clone file copy progress. More... | |
PSI_stage_info | srv_stage_clone_redo_copy |
Performance schema stage event for monitoring clone redo copy progress. More... | |
PSI_stage_info | srv_stage_clone_page_copy |
Performance schema stage event for monitoring clone page copy progress. More... | |
The database server main program.
Created 10/8/1995 Heikki Tuuri
#define MAX_MUTEX_NOWAIT 20 |
Maximum number of times allowed to conditionally acquire mutex before switching to blocking wait on the mutex.
#define MUTEX_NOWAIT | ( | mutex_skipped | ) | ((mutex_skipped) < MAX_MUTEX_NOWAIT) |
Check whether the number of failed nonblocking mutex acquisition attempts exceeds maximum allowed value.
If so, srv_printf_innodb_monitor() will request mutex acquisition with mutex_enter(), which will wait until it gets the mutex.
#define srv_sys_mutex_enter | ( | ) |
Acquire the system_mutex.
#define srv_sys_mutex_exit | ( | ) |
#define srv_sys_mutex_own | ( | ) | (mutex_own(&srv_sys->mutex) && !srv_read_only_mode) |
Test if the system mutex is owned.
std::chrono::seconds get_srv_fatal_semaphore_wait_threshold | ( | ) |
std::chrono::seconds get_srv_flush_log_at_timeout | ( | ) |
std::chrono::milliseconds get_srv_log_checkpoint_every | ( | ) |
Period every which a periodical checkpoint is written by the log checkpointer thread (unless periodical checkpoints are disabled, which is a case during initial phase of startup).
std::chrono::microseconds get_srv_log_flush_notifier_timeout | ( | ) |
Initial timeout used to wait on flush_notifier_event.
std::chrono::microseconds get_srv_log_flusher_timeout | ( | ) |
Initial timeout used to wait on flusher_event.
std::chrono::microseconds get_srv_log_wait_for_flush_timeout | ( | ) |
Timeout used when waiting for redo flush.
std::chrono::microseconds get_srv_log_wait_for_write_timeout | ( | ) |
Timeout used when waiting for redo write.
std::chrono::microseconds get_srv_log_write_notifier_timeout | ( | ) |
Initial timeout used to wait on write_notifier_event.
std::chrono::microseconds get_srv_log_writer_timeout | ( | ) |
Initial timeout used to wait on writer_event.
std::chrono::milliseconds get_srv_replication_delay | ( | ) |
void set_srv_redo_log | ( | bool | enable | ) |
Set redo log variable for performance schema global status.
[in] | enable | true => redo log enabled, false => redo log disabled |
bool set_undo_tablespace_encryption | ( | space_id_t | space_id, |
mtr_t * | mtr | ||
) |
Set encryption for UNDO tablespace with given space id.
[in] | space_id | Undo tablespace id |
[in] | mtr | Mini-transaction |
void srv_active_wake_master_thread_low | ( | void | ) |
Tells the InnoDB server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping).
Tells the Innobase server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping).
Used in the MySQL interface. Note that there is a small chance that the master thread stays suspended (we do not protect our operation with the srv_sys_t->mutex, for performance reasons).
void srv_boot | ( | void | ) |
Boots the InnoDB server.
Boots Innobase server.
bool srv_check_activity | ( | ulint | old_activity_count | ) |
Check if there has been any activity.
old_activity_count | in: old activity count |
Do the actual purge operation.
[in,out] | n_total_purged | Total pages purged in this call |
bool srv_enable_redo_encryption | ( | ) |
Enable REDO log encryption.
bool srv_enable_undo_encryption | ( | ) |
Enable UNDO tablespaces encryption.
void srv_error_monitor_thread | ( | ) |
A thread which prints warnings about semaphore waits which have lasted too long.
These can be used to track bugs which cause hangs.
void srv_export_innodb_status | ( | void | ) |
Function to pass InnoDB status variables to MySQL.
void srv_free | ( | void | ) |
Frees the data structures created in srv_init().
|
static |
Release a thread's slot.
slot | in/out: thread slot |
|
static |
Initializes the synchronization primitives, memory system, and the thread local storage.
ulint srv_get_activity_count | ( | void | ) |
Get current server activity count.
We don't hold srv_sys::mutex while reading this value as it is only used in heuristics.
const char * srv_get_server_errmsgs | ( | int | errcode | ) |
Get the format string for the logger.
[in] | errcode | The error code from share/errmsg-*.txt |
ulint srv_get_task_queue_length | ( | void | ) |
Get count of tasks in the queue.
void srv_inc_activity_count | ( | void | ) |
Increment the server activity count.
Increment the server activity counter.
|
static |
Initializes the server.
|
static |
Perform the tasks that the master thread is supposed to do when the server is active.
There are two types of tasks. The first category is of such tasks which are performed at each invocation of this function. We assume that this function is called roughly every second when the server is active. The second category is of such tasks which are performed at some interval e.g.: purge, dict_LRU cleanup etc.
|
static |
Waits in loop as long as master thread is disabled (debug)
|
static |
Perform the tasks that the master thread is supposed to do whenever the server is idle.
We do check for the server state during this function and if the server has entered the shutdown phase we may return from the function without completing the required tasks. Note that the server can move to active state when we are executing this function but we don't check for that as we are suppose to perform more or less same tasks when server is active.
|
static |
Perform the tasks during pre_dd_shutdown phase.
The tasks that we do depend on srv_fast_shutdown: 2 => very fast shutdown => do no book keeping 0, 1 => normal or slow shutdown => clear drop table queue
[in,out] | last_print_time | last time log message (about pending operations of shutdown) was printed |
last_print_time | last time the function print the message |
|
static |
Perform the tasks during shutdown.
The tasks that we do at shutdown depend on srv_fast_shutdown: 1, 2 => very fast shutdown => do no book keeping 0 => slow shutdown => do ibuf merge
[in,out] | last_print_time | last time log message (about pending operations of shutdown) was printed |
last_print_time | last time the function print the message |
Make room in the table cache by evicting an unused table.
pct_check | in: max percent to check |
|
static |
Executes the main loop of the master thread.
[in] | slot | slot reserved as SRV_MASTER |
|
static |
Executes pre_dd_shutdown tasks in the master thread.
|
static |
Executes shutdown tasks in the master thread.
|
static |
Puts master thread to sleep.
At this point we are using polling to service various activities. Master thread sleeps for one second before checking the state of the server again
void srv_master_thread | ( | ) |
The master thread controlling the server.
void srv_master_thread_disabled_debug_update | ( | THD * | thd, |
SYS_VAR * | var, | ||
void * | var_ptr, | ||
const void * | save | ||
) |
Disables master thread.
It's used by: SET GLOBAL innodb_master_thread_disabled_debug = 1 (0).
[in] | thd | thread handle |
[in] | var | pointer to system variable |
[out] | var_ptr | where the formal string goes |
[in] | save | immediate result from check function |
bool srv_master_thread_is_active | ( | ) |
Check whether the master thread is active.
This is polled during the final phase of shutdown. The first phase of server shutdown must have already been executed (or the server must not have been fully started up).
true | if any thread is active |
false | if no thread is active |
|
static |
Waits on event in provided slot.
[in] | slot | slot reserved as SRV_MASTER |
void srv_monitor_thread | ( | ) |
A thread which prints the info output by various InnoDB monitors.
|
static |
Prints counters for work done by srv_master_thread.
Outputs to a file the output of the InnoDB Monitor.
[in] | file | output stream |
[in] | nowait | whether to wait for the exclusive global lock_sys latch |
[out] | trx_start | file position of the start of the list of active transactions |
[out] | trx_end | file position of the end of the list of active transactions |
|
static |
Prints info summary and info about all transactions to the file, recording the position where the part about transactions starts.
[in] | file | output stream |
[out] | trx_start_pos | file position of the start of the list of active transactions |
|
static |
Suspend the purge coordinator thread.
Maximum wait time on the purge event.
slot | in/out: Purge coordinator thread slot |
rseg_history_len | in: history list length before last purge |
void srv_purge_coordinator_thread | ( | ) |
Purge coordinator thread that schedules the purge tasks.
|
static |
Check if purge should stop.
n_purged | in: pages purged in last batch |
bool srv_purge_threads_active | ( | ) |
Check if the purge threads are active, both coordinator and worker threads.
void srv_purge_wakeup | ( | void | ) |
Wakeup the purge threads.
void srv_que_task_enqueue_low | ( | que_thr_t * | thr | ) |
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one.
in: query thread
thr | in: query thread |
|
static |
Refreshes the values used to calculate per-second averages.
ulint srv_release_threads | ( | srv_thread_type | type, |
ulint | n | ||
) |
Releases threads of the type given from suspension in the thread table.
NOTE! The server mutex has to be reserved by the caller!
type | in: thread type |
n | in: number of threads to release |
|
static |
Reserves a slot in the thread table for the current thread.
type | in: type of the thread |
void srv_reset_io_thread_op_info | ( | ) |
Resets the info describing an i/o thread current state.
void srv_set_io_thread_op_info | ( | ulint | i, |
const char * | str | ||
) |
Sets the info describing an i/o thread current state.
[in] | i | The 'segment' of the i/o thread |
[in] | str | Constant char string describing the state |
|
static |
This function prints progress message every 60 seconds during server shutdown, for any activities that master thread is pending on.
last_print_time | last time the function print the message |
n_tables_to_drop | number of tables to be dropped |
n_bytes_merged | number of change buffer just merged |
|
static |
Gets the type of a thread table slot.
slot | in: thread slot |
|
static |
Suspends the calling thread to wait for the event in its thread slot.
slot | in/out: thread slot |
|
static |
Suspends the calling thread to wait for the event in its thread slot.
slot | in/out: thread slot |
|
static |
Fetch and execute a task from the work queue.
bool srv_thread_is_active | ( | const IB_thread & | thread | ) |
Check if given thread is still active.
bool srv_thread_is_stopped | ( | const IB_thread & | thread | ) |
Check if given thread is cleaned-up and stopped.
|
static |
Validates the type of a thread table slot.
type | in: thread type |
|
static |
void srv_wake_master_thread | ( | void | ) |
Wakes up the master thread if it is suspended or being suspended.
void srv_wake_purge_thread_if_not_active | ( | void | ) |
Tells the purge thread that there has been activity in the database and wakes up the purge thread if it is suspended (not sleeping).
Note that there is a small chance that the purge thread stays suspended (we do not protect our check with the srv_sys_t:mutex and the purge_sys->latch, for performance reasons).
void srv_worker_thread | ( | ) |
Worker thread that reads tasks from the work queue and executes them.
const size_t CONCURRENT_UNDO_TRUNCATE_LIMIT |
Maximum number of recently truncated undo tablespace IDs for the same undo number.
const char* deprecated_undo_logs |
export_var_t export_vars |
Status variables to be passed to MySQL.
bool high_level_read_only |
Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UNDO.
bool innodb_calling_exit |
Set when InnoDB has invoked exit().
ib_mutex_t page_zip_stat_per_index_mutex |
Mutex protecting page_zip_stat_per_index.
bool srv_adaptive_flushing = true |
ulong srv_adaptive_flushing_lwm = 10 |
os_event_t srv_buf_dump_event |
Event to signal the buffer pool dump/load thread.
The buffer pool dump/load thread waits on this event.
char* srv_buf_dump_filename |
The buffer pool dump/load file name.
ulong srv_buf_flush_list_added_size = INNODB_BUF_FLUSH_LIST_ADDED_SIZE_DEFAULT |
Number of slots in a small buffer, which is used to break requirement for total order of dirty pages, when they are added to flush lists.
Number of slots in a small link buffer, which is used to break requirement for total order of dirty pages, when they are added to flush lists.
The slots are addressed by LSN values modulo number of the slots.
ulint srv_buf_pool_base_size = 0 |
Current size as scaling factor for the other components.
ulonglong srv_buf_pool_chunk_unit |
Requested buffer pool chunk size.
Each buffer pool instance consists of one or more chunks.
const ulonglong srv_buf_pool_chunk_unit_blk_sz = (1024 * 1024) |
The buffer pool chunk size must be a multiple of this number.
const ulonglong srv_buf_pool_chunk_unit_max |
Maximum buffer pool chunk size.
const ulonglong srv_buf_pool_chunk_unit_min = (1024 * 1024) |
Minimum buffer pool chunk size.
long long srv_buf_pool_curr_size = 0 |
Current size in bytes.
const ulint srv_buf_pool_def_size = 128 * 1024 * 1024 |
Default pool size in bytes.
ulong srv_buf_pool_dump_pct |
Dump this % of each buffer pool during BP dump.
ulong srv_buf_pool_instances |
Requested number of buffer pool instances.
const ulong srv_buf_pool_instances_default = 0 |
Default number of buffer pool instances.
const longlong srv_buf_pool_max_size = LLONG_MAX |
Maximum pool size in bytes.
const ulint srv_buf_pool_min_size = 5 * 1024 * 1024 |
Minimum pool size in bytes.
ulint srv_buf_pool_old_size = 0 |
Previously requested size.
Accesses protected by memory barriers.
os_event_t srv_buf_resize_event |
Event to signal the buffer pool resize thread.
The buffer pool resize thread waits on this event.
bool srv_buffer_pool_dump_at_shutdown = true |
Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown and/or load it during startup.
bool srv_buffer_pool_load_at_startup = true |
uint srv_change_buffer_max_size = CHANGE_BUFFER_DEFAULT_SIZE |
Maximum on-disk size of change buffer in terms of percentage of the buffer pool.
bool srv_checkpoint_disabled = false |
If true then disable checkpointing.
bool srv_cmp_per_index_enabled = false |
Enable INFORMATION_SCHEMA.innodb_cmp_per_index.
Srv_cpu_usage srv_cpu_usage |
Structure with cpu usage information.
char* srv_data_home = nullptr |
ulong srv_debug_compress |
Force all user tables to use page compression.
bool srv_dedicated_server = true |
Dedicated server setting.
ulint srv_dml_needed_delay = 0 |
char* srv_doublewrite_dir = nullptr |
Separate directory for doublewrite files, if it is not NULL.
bool srv_downgrade_partition_files = false |
os_event_t srv_error_event |
Event to signal the error thread.
ulong srv_fast_shutdown |
The value of the configuration parameter innodb_fast_shutdown, controlling the InnoDB shutdown.
If innodb_fast_shutdown=0, InnoDB shutdown will purge all undo log records (except XA PREPARE transactions) and complete the merge of the entire change buffer, and then shut down the redo log.
If innodb_fast_shutdown=1, InnoDB shutdown will only flush the buffer pool to data files, cleanly shutting down the redo log.
If innodb_fast_shutdown=2, shutdown will effectively 'crash' InnoDB (but lose no committed transactions).
std::atomic<int> srv_fatal_semaphore_wait_extend {0} |
ulong srv_fatal_semaphore_wait_threshold = 600 |
bool srv_file_per_table |
store to its own file each table created by an user; data dictionary tables are in the system tablespace 0
uint srv_flush_log_at_timeout = 1 |
ulong srv_flush_log_at_trx_commit = 1 |
ulong srv_flush_neighbors = 1 |
Whether or not to flush neighbors of a block.
bool srv_flush_sync = true |
ulong srv_flushing_avg_loops = 30 |
ulong srv_force_recovery |
Normally 0.
When nonzero, skip some phases of crash recovery, starting from SRV_FORCE_IGNORE_CORRUPT, so that data can be recovered by SELECT or mysqldump. When this is nonzero, we do not allow any user modifications to the data.
ulong srv_force_recovery_crash |
Inject a crash at different steps of the recovery process.
This is for testing and debugging only.
ulong srv_idle_flush_pct = srv_idle_flush_pct_default |
How much flush to be done in case of server is idle.
const ulong srv_idle_flush_pct_default = 100 |
Default value of srv_idle_flush_pct.
bool srv_inject_too_many_concurrent_trxs = false |
char* srv_innodb_directories = nullptr |
The innodb_directories variable value.
This a list of directories deliminated by ';', i.e the FIL_PATH_SEPARATOR.
|
static |
std::atomic_uint32_t srv_innodb_needs_monitoring {0} |
In contrast to srv_print_innodb_monitor which is controlled by the user, this variable is controlled by InnoDB itself: if some module of InnoDB decides it would be good to print the monitoring information it increments this value, and decrements it when it no longer needs it.
ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL |
bool srv_innodb_status = false |
ulong srv_io_capacity = 200 |
const char* srv_io_thread_function[SRV_MAX_N_IO_THREADS] |
const char* srv_io_thread_op_info[SRV_MAX_N_IO_THREADS] |
ulong srv_log_buffer_size |
Space for log buffer, expressed in bytes.
Note, that log buffer will use only the largest power of two, which is not greater than the assigned space.
ulong srv_log_checkpoint_every = INNODB_LOG_CHECKPOINT_EVERY_DEFAULT |
Number of milliseconds every which a periodical checkpoint is written by the log checkpointer thread (unless periodical checkpoints are disabled, which is a case during initial phase of startup).
bool srv_log_checksums |
Whether to generate and require checksums on the redo log pages.
ulonglong srv_log_file_size |
Value of innodb_log_file_size.
Expressed in bytes. This is deprecated.
ulong srv_log_flush_events = INNODB_LOG_EVENTS_DEFAULT |
Number of events used for notifications about redo flush.
ulong srv_log_flush_notifier_spin_delay |
Number of spin iterations, for which log flush notifier thread is waiting for advanced flushed_to_disk_lsn without sleeping.
ulong srv_log_flush_notifier_timeout |
Initial timeout used to wait on flush_notifier_event.
ulong srv_log_flusher_spin_delay = INNODB_LOG_FLUSHER_SPIN_DELAY_DEFAULT |
Number of spin iterations, for which log flusher thread is waiting for new data to flush, without sleeping.
ulong srv_log_flusher_timeout = INNODB_LOG_FLUSHER_TIMEOUT_DEFAULT |
Initial timeout used to wait on flusher_event.
char* srv_log_group_home_dir = nullptr |
ulong srv_log_n_files = 100 |
Value of innodb_log_files_in_group.
This is deprecated.
ulong srv_log_recent_written_size = INNODB_LOG_RECENT_WRITTEN_SIZE_DEFAULT |
Number of slots in a small buffer, which is used to allow concurrent writes to log buffer.
The slots are addressed by LSN values modulo number of the slots.
uint srv_log_spin_cpu_abs_lwm |
Minimum absolute value of cpu time for which spin-delay is used.
uint srv_log_spin_cpu_pct_hwm |
Maximum percentage of cpu time for which spin-delay is used.
ulong srv_log_wait_for_flush_spin_delay |
Number of spin iterations, when spinning and waiting for log flushed.
ulong srv_log_wait_for_flush_spin_hwm |
Maximum value of average log flush time for which spin-delay is used.
When flushing takes longer, user threads no longer spin when waiting for flushed redo. Expressed in microseconds.
ulong srv_log_wait_for_flush_timeout |
Timeout used when waiting for redo flush (microseconds).
ulong srv_log_wait_for_write_spin_delay |
Number of spin iterations, when spinning and waiting for log buffer written up to given LSN, before we fallback to loop with sleeps.
This is not used when user thread has to wait for log flushed to disk.
ulong srv_log_wait_for_write_timeout |
Timeout used when waiting for redo write (microseconds).
ulong srv_log_write_ahead_size |
Size of block, used for writing ahead to avoid read-on-write.
ulong srv_log_write_events = INNODB_LOG_EVENTS_DEFAULT |
Number of events used for notifications about redo write.
ulong srv_log_write_max_size = INNODB_LOG_WRITE_MAX_SIZE_DEFAULT |
When log writer follows links in the log recent written buffer, it stops when it has reached at least that many bytes to write, limiting how many bytes can be written in single call.
ulong srv_log_write_notifier_spin_delay |
Number of spin iterations, for which log write notifier thread is waiting for advanced flushed_to_disk_lsn without sleeping.
Number of spin iterations, for which log write notifier thread is waiting for advanced writeed_to_disk_lsn without sleeping.
ulong srv_log_write_notifier_timeout |
Initial timeout used to wait on write_notifier_event.
ulong srv_log_writer_spin_delay = INNODB_LOG_WRITER_SPIN_DELAY_DEFAULT |
Number of spin iterations, for which log writer thread is waiting for new data to write or flush without sleeping.
bool srv_log_writer_threads |
Whether to activate/pause the log writer threads.
ulong srv_log_writer_timeout = INNODB_LOG_WRITER_TIMEOUT_DEFAULT |
Initial timeout used to wait on writer_event.
|
static |
Log writes involving flush.
ulong srv_LRU_scan_depth = 1024 |
Scan depth for LRU flush batch i.e.
: number of blocks scanned
|
static |
Iterations of the loop bounded by 'srv_active' label.
|
static |
Iterations of the loop bounded by the 'srv_idle' label.
|
static |
Iterations of the loop bounded by the 'srv_shutdown' label.
|
static |
const char* srv_main_thread_op_info = "" |
|
static |
|
constexpr |
|
static |
Slot index in the srv_sys->sys_threads array for the master thread.
bool srv_master_thread_disabled_debug |
Used by SET GLOBAL innodb_master_thread_disabled_debug = X.
Value of MySQL global used to disable master thread.
|
static |
Event used to inform that master thread is disabled.
double srv_max_buf_pool_modified_pct = 75.0 |
double srv_max_dirty_pages_pct_lwm = 0.0 |
ulong srv_max_io_capacity = 400 |
unsigned long long srv_max_undo_tablespace_size |
Maximum size of undo tablespace.
FILE* srv_misc_tmpfile |
Temporary file for miscellaneous diagnostic output.
ib_mutex_t srv_misc_tmpfile_mutex |
Mutex for locking srv_misc_tmpfile.
Not created if srv_read_only_mode. This mutex has a very low rank; threads reserving it should not acquire any further latches or sleep before releasing this one.
os_event_t srv_monitor_event |
Event to signal the monitor thread.
FILE* srv_monitor_file |
Temporary file for innodb monitor output.
ib_mutex_t srv_monitor_file_mutex |
|
static |
ulong srv_n_page_cleaners = 4 |
ulong srv_n_page_hash_locks = 16 |
Number of locks to protect buf_pool->page_hash.
ulong srv_n_purge_threads = 4 |
ulong srv_n_read_io_threads |
|
static |
|
static |
|
static |
|
static |
ulong srv_n_spin_wait_rounds = 30 |
|
static |
|
static |
|
static |
|
static |
ulong srv_n_write_io_threads |
bool srv_numa_interleave = false |
unsigned long long srv_online_max_size |
Maximum modification log file size for online index creation.
ulong srv_page_size = UNIV_PAGE_SIZE_DEF |
ulong srv_page_size_shift = UNIV_PAGE_SIZE_SHIFT_DEF |
ulong srv_parallel_read_threads |
Number of threads to use for parallel reads.
bool srv_print_all_deadlocks = false |
Print all user-level transactions deadlocks to mysqld stderr.
bool srv_print_ddl_logs = false |
Print all DDL logs to mysqld stderr.
bool srv_print_innodb_lock_monitor = false |
bool srv_print_innodb_monitor = false |
bool srv_priority_boost = true |
ulong srv_purge_batch_size = 20 |
ulong srv_purge_rseg_truncate_frequency |
Rate at which UNDO records should be purged.
|
static |
Slot index in the srv_sys->sys_threads array for the purge thread.
bool srv_random_read_ahead = false |
ulong srv_read_ahead_threshold = 56 |
bool srv_read_only_mode |
Set if InnoDB must operate in read-only mode.
We don't do any recovery and open all tables in RO mode instead of RW mode. We don't sync the max trx id to disk either.
bool srv_redo_log = true |
If innodb redo logging is enabled.
ulonglong srv_redo_log_capacity |
Value of innodb_redo_log_capacity.
Expressed in bytes. Might be set during startup automatically when started in "dedicated server mode".
ulonglong srv_redo_log_capacity_used |
Assumed value of innodb_redo_log_capacity's - value which is used.
Expressed in bytes. Might be set during startup automatically when started in "dedicated server mode". Might also be set during startup when old sysvar (innodb_log_file_size or innodb_log_files_in_group) are configured and the new sysvar (innodb_redo_log_capacity) is not.
bool srv_redo_log_encrypt = false |
Enable or disable Encrypt of REDO tablespace.
Enable or Disable Encrypt of REDO tablespace.
ulong srv_replication_delay = 0 |
ulong srv_rollback_segments = TRX_SYS_N_RSEGS |
The number of rollback segments per tablespace.
uint32_t srv_rseg_init_threads = 1 |
Number of threads spawned for initializing rollback segments in parallel.
ulong srv_sort_buf_size = 1048576 |
Sort buffer size in index creation.
ulong srv_spin_wait_delay = 6 |
PSI_stage_info srv_stage_alter_table_end |
Performance schema stage event for monitoring ALTER TABLE progress everything after flush log_make_latest_checkpoint().
PSI_stage_info srv_stage_alter_table_flush |
Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint().
PSI_stage_info srv_stage_alter_table_insert |
Performance schema stage event for monitoring ALTER TABLE progress.
Performance schema stage event for monitoring ALTER TABLE progress row_merge_insert_index_tuples().
PSI_stage_info srv_stage_alter_table_log_index |
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().
PSI_stage_info srv_stage_alter_table_log_table |
Performance schema stage event for monitoring ALTER TABLE progress row_log_table_apply().
PSI_stage_info srv_stage_alter_table_merge_sort |
Performance schema stage event for monitoring ALTER TABLE progress.
Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().
PSI_stage_info srv_stage_alter_table_read_pk_internal_sort |
Performance schema stage event for monitoring ALTER TABLE progress.
Performance schema stage event for monitoring ALTER TABLE progress row_merge_read_clustered_index().
PSI_stage_info srv_stage_alter_tablespace_encryption |
Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress.
PSI_stage_info srv_stage_buffer_pool_load |
Performance schema stage event for monitoring buffer pool load progress.
PSI_stage_info srv_stage_clone_file_copy |
Performance schema stage event for monitoring clone file copy progress.
PSI_stage_info srv_stage_clone_page_copy |
Performance schema stage event for monitoring clone page copy progress.
PSI_stage_info srv_stage_clone_redo_copy |
Performance schema stage event for monitoring clone redo copy progress.
srv_stats_t srv_stats |
Global counters.
bool srv_stats_auto_recalc = true |
bool srv_stats_include_delete_marked = false |
bool srv_stats_persistent = true |
unsigned long long srv_stats_persistent_sample_pages = 20 |
unsigned long long srv_stats_transient_sample_pages = 8 |
Srv_threads srv_threads |
Structure with state of srv background threads.
ulint srv_truncated_status_writes = 0 |
char* srv_undo_dir = nullptr |
Undo tablespace directories.
Server undo tablespaces directory, can be absolute path.
This can be multiple paths separated by ';' and can also be absolute paths.
bool srv_undo_log_encrypt = false |
Enable or disable Encrypt of UNDO tablespace.
bool srv_undo_log_truncate = false |
Enable or Disable Truncate of UNDO tablespace.
Note: If enabled then UNDO tablespace will be selected for truncate. While Server waits for undo-tablespace to truncate if user disables it, truncate action is completed but no new tablespace is marked for truncate (action is never aborted).
ulong srv_undo_logs = 0 |
ulong srv_undo_tablespaces = FSP_IMPLICIT_UNDO_TABLESPACES |
The number of implicit undo tablespaces to use for rollback segments.
Number of undo tablespaces to use.
enum srv_unix_flush_t srv_unix_file_flush_method = SRV_UNIX_FSYNC |
bool srv_use_fdatasync = false |
Use fdatasync() instead of fsync().
bool srv_use_native_aio = false |
If this flag is true, then we will use the native aio of the OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads.
bool srv_validate_tablespace_paths = true |
Whether to validate InnoDB tablespace paths on startup.
bool tbsp_extend_and_initialize = true |
Enable or disable writing of NULLs while extending a tablespace.
If this is false, then the server will just allocate the space without actually initializing it with NULLs. If the variable is true, the server will allocate and initialize the space by writing NULLs in it.
page_size_t univ_page_size(0, 0, false) | ( | 0 | , |
0 | , | ||
false | |||
) |