MySQL 8.0.39
Source Code Documentation
srv0srv.h File Reference

The server main program. More...

#include "buf0checksum.h"
#include "fil0fil.h"
#include "mysql/psi/mysql_stage.h"
#include "univ.i"
#include "log0ddl.h"
#include "os0event.h"
#include "os0file.h"
#include "os0thread.h"
#include "que0types.h"
#include "srv0conc.h"
#include "trx0types.h"
#include "ut0counter.h"
#include <cstdint>
#include <future>

Go to the source code of this file.

Classes

struct  srv_stats_t
 
struct  Srv_threads
 Structure which keeps shared future objects for InnoDB background threads. More...
 
struct  Srv_cpu_usage
 
struct  export_var_t
 Status variables to be passed to MySQL. More...
 
struct  srv_slot_t
 Thread slot in the thread table. More...
 

Macros

#define SRV_BUF_DUMP_FILENAME_DEFAULT   "ib_buffer_pool"
 The buffer pool dump/load file name. More...
 
#define SRV_AUTO_EXTEND_INCREMENT   (srv_sys_space.get_autoextend_increment())
 

Typedefs

typedef enum srv_stats_method_name_enum srv_stats_method_name_t
 

Enumerations

enum  srv_unix_flush_t {
  SRV_UNIX_FSYNC = 0 , SRV_UNIX_O_DSYNC , SRV_UNIX_LITTLESYNC , SRV_UNIX_NOSYNC ,
  SRV_UNIX_O_DIRECT , SRV_UNIX_O_DIRECT_NO_FSYNC
}
 Alternatives for the file flush option in Unix. More...
 
enum  {
  SRV_FORCE_IGNORE_CORRUPT = 1 , SRV_FORCE_NO_BACKGROUND = 2 , SRV_FORCE_NO_TRX_UNDO = 3 , SRV_FORCE_NO_IBUF_MERGE = 4 ,
  SRV_FORCE_NO_UNDO_LOG_SCAN = 5 , SRV_FORCE_NO_LOG_REDO = 6
}
 Alternatives for srv_force_recovery. More...
 
enum  srv_stats_method_name_enum { SRV_STATS_NULLS_EQUAL , SRV_STATS_NULLS_UNEQUAL , SRV_STATS_NULLS_IGNORED }
 
enum  srv_thread_type { SRV_NONE , SRV_WORKER , SRV_PURGE , SRV_MASTER }
 Types of threads existing in the system. More...
 

Functions

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...
 
void srv_thread_delay_cleanup_if_needed (bool wait_for_signal)
 Delay the thread after it discovered that the shutdown_state is greater or equal to SRV_SHUTDOWN_CLEANUP, before it proceeds with further clean up. More...
 
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 ()
 
static ulong PCT_IO (ulong p)
 
long innobase_get_open_files_limit ()
 Returns current value of the "innodb_open_files" configuration variable. More...
 
void innobase_set_open_files_limit (long new_limit)
 Sets new value of the "innodb_open_files" configuration variable to present to users. More...
 
std::chrono::milliseconds get_srv_replication_delay ()
 
std::chrono::seconds get_srv_fatal_semaphore_wait_threshold ()
 
bool srv_is_direct_io ()
 
void srv_boot (void)
 Boots Innobase server. More...
 
void srv_free (void)
 Frees the data structures created in srv_init(). 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...
 
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_active_wake_master_thread_low (void)
 Tells the Innobase server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). More...
 
static void srv_active_wake_master_thread ()
 
void srv_wake_master_thread (void)
 Wakes up the master thread if it is suspended or being suspended. More...
 
bool srv_printf_innodb_monitor (FILE *file, bool nowait, ulint *trx_start, 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...
 
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...
 
void srv_inc_activity_count (void)
 Increment the server activity counter. 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...
 
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_master_thread ()
 The master thread controlling the server. More...
 
void srv_purge_coordinator_thread ()
 Purge coordinator thread that schedules the purge tasks. More...
 
void srv_worker_thread ()
 Worker thread that reads tasks from the work queue and executes them. 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...
 
bool srv_enable_redo_encryption ()
 Enable REDO log encryption. More...
 
ulint srv_get_task_queue_length (void)
 Get count of tasks in the queue. More...
 
ulint srv_release_threads (enum srv_thread_type type, ulint n)
 Releases threads of the type given from suspension in the thread table. More...
 
bool srv_master_thread_is_active ()
 Check whether the master thread is active. 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...
 
dberr_t srv_undo_tablespace_create (const char *space_name, const char *file_name, space_id_t space_id)
 Create an undo tablespace with an explicit file name This is called during CREATE UNDO TABLESPACE. More...
 
void undo_spaces_init ()
 Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start(). More...
 
void undo_spaces_deinit ()
 Free the resources occupied by undo::spaces and trx_sys_undo_spaces, called once during thread de-initialization. More...
 
void set_srv_redo_log (bool enable)
 Set redo log variable for performance schema global status. More...
 
void srv_master_thread_disabled_debug_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Disables master thread. 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...
 
Log_DDLlog_ddl
 Object to handle Log_DDL. More...
 
bool srv_is_upgrade_mode
 
bool srv_downgrade_logs
 
bool srv_upgrade_old_undo_found
 
bool srv_downgrade_partition_files
 
const char * srv_main_thread_op_info
 
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
 The buffer pool dump/load thread waits on this event. More...
 
os_event_t srv_buf_resize_event
 The buffer pool resize thread waits on this event. More...
 
char * srv_buf_dump_filename
 The buffer pool dump/load file name. More...
 
bool srv_buffer_pool_dump_at_shutdown
 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
 
bool srv_disable_sort_file_cache
 Whether to disable file system cache. More...
 
bool tbsp_extend_and_initialize
 Enable or disable writing of NULLs while extending a tablespace. More...
 
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...
 
char * srv_data_home
 
uint32_t srv_rseg_init_threads
 Number of threads spawned for initializing rollback segments in parallel. More...
 
ulong srv_dblwr_pages
 Number of pages per doublewrite thread/segment. More...
 
bool srv_read_only_mode
 Set if InnoDB must operate in read-only mode. 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...
 
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_thread_sleep_delay
 Sleep delay for threads waiting to enter InnoDB. More...
 
ulong srv_adaptive_max_sleep_delay
 Maximum sleep delay (in micro-seconds), value of 0 disables it. More...
 
ulong srv_sort_buf_size
 Sort buffer size in index creation. More...
 
unsigned long long srv_online_max_size
 Maximum modification log file size for online index creation. More...
 
ulong srv_parallel_read_threads
 Number of threads to use for parallel reads. More...
 
bool srv_use_native_aio
 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
 
char * srv_innodb_directories
 The innodb_directories variable value. More...
 
char * srv_undo_dir
 Server undo tablespaces directory, can be absolute path. More...
 
ulong srv_undo_tablespaces
 Number of undo tablespaces to use. More...
 
ulong srv_rollback_segments
 The number of rollback segments per tablespace. More...
 
unsigned long long srv_max_undo_tablespace_size
 Maximum size of undo tablespace. More...
 
ulong srv_purge_rseg_truncate_frequency
 Rate at which UNDO records should be purged. More...
 
bool srv_undo_log_truncate
 Enable or Disable Truncate of UNDO tablespace. More...
 
bool srv_undo_log_encrypt
 Enable or disable Encrypt 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...
 
char * srv_log_group_home_dir
 
bool srv_redo_log_encrypt
 Enable or Disable Encrypt of REDO tablespace. More...
 
constexpr size_t SRV_N_LOG_FILES_CLONE_MAX = 1000
 
ulong srv_log_n_files
 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_max_size
 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_ahead_size
 Size of block, used for writing ahead to avoid read-on-write. More...
 
ulong srv_log_write_events
 Number of events used for notifications about redo write. More...
 
ulong srv_log_flush_events
 Number of events used for notifications about redo flush. More...
 
ulong srv_log_recent_written_size
 Number of slots in a small buffer, which is used to allow concurrent writes to log buffer. More...
 
ulong srv_log_recent_closed_size
 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...
 
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_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_flush_spin_delay
 Number of spin iterations, when spinning and waiting for log flushed. 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_writer_spin_delay
 Number of spin iterations, for which log writer thread is waiting for new data to write or flush without sleeping. More...
 
ulong srv_log_flusher_spin_delay
 Number of spin iterations, for which log flusher thread is waiting for new data to flush, without sleeping. More...
 
ulong srv_log_write_notifier_spin_delay
 Number of spin iterations, for which log write notifier thread is waiting for advanced writeed_to_disk_lsn without sleeping. 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...
 
bool srv_log_checksums
 Whether to generate and require checksums on the redo log pages. More...
 
bool srv_checkpoint_disabled
 If true then disable checkpointing. More...
 
bool srv_inject_too_many_concurrent_trxs
 
ulong srv_flush_log_at_trx_commit
 
bool srv_adaptive_flushing
 
bool srv_flush_sync
 
bool srv_load_corrupted
 
bool srv_dedicated_server
 Dedicated server setting. More...
 
ulint srv_buf_pool_size
 Requested size in bytes. More...
 
const ulint srv_buf_pool_min_size
 Minimum pool size in bytes. More...
 
const ulint srv_buf_pool_def_size
 Default pool size in bytes. More...
 
const longlong srv_buf_pool_max_size
 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
 Minimum buffer pool chunk size. More...
 
const ulonglong srv_buf_pool_chunk_unit_blk_sz
 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
 Default number of buffer pool instances. More...
 
ulong srv_n_page_hash_locks
 Number of locks to protect buf_pool->page_hash. More...
 
bool srv_validate_tablespace_paths
 Whether to validate InnoDB tablespace paths on startup. More...
 
bool srv_use_fdatasync
 Use fdatasync() instead of fsync(). More...
 
ulong srv_LRU_scan_depth
 Scan depth for LRU flush batch i.e. More...
 
ulong srv_flush_neighbors
 Whether or not to flush neighbors of a block. More...
 
ulint srv_buf_pool_old_size
 Previously requested size. More...
 
ulint srv_buf_pool_base_size
 Current size as scaling factor for the other components. More...
 
long long srv_buf_pool_curr_size
 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
 Lock table size in bytes. More...
 
bool srv_random_read_ahead
 
ulong srv_read_ahead_threshold
 
ulong srv_n_read_io_threads
 
ulong srv_n_write_io_threads
 
uint srv_change_buffer_max_size
 Maximum on-disk size of change buffer in terms of percentage of the buffer pool. More...
 
const ulong srv_idle_flush_pct_default
 Default value of srv_idle_flush_pct. More...
 
ulong srv_idle_flush_pct
 How much flush to be done in case of server is idle. More...
 
ulong srv_io_capacity
 
constexpr uint32_t SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT = UINT32_MAX
 
constexpr uint32_t SRV_MAX_IO_CAPACITY_LIMIT = UINT32_MAX
 
ulong srv_max_io_capacity
 
constexpr uint32_t MAX_PURGE_THREADS = 32
 Maximum number of purge threads, including the purge coordinator. More...
 
ulong srv_innodb_stats_method
 
ulong srv_fatal_semaphore_wait_threshold
 
uint srv_flush_log_at_timeout
 
bool srv_btr_search_enabled
 A value that basically stores the same as btr_search_enabled, but is not atomic and thus can be used as SYSVAR. More...
 
ulong srv_replication_delay
 
ulong srv_log_wait_for_write_timeout
 Timeout used when waiting for redo write (microseconds). More...
 
ulong srv_log_wait_for_flush_timeout
 Timeout used when waiting for redo flush (microseconds). More...
 
ulong srv_log_writer_timeout
 Initial timeout used to wait on writer_event. More...
 
ulong srv_log_checkpoint_every
 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_timeout
 Initial timeout used to wait on flusher_event. More...
 
ulong srv_log_write_notifier_timeout
 Initial timeout used to wait on write_notifier_event. More...
 
ulong srv_log_flush_notifier_timeout
 Initial timeout used to wait on flush_notifier_event. More...
 
uint buf_LRU_old_threshold
 Move blocks to "new" LRU list only if the first access was at least this many milliseconds ago. More...
 
ulong srv_n_page_cleaners
 
double srv_max_dirty_pages_pct
 
double srv_max_dirty_pages_pct_lwm
 
ulong srv_adaptive_flushing_lwm
 
ulong srv_flushing_avg_loops
 
ulong srv_force_recovery
 Normally 0. More...
 
ulong srv_force_recovery_crash
 Inject a crash at different steps of the recovery process. More...
 
ulong srv_fast_shutdown
 The value of the configuration parameter innodb_fast_shutdown, controlling the InnoDB shutdown. More...
 
bool srv_innodb_status
 
unsigned long long srv_stats_transient_sample_pages
 
bool srv_stats_persistent
 
unsigned long long srv_stats_persistent_sample_pages
 
bool srv_stats_auto_recalc
 
bool srv_stats_include_delete_marked
 
ulong srv_checksum_algorithm
 the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t here then we get a compiler error: ha_innodb.cc:12251: error: cannot convert 'srv_checksum_algorithm_t*' to 'long unsigned int*' in initialization More...
 
double srv_max_buf_pool_modified_pct
 
ulong srv_max_purge_lag
 Maximum allowable purge history length. More...
 
ulong srv_max_purge_lag_delay
 Max DML user threads delay in micro-seconds. More...
 
bool srv_print_innodb_monitor
 
std::atomic_uint32_t srv_innodb_needs_monitoring
 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
 
ulong srv_n_spin_wait_rounds
 
ulong srv_n_free_tickets_to_enter
 Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket. More...
 
ulong srv_spin_wait_delay
 
bool srv_priority_boost
 
ulint srv_truncated_status_writes
 
bool srv_ibuf_disable_background_merge
 
bool srv_buf_pool_debug
 This is used to enable multiple buffer pool instances with small buffer pool size. More...
 
bool srv_sync_debug
 
bool srv_purge_view_update_only_debug
 
bool srv_master_thread_disabled_debug
 Value of MySQL global used to disable master thread. More...
 
std::atomic< int > srv_fatal_semaphore_wait_extend
 
ulint srv_dml_needed_delay
 
constexpr uint32_t SRV_MAX_N_IO_THREADS = 130
 
const char * srv_io_thread_op_info []
 
const char * srv_io_thread_function []
 
ulong srv_n_purge_threads
 
ulong srv_purge_batch_size
 
ulong srv_sync_array_size
 User configured sync array size. More...
 
bool srv_print_all_deadlocks
 Print all user-level transactions deadlocks to mysqld stderr. More...
 
bool srv_print_ddl_logs
 Print all DDL logs to mysqld stderr. More...
 
bool srv_cmp_per_index_enabled
 Enable INFORMATION_SCHEMA.innodb_cmp_per_index. More...
 
bool srv_redo_log
 If innodb redo logging is enabled. More...
 
struct export_var_t export_vars
 Status variables to be passed to MySQL. More...
 
srv_stats_t srv_stats
 Global counters. More...
 
mysql_pfs_key_t log_archiver_thread_key
 
mysql_pfs_key_t page_archiver_thread_key
 
mysql_pfs_key_t buf_dump_thread_key
 
mysql_pfs_key_t buf_resize_thread_key
 
mysql_pfs_key_t clone_ddl_thread_key
 
mysql_pfs_key_t clone_gtid_thread_key
 
mysql_pfs_key_t ddl_thread_key
 
mysql_pfs_key_t dict_stats_thread_key
 
mysql_pfs_key_t fts_optimize_thread_key
 
mysql_pfs_key_t fts_parallel_merge_thread_key
 
mysql_pfs_key_t fts_parallel_tokenization_thread_key
 
mysql_pfs_key_t io_ibuf_thread_key
 
mysql_pfs_key_t io_read_thread_key
 
mysql_pfs_key_t io_write_thread_key
 
mysql_pfs_key_t log_writer_thread_key
 
mysql_pfs_key_t log_files_governor_thread_key
 
mysql_pfs_key_t log_checkpointer_thread_key
 
mysql_pfs_key_t log_flusher_thread_key
 
mysql_pfs_key_t log_write_notifier_thread_key
 
mysql_pfs_key_t log_flush_notifier_thread_key
 
mysql_pfs_key_t page_flush_coordinator_thread_key
 
mysql_pfs_key_t page_flush_thread_key
 
mysql_pfs_key_t recv_writer_thread_key
 
mysql_pfs_key_t srv_error_monitor_thread_key
 
mysql_pfs_key_t srv_lock_timeout_thread_key
 
mysql_pfs_key_t srv_master_thread_key
 
mysql_pfs_key_t srv_monitor_thread_key
 
mysql_pfs_key_t srv_purge_thread_key
 
mysql_pfs_key_t srv_worker_thread_key
 
mysql_pfs_key_t trx_recovery_rollback_thread_key
 
mysql_pfs_key_t srv_ts_alter_encrypt_thread_key
 
mysql_pfs_key_t parallel_read_thread_key
 
mysql_pfs_key_t parallel_rseg_init_thread_key
 
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 row_merge_insert_index_tuples(). 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 row_merge_sort(). More...
 
PSI_stage_info srv_stage_alter_table_read_pk_internal_sort
 Performance schema stage event for monitoring ALTER TABLE progress row_merge_read_clustered_index(). 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...
 
enum srv_unix_flush_t srv_unix_file_flush_method
 
ulong srv_debug_compress
 Force all user tables to use page compression. More...
 

Detailed Description

The server main program.

Created 10/10/1995 Heikki Tuuri

Macro Definition Documentation

◆ SRV_AUTO_EXTEND_INCREMENT

#define SRV_AUTO_EXTEND_INCREMENT   (srv_sys_space.get_autoextend_increment())

◆ SRV_BUF_DUMP_FILENAME_DEFAULT

#define SRV_BUF_DUMP_FILENAME_DEFAULT   "ib_buffer_pool"

The buffer pool dump/load file name.

Typedef Documentation

◆ srv_stats_method_name_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Alternatives for srv_force_recovery.

Non-zero values are intended to help the user get a damaged database up so that he can dump intact tables and rows with SELECT INTO OUTFILE. The database must not otherwise be used with these options! A bigger number below means that all precautions of lower numbers are included.

Enumerator
SRV_FORCE_IGNORE_CORRUPT 

let the server run even if it detects a corrupt page

SRV_FORCE_NO_BACKGROUND 

prevent the main thread from running: if a crash would occur in purge, this prevents it

SRV_FORCE_NO_TRX_UNDO 

do not run trx rollback after recovery

SRV_FORCE_NO_IBUF_MERGE 

prevent also ibuf operations: if they would cause a crash, better not do them

SRV_FORCE_NO_UNDO_LOG_SCAN 

do not look at undo logs when starting the database: InnoDB will treat even incomplete transactions as committed

SRV_FORCE_NO_LOG_REDO 

do not do the log roll-forward in connection with recovery

◆ srv_stats_method_name_enum

Enumerator
SRV_STATS_NULLS_EQUAL 
SRV_STATS_NULLS_UNEQUAL 
SRV_STATS_NULLS_IGNORED 

◆ srv_thread_type

Types of threads existing in the system.

Enumerator
SRV_NONE 

None.

SRV_WORKER 

threads serving parallelized queries and queries released from lock wait

SRV_PURGE 

Purge coordinator thread.

SRV_MASTER 

the master thread, (whose type number must be biggest)

◆ srv_unix_flush_t

Alternatives for the file flush option in Unix.

See also
innodb_flush_method_names
Enumerator
SRV_UNIX_FSYNC 

fsync, the default

SRV_UNIX_O_DSYNC 

open log files in O_SYNC mode

SRV_UNIX_LITTLESYNC 

do not call os_file_flush() when writing data files, but do flush after writing to log files

SRV_UNIX_NOSYNC 

do not flush after writing

SRV_UNIX_O_DIRECT 

invoke os_file_set_nocache() on data files.

This implies using non-buffered IO but still using fsync, the reason for which is that some FS do not flush meta-data when unbuffered IO happens

SRV_UNIX_O_DIRECT_NO_FSYNC 

do not use fsync() when using direct IO i.e.

: it can be set to avoid the fsync() call that we make when using SRV_UNIX_O_DIRECT. However, in this case user/DBA should be sure about the integrity of the meta-data

Function Documentation

◆ get_srv_fatal_semaphore_wait_threshold()

std::chrono::seconds get_srv_fatal_semaphore_wait_threshold ( )

◆ get_srv_flush_log_at_timeout()

std::chrono::seconds get_srv_flush_log_at_timeout ( )

◆ get_srv_log_checkpoint_every()

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).

◆ get_srv_log_flush_notifier_timeout()

std::chrono::microseconds get_srv_log_flush_notifier_timeout ( )

Initial timeout used to wait on flush_notifier_event.

◆ get_srv_log_flusher_timeout()

std::chrono::microseconds get_srv_log_flusher_timeout ( )

Initial timeout used to wait on flusher_event.

◆ get_srv_log_wait_for_flush_timeout()

std::chrono::microseconds get_srv_log_wait_for_flush_timeout ( )

Timeout used when waiting for redo flush.

◆ get_srv_log_wait_for_write_timeout()

std::chrono::microseconds get_srv_log_wait_for_write_timeout ( )

Timeout used when waiting for redo write.

◆ get_srv_log_write_notifier_timeout()

std::chrono::microseconds get_srv_log_write_notifier_timeout ( )

Initial timeout used to wait on write_notifier_event.

◆ get_srv_log_writer_timeout()

std::chrono::microseconds get_srv_log_writer_timeout ( )

Initial timeout used to wait on writer_event.

◆ get_srv_replication_delay()

std::chrono::milliseconds get_srv_replication_delay ( )

◆ innobase_get_open_files_limit()

long innobase_get_open_files_limit ( )

Returns current value of the "innodb_open_files" configuration variable.

◆ innobase_set_open_files_limit()

void innobase_set_open_files_limit ( long  new_limit)

Sets new value of the "innodb_open_files" configuration variable to present to users.

Parameters
[in]new_limitnew limit to be set.

◆ PCT_IO()

static ulong PCT_IO ( ulong  p)
inlinestatic

◆ set_srv_redo_log()

void set_srv_redo_log ( bool  enable)

Set redo log variable for performance schema global status.

Parameters
[in]enabletrue => redo log enabled, false => redo log disabled

◆ set_undo_tablespace_encryption()

bool set_undo_tablespace_encryption ( space_id_t  space_id,
mtr_t mtr 
)

Set encryption for UNDO tablespace with given space id.

Parameters
[in]space_idUndo tablespace id
[in]mtrMini-transaction
Returns
false for success, true otherwise

◆ srv_active_wake_master_thread()

static void srv_active_wake_master_thread ( )
inlinestatic

◆ srv_active_wake_master_thread_low()

void srv_active_wake_master_thread_low ( void  )

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 kernel mutex, for performance reasons).

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).

◆ srv_boot()

void srv_boot ( void  )

Boots Innobase server.

Boots Innobase server.

◆ srv_check_activity()

bool srv_check_activity ( ulint  old_activity_count)

Check if there has been any activity.

Returns
false if no change in activity counter. old activity count
false if no change in activity counter.
Parameters
old_activity_countin: old activity count

◆ srv_enable_redo_encryption()

bool srv_enable_redo_encryption ( )

Enable REDO log encryption.

Returns
false for success, true otherwise.

◆ srv_enable_undo_encryption()

bool srv_enable_undo_encryption ( )

Enable UNDO tablespaces encryption.

Returns
false for success, true otherwise.

◆ srv_error_monitor_thread()

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.

◆ srv_export_innodb_status()

void srv_export_innodb_status ( void  )

Function to pass InnoDB status variables to MySQL.

◆ srv_free()

void srv_free ( void  )

Frees the data structures created in srv_init().

◆ srv_get_activity_count()

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.

Returns
activity count.

◆ srv_get_task_queue_length()

ulint srv_get_task_queue_length ( void  )

Get count of tasks in the queue.

Returns
number of tasks in queue

◆ srv_inc_activity_count()

void srv_inc_activity_count ( void  )

Increment the server activity counter.

Increment the server activity counter.

◆ srv_is_direct_io()

bool srv_is_direct_io ( )
inline

◆ srv_master_thread()

void srv_master_thread ( )

The master thread controlling the server.

◆ srv_master_thread_disabled_debug_update()

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).

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ srv_master_thread_is_active()

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).

See also
srv_pre_dd_shutdown()
Return values
trueif any thread is active
falseif no thread is active

◆ srv_monitor_thread()

void srv_monitor_thread ( )

A thread which prints the info output by various InnoDB monitors.

◆ srv_printf_innodb_monitor()

bool srv_printf_innodb_monitor ( FILE *  file,
bool  nowait,
ulint trx_start,
ulint trx_end 
)

Outputs to a file the output of the InnoDB Monitor.

Parameters
[in]fileoutput stream
[in]nowaitwhether to wait for the exclusive global lock_sys latch
[out]trx_startfile position of the start of the list of active transactions
[out]trx_endfile position of the end of the list of active transactions
Returns
false if not all information printed due to failure to obtain necessary mutex

◆ srv_purge_coordinator_thread()

void srv_purge_coordinator_thread ( )

Purge coordinator thread that schedules the purge tasks.

◆ srv_purge_threads_active()

bool srv_purge_threads_active ( )

Check if the purge threads are active, both coordinator and worker threads.

Returns
true if any thread is active, false if no thread is active

◆ srv_purge_wakeup()

void srv_purge_wakeup ( void  )

Wakeup the purge threads.

◆ srv_que_task_enqueue_low()

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

Parameters
thrin: query thread

◆ srv_release_threads()

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!

Returns
number of threads released: this may be less than n if not enough threads were suspended at the moment in: number of threads to release

NOTE! The server mutex has to be reserved by the caller!

Returns
number of threads released: this may be less than n if not enough threads were suspended at the moment.
Parameters
typein: thread type
nin: number of threads to release

◆ srv_reset_io_thread_op_info()

void srv_reset_io_thread_op_info ( )

Resets the info describing an i/o thread current state.

◆ srv_set_io_thread_op_info()

void srv_set_io_thread_op_info ( ulint  i,
const char *  str 
)

Sets the info describing an i/o thread current state.

Parameters
[in]iThe 'segment' of the i/o thread
[in]strConstant char string describing the state

◆ srv_thread_delay_cleanup_if_needed()

void srv_thread_delay_cleanup_if_needed ( bool  wait_for_signal)

Delay the thread after it discovered that the shutdown_state is greater or equal to SRV_SHUTDOWN_CLEANUP, before it proceeds with further clean up.

This is used in the tests to see if such a possible delay does not have impact on the clean shutdown.

Parameters
[in]wait_for_signalwait until shutdown phase starts

◆ srv_thread_is_active()

bool srv_thread_is_active ( const IB_thread thread)

Check if given thread is still active.

◆ srv_thread_is_stopped()

bool srv_thread_is_stopped ( const IB_thread thread)

Check if given thread is cleaned-up and stopped.

◆ srv_undo_tablespace_create()

dberr_t srv_undo_tablespace_create ( const char *  space_name,
const char *  file_name,
space_id_t  space_id 
)

Create an undo tablespace with an explicit file name This is called during CREATE UNDO TABLESPACE.

Parameters
[in]space_nametablespace name
[in]file_namefile name
[in]space_idTablespace ID
Returns
DB_SUCCESS or error code

◆ srv_wake_master_thread()

void srv_wake_master_thread ( void  )

Wakes up the master thread if it is suspended or being suspended.

◆ srv_wake_purge_thread_if_not_active()

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 operation with the srv_sys_t:mutex, for performance reasons).

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).

◆ srv_worker_thread()

void srv_worker_thread ( )

Worker thread that reads tasks from the work queue and executes them.

◆ undo_spaces_deinit()

void undo_spaces_deinit ( )

Free the resources occupied by undo::spaces and trx_sys_undo_spaces, called once during thread de-initialization.

◆ undo_spaces_init()

void undo_spaces_init ( )

Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start().

Variable Documentation

◆ buf_dump_thread_key

mysql_pfs_key_t buf_dump_thread_key
extern

◆ buf_LRU_old_threshold

uint buf_LRU_old_threshold
extern

Move blocks to "new" LRU list only if the first access was at least this many milliseconds ago.

Not protected by any mutex or latch.

◆ buf_resize_thread_key

mysql_pfs_key_t buf_resize_thread_key
extern

◆ clone_ddl_thread_key

mysql_pfs_key_t clone_ddl_thread_key
extern

◆ clone_gtid_thread_key

mysql_pfs_key_t clone_gtid_thread_key
extern

◆ CONCURRENT_UNDO_TRUNCATE_LIMIT

const size_t CONCURRENT_UNDO_TRUNCATE_LIMIT
extern

Maximum number of recently truncated undo tablespace IDs for the same undo number.

◆ ddl_thread_key

mysql_pfs_key_t ddl_thread_key
extern

◆ dict_stats_thread_key

mysql_pfs_key_t dict_stats_thread_key
extern

◆ export_vars

struct export_var_t export_vars
extern

Status variables to be passed to MySQL.

◆ fts_optimize_thread_key

mysql_pfs_key_t fts_optimize_thread_key
extern

◆ fts_parallel_merge_thread_key

mysql_pfs_key_t fts_parallel_merge_thread_key
extern

◆ fts_parallel_tokenization_thread_key

mysql_pfs_key_t fts_parallel_tokenization_thread_key
extern

◆ high_level_read_only

bool high_level_read_only
extern

Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UNDO.

◆ io_ibuf_thread_key

mysql_pfs_key_t io_ibuf_thread_key
extern

◆ io_read_thread_key

mysql_pfs_key_t io_read_thread_key
extern

◆ io_write_thread_key

mysql_pfs_key_t io_write_thread_key
extern

◆ log_archiver_thread_key

mysql_pfs_key_t log_archiver_thread_key
extern

◆ log_checkpointer_thread_key

mysql_pfs_key_t log_checkpointer_thread_key
extern

◆ log_ddl

Log_DDL* log_ddl
extern

Object to handle Log_DDL.

◆ log_files_governor_thread_key

mysql_pfs_key_t log_files_governor_thread_key
extern

◆ log_flush_notifier_thread_key

mysql_pfs_key_t log_flush_notifier_thread_key
extern

◆ log_flusher_thread_key

mysql_pfs_key_t log_flusher_thread_key
extern

◆ log_write_notifier_thread_key

mysql_pfs_key_t log_write_notifier_thread_key
extern

◆ log_writer_thread_key

mysql_pfs_key_t log_writer_thread_key
extern

◆ MAX_PURGE_THREADS

constexpr uint32_t MAX_PURGE_THREADS = 32
constexpr

Maximum number of purge threads, including the purge coordinator.

◆ page_archiver_thread_key

mysql_pfs_key_t page_archiver_thread_key
extern

◆ page_flush_coordinator_thread_key

mysql_pfs_key_t page_flush_coordinator_thread_key
extern

◆ page_flush_thread_key

mysql_pfs_key_t page_flush_thread_key
extern

◆ page_zip_stat_per_index_mutex

ib_mutex_t page_zip_stat_per_index_mutex
extern

Mutex protecting page_zip_stat_per_index.

◆ parallel_read_thread_key

mysql_pfs_key_t parallel_read_thread_key
extern

◆ parallel_rseg_init_thread_key

mysql_pfs_key_t parallel_rseg_init_thread_key
extern

◆ recv_writer_thread_key

mysql_pfs_key_t recv_writer_thread_key
extern

◆ srv_adaptive_flushing

bool srv_adaptive_flushing
extern

◆ srv_adaptive_flushing_lwm

ulong srv_adaptive_flushing_lwm
extern

◆ srv_adaptive_max_sleep_delay

ulong srv_adaptive_max_sleep_delay
extern

Maximum sleep delay (in micro-seconds), value of 0 disables it.

◆ srv_btr_search_enabled

bool srv_btr_search_enabled
extern

A value that basically stores the same as btr_search_enabled, but is not atomic and thus can be used as SYSVAR.

◆ srv_buf_dump_event

os_event_t srv_buf_dump_event
extern

The buffer pool dump/load thread waits on this event.

The buffer pool dump/load thread waits on this event.

◆ srv_buf_dump_filename

char* srv_buf_dump_filename
extern

The buffer pool dump/load file name.

◆ srv_buf_pool_base_size

ulint srv_buf_pool_base_size
extern

Current size as scaling factor for the other components.

◆ srv_buf_pool_chunk_unit

ulonglong srv_buf_pool_chunk_unit
extern

Requested buffer pool chunk size.

Each buffer pool instance consists of one or more chunks.

◆ srv_buf_pool_chunk_unit_blk_sz

const ulonglong srv_buf_pool_chunk_unit_blk_sz
extern

The buffer pool chunk size must be a multiple of this number.

◆ srv_buf_pool_chunk_unit_max

const ulonglong srv_buf_pool_chunk_unit_max
extern

Maximum buffer pool chunk size.

◆ srv_buf_pool_chunk_unit_min

const ulonglong srv_buf_pool_chunk_unit_min
extern

Minimum buffer pool chunk size.

◆ srv_buf_pool_curr_size

long long srv_buf_pool_curr_size
extern

Current size in bytes.

◆ srv_buf_pool_debug

bool srv_buf_pool_debug
extern

This is used to enable multiple buffer pool instances with small buffer pool size.

◆ srv_buf_pool_def_size

const ulint srv_buf_pool_def_size
extern

Default pool size in bytes.

◆ srv_buf_pool_dump_pct

ulong srv_buf_pool_dump_pct
extern

Dump this % of each buffer pool during BP dump.

◆ srv_buf_pool_instances

ulong srv_buf_pool_instances
extern

Requested number of buffer pool instances.

◆ srv_buf_pool_instances_default

const ulong srv_buf_pool_instances_default
extern

Default number of buffer pool instances.

◆ srv_buf_pool_max_size

const longlong srv_buf_pool_max_size
extern

Maximum pool size in bytes.

◆ srv_buf_pool_min_size

const ulint srv_buf_pool_min_size
extern

Minimum pool size in bytes.

◆ srv_buf_pool_old_size

ulint srv_buf_pool_old_size
extern

Previously requested size.

Accesses protected by memory barriers.

◆ srv_buf_pool_size

ulint srv_buf_pool_size
extern

Requested size in bytes.

◆ srv_buf_resize_event

os_event_t srv_buf_resize_event
extern

The buffer pool resize thread waits on this event.

The buffer pool resize thread waits on this event.

◆ srv_buffer_pool_dump_at_shutdown

bool srv_buffer_pool_dump_at_shutdown
extern

Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown and/or load it during startup.

◆ srv_buffer_pool_load_at_startup

bool srv_buffer_pool_load_at_startup
extern

◆ srv_change_buffer_max_size

uint srv_change_buffer_max_size
extern

Maximum on-disk size of change buffer in terms of percentage of the buffer pool.

◆ srv_checkpoint_disabled

bool srv_checkpoint_disabled
extern

If true then disable checkpointing.

◆ srv_checksum_algorithm

ulong srv_checksum_algorithm
extern

the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t here then we get a compiler error: ha_innodb.cc:12251: error: cannot convert 'srv_checksum_algorithm_t*' to 'long unsigned int*' in initialization

◆ srv_cmp_per_index_enabled

bool srv_cmp_per_index_enabled
extern

Enable INFORMATION_SCHEMA.innodb_cmp_per_index.

◆ srv_cpu_usage

Srv_cpu_usage srv_cpu_usage
extern

Structure with cpu usage information.

◆ srv_data_home

char* srv_data_home
extern

◆ srv_dblwr_pages

ulong srv_dblwr_pages
extern

Number of pages per doublewrite thread/segment.

◆ srv_debug_compress

ulong srv_debug_compress
extern

Force all user tables to use page compression.

◆ srv_dedicated_server

bool srv_dedicated_server
extern

Dedicated server setting.

◆ srv_disable_sort_file_cache

bool srv_disable_sort_file_cache
extern

Whether to disable file system cache.

◆ srv_dml_needed_delay

ulint srv_dml_needed_delay
extern

◆ srv_downgrade_logs

bool srv_downgrade_logs
extern

◆ srv_downgrade_partition_files

bool srv_downgrade_partition_files
extern

◆ srv_error_event

os_event_t srv_error_event
extern

Event to signal the error thread.

◆ srv_error_monitor_thread_key

mysql_pfs_key_t srv_error_monitor_thread_key
extern

◆ srv_fast_shutdown

ulong srv_fast_shutdown
extern

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).

◆ srv_fatal_semaphore_wait_extend

std::atomic<int> srv_fatal_semaphore_wait_extend
extern

◆ srv_fatal_semaphore_wait_threshold

ulong srv_fatal_semaphore_wait_threshold
extern

◆ srv_file_per_table

bool srv_file_per_table
extern

store to its own file each table created by an user; data dictionary tables are in the system tablespace 0

◆ srv_flush_log_at_timeout

uint srv_flush_log_at_timeout
extern

◆ srv_flush_log_at_trx_commit

ulong srv_flush_log_at_trx_commit
extern

◆ srv_flush_neighbors

ulong srv_flush_neighbors
extern

Whether or not to flush neighbors of a block.

◆ srv_flush_sync

bool srv_flush_sync
extern

◆ srv_flushing_avg_loops

ulong srv_flushing_avg_loops
extern

◆ srv_force_recovery

ulong srv_force_recovery
extern

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.

◆ srv_force_recovery_crash

ulong srv_force_recovery_crash
extern

Inject a crash at different steps of the recovery process.

This is for testing and debugging only.

◆ srv_ibuf_disable_background_merge

bool srv_ibuf_disable_background_merge
extern

◆ srv_idle_flush_pct

ulong srv_idle_flush_pct
extern

How much flush to be done in case of server is idle.

◆ srv_idle_flush_pct_default

const ulong srv_idle_flush_pct_default
extern

Default value of srv_idle_flush_pct.

◆ srv_inject_too_many_concurrent_trxs

bool srv_inject_too_many_concurrent_trxs
extern

◆ srv_innodb_directories

char* srv_innodb_directories
extern

The innodb_directories variable value.

This a list of directories deliminated by ';', i.e the FIL_PATH_SEPARATOR.

◆ srv_innodb_needs_monitoring

std::atomic_uint32_t srv_innodb_needs_monitoring
extern

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.

◆ srv_innodb_stats_method

ulong srv_innodb_stats_method
extern

◆ srv_innodb_status

bool srv_innodb_status
extern

◆ srv_io_capacity

ulong srv_io_capacity
extern

◆ srv_io_thread_function

const char* srv_io_thread_function[]
extern

◆ srv_io_thread_op_info

const char* srv_io_thread_op_info[]
extern

◆ srv_is_upgrade_mode

bool srv_is_upgrade_mode
extern

◆ srv_load_corrupted

bool srv_load_corrupted
extern

◆ srv_lock_table_size

ulint srv_lock_table_size
extern

Lock table size in bytes.

◆ srv_lock_timeout_thread_key

mysql_pfs_key_t srv_lock_timeout_thread_key
extern

◆ srv_log_buffer_size

ulong srv_log_buffer_size
extern

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.

◆ srv_log_checkpoint_every

ulong srv_log_checkpoint_every
extern

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).

◆ srv_log_checksums

bool srv_log_checksums
extern

Whether to generate and require checksums on the redo log pages.

◆ srv_log_file_size

ulonglong srv_log_file_size
extern

Value of innodb_log_file_size.

Expressed in bytes. This is deprecated.

◆ srv_log_flush_events

ulong srv_log_flush_events
extern

Number of events used for notifications about redo flush.

◆ srv_log_flush_notifier_spin_delay

ulong srv_log_flush_notifier_spin_delay
extern

Number of spin iterations, for which log flush notifier thread is waiting for advanced flushed_to_disk_lsn without sleeping.

◆ srv_log_flush_notifier_timeout

ulong srv_log_flush_notifier_timeout
extern

Initial timeout used to wait on flush_notifier_event.

◆ srv_log_flusher_spin_delay

ulong srv_log_flusher_spin_delay
extern

Number of spin iterations, for which log flusher thread is waiting for new data to flush, without sleeping.

◆ srv_log_flusher_timeout

ulong srv_log_flusher_timeout
extern

Initial timeout used to wait on flusher_event.

◆ srv_log_group_home_dir

char* srv_log_group_home_dir
extern

◆ srv_log_n_files

ulong srv_log_n_files
extern

Value of innodb_log_files_in_group.

This is deprecated.

◆ srv_log_recent_closed_size

ulong srv_log_recent_closed_size
extern

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.

The slots are addressed by LSN values modulo number of the slots.

◆ srv_log_recent_written_size

ulong srv_log_recent_written_size
extern

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.

◆ srv_log_spin_cpu_abs_lwm

uint srv_log_spin_cpu_abs_lwm
extern

Minimum absolute value of cpu time for which spin-delay is used.

◆ srv_log_spin_cpu_pct_hwm

uint srv_log_spin_cpu_pct_hwm
extern

Maximum percentage of cpu time for which spin-delay is used.

◆ srv_log_wait_for_flush_spin_delay

ulong srv_log_wait_for_flush_spin_delay
extern

Number of spin iterations, when spinning and waiting for log flushed.

◆ srv_log_wait_for_flush_spin_hwm

ulong srv_log_wait_for_flush_spin_hwm
extern

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.

◆ srv_log_wait_for_flush_timeout

ulong srv_log_wait_for_flush_timeout
extern

Timeout used when waiting for redo flush (microseconds).

◆ srv_log_wait_for_write_spin_delay

ulong srv_log_wait_for_write_spin_delay
extern

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.

◆ srv_log_wait_for_write_timeout

ulong srv_log_wait_for_write_timeout
extern

Timeout used when waiting for redo write (microseconds).

◆ srv_log_write_ahead_size

ulong srv_log_write_ahead_size
extern

Size of block, used for writing ahead to avoid read-on-write.

◆ srv_log_write_events

ulong srv_log_write_events
extern

Number of events used for notifications about redo write.

◆ srv_log_write_max_size

ulong srv_log_write_max_size
extern

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.

◆ srv_log_write_notifier_spin_delay

ulong srv_log_write_notifier_spin_delay
extern

Number of spin iterations, for which log write notifier thread is waiting for advanced writeed_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.

◆ srv_log_write_notifier_timeout

ulong srv_log_write_notifier_timeout
extern

Initial timeout used to wait on write_notifier_event.

◆ srv_log_writer_spin_delay

ulong srv_log_writer_spin_delay
extern

Number of spin iterations, for which log writer thread is waiting for new data to write or flush without sleeping.

◆ srv_log_writer_threads

bool srv_log_writer_threads
extern

Whether to activate/pause the log writer threads.

◆ srv_log_writer_timeout

ulong srv_log_writer_timeout
extern

Initial timeout used to wait on writer_event.

◆ srv_LRU_scan_depth

ulong srv_LRU_scan_depth
extern

Scan depth for LRU flush batch i.e.

: number of blocks scanned

◆ srv_main_thread_op_info

const char* srv_main_thread_op_info
extern

◆ srv_master_thread_disabled_debug

bool srv_master_thread_disabled_debug
extern

Value of MySQL global used to disable master thread.

Value of MySQL global used to disable master thread.

◆ srv_master_thread_key

mysql_pfs_key_t srv_master_thread_key
extern

◆ srv_max_buf_pool_modified_pct

double srv_max_buf_pool_modified_pct
extern

◆ srv_max_dirty_pages_pct

double srv_max_dirty_pages_pct
extern

◆ srv_max_dirty_pages_pct_lwm

double srv_max_dirty_pages_pct_lwm
extern

◆ srv_max_io_capacity

ulong srv_max_io_capacity
extern

◆ SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT

constexpr uint32_t SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT = UINT32_MAX
constexpr

◆ SRV_MAX_IO_CAPACITY_LIMIT

constexpr uint32_t SRV_MAX_IO_CAPACITY_LIMIT = UINT32_MAX
constexpr

◆ SRV_MAX_N_IO_THREADS

constexpr uint32_t SRV_MAX_N_IO_THREADS = 130
constexpr

◆ srv_max_purge_lag

ulong srv_max_purge_lag
extern

Maximum allowable purge history length.

<=0 means 'infinite'.

◆ srv_max_purge_lag_delay

ulong srv_max_purge_lag_delay
extern

Max DML user threads delay in micro-seconds.

◆ srv_max_undo_tablespace_size

unsigned long long srv_max_undo_tablespace_size
extern

Maximum size of undo tablespace.

◆ srv_misc_tmpfile

FILE* srv_misc_tmpfile
extern

Temporary file for miscellaneous diagnostic output.

◆ srv_misc_tmpfile_mutex

ib_mutex_t srv_misc_tmpfile_mutex
extern

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.

◆ srv_monitor_event

os_event_t srv_monitor_event
extern

Event to signal the monitor thread.

◆ srv_monitor_file

FILE* srv_monitor_file
extern

Temporary file for innodb monitor output.

◆ srv_monitor_file_mutex

ib_mutex_t srv_monitor_file_mutex
extern

◆ srv_monitor_thread_key

mysql_pfs_key_t srv_monitor_thread_key
extern

◆ srv_n_free_tickets_to_enter

ulong srv_n_free_tickets_to_enter
extern

Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket.

◆ SRV_N_LOG_FILES_CLONE_MAX

constexpr size_t SRV_N_LOG_FILES_CLONE_MAX = 1000
constexpr

◆ srv_n_page_cleaners

ulong srv_n_page_cleaners
extern

◆ srv_n_page_hash_locks

ulong srv_n_page_hash_locks
extern

Number of locks to protect buf_pool->page_hash.

◆ srv_n_purge_threads

ulong srv_n_purge_threads
extern

◆ srv_n_read_io_threads

ulong srv_n_read_io_threads
extern

◆ srv_n_spin_wait_rounds

ulong srv_n_spin_wait_rounds
extern

◆ srv_n_write_io_threads

ulong srv_n_write_io_threads
extern

◆ srv_numa_interleave

bool srv_numa_interleave
extern

◆ srv_online_max_size

unsigned long long srv_online_max_size
extern

Maximum modification log file size for online index creation.

◆ srv_parallel_read_threads

ulong srv_parallel_read_threads
extern

Number of threads to use for parallel reads.

◆ srv_print_all_deadlocks

bool srv_print_all_deadlocks
extern

Print all user-level transactions deadlocks to mysqld stderr.

◆ srv_print_ddl_logs

bool srv_print_ddl_logs
extern

Print all DDL logs to mysqld stderr.

◆ srv_print_innodb_lock_monitor

bool srv_print_innodb_lock_monitor
extern

◆ srv_print_innodb_monitor

bool srv_print_innodb_monitor
extern

◆ srv_priority_boost

bool srv_priority_boost
extern

◆ srv_purge_batch_size

ulong srv_purge_batch_size
extern

◆ srv_purge_rseg_truncate_frequency

ulong srv_purge_rseg_truncate_frequency
extern

Rate at which UNDO records should be purged.

◆ srv_purge_thread_key

mysql_pfs_key_t srv_purge_thread_key
extern

◆ srv_purge_view_update_only_debug

bool srv_purge_view_update_only_debug
extern

◆ srv_random_read_ahead

bool srv_random_read_ahead
extern

◆ srv_read_ahead_threshold

ulong srv_read_ahead_threshold
extern

◆ srv_read_only_mode

bool srv_read_only_mode
extern

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.

◆ srv_redo_log

bool srv_redo_log
extern

If innodb redo logging is enabled.

◆ srv_redo_log_capacity

ulonglong srv_redo_log_capacity
extern

Value of innodb_redo_log_capacity.

Expressed in bytes. Might be set during startup automatically when started in "dedicated server mode".

◆ srv_redo_log_capacity_used

ulonglong srv_redo_log_capacity_used
extern

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.

◆ srv_redo_log_encrypt

bool srv_redo_log_encrypt
extern

Enable or Disable Encrypt of REDO tablespace.

Enable or Disable Encrypt of REDO tablespace.

◆ srv_replication_delay

ulong srv_replication_delay
extern

◆ srv_rollback_segments

ulong srv_rollback_segments
extern

The number of rollback segments per tablespace.

◆ srv_rseg_init_threads

uint32_t srv_rseg_init_threads
extern

Number of threads spawned for initializing rollback segments in parallel.

◆ srv_sort_buf_size

ulong srv_sort_buf_size
extern

Sort buffer size in index creation.

◆ srv_spin_wait_delay

ulong srv_spin_wait_delay
extern

◆ srv_stage_alter_table_end

PSI_stage_info srv_stage_alter_table_end
extern

Performance schema stage event for monitoring ALTER TABLE progress everything after flush log_make_latest_checkpoint().

◆ srv_stage_alter_table_flush

PSI_stage_info srv_stage_alter_table_flush
extern

Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint().

◆ srv_stage_alter_table_insert

PSI_stage_info srv_stage_alter_table_insert
extern

Performance schema stage event for monitoring ALTER TABLE progress row_merge_insert_index_tuples().

Performance schema stage event for monitoring ALTER TABLE progress row_merge_insert_index_tuples().

◆ srv_stage_alter_table_log_index

PSI_stage_info srv_stage_alter_table_log_index
extern

Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().

◆ srv_stage_alter_table_log_table

PSI_stage_info srv_stage_alter_table_log_table
extern

Performance schema stage event for monitoring ALTER TABLE progress row_log_table_apply().

◆ srv_stage_alter_table_merge_sort

PSI_stage_info srv_stage_alter_table_merge_sort
extern

Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().

Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().

◆ srv_stage_alter_table_read_pk_internal_sort

PSI_stage_info srv_stage_alter_table_read_pk_internal_sort
extern

Performance schema stage event for monitoring ALTER TABLE progress row_merge_read_clustered_index().

Performance schema stage event for monitoring ALTER TABLE progress row_merge_read_clustered_index().

◆ srv_stage_alter_tablespace_encryption

PSI_stage_info srv_stage_alter_tablespace_encryption
extern

Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress.

◆ srv_stage_buffer_pool_load

PSI_stage_info srv_stage_buffer_pool_load
extern

Performance schema stage event for monitoring buffer pool load progress.

◆ srv_stage_clone_file_copy

PSI_stage_info srv_stage_clone_file_copy
extern

Performance schema stage event for monitoring clone file copy progress.

◆ srv_stage_clone_page_copy

PSI_stage_info srv_stage_clone_page_copy
extern

Performance schema stage event for monitoring clone page copy progress.

◆ srv_stage_clone_redo_copy

PSI_stage_info srv_stage_clone_redo_copy
extern

Performance schema stage event for monitoring clone redo copy progress.

◆ srv_stats

srv_stats_t srv_stats
extern

Global counters.

◆ srv_stats_auto_recalc

bool srv_stats_auto_recalc
extern

◆ srv_stats_include_delete_marked

bool srv_stats_include_delete_marked
extern

◆ srv_stats_persistent

bool srv_stats_persistent
extern

◆ srv_stats_persistent_sample_pages

unsigned long long srv_stats_persistent_sample_pages
extern

◆ srv_stats_transient_sample_pages

unsigned long long srv_stats_transient_sample_pages
extern

◆ srv_sync_array_size

ulong srv_sync_array_size
extern

User configured sync array size.

◆ srv_sync_debug

bool srv_sync_debug
extern

◆ srv_thread_sleep_delay

ulong srv_thread_sleep_delay
extern

Sleep delay for threads waiting to enter InnoDB.

In micro-seconds.

◆ srv_threads

Srv_threads srv_threads
extern

Structure with state of srv background threads.

◆ srv_truncated_status_writes

ulint srv_truncated_status_writes
extern

◆ srv_ts_alter_encrypt_thread_key

mysql_pfs_key_t srv_ts_alter_encrypt_thread_key
extern

◆ srv_undo_dir

char* srv_undo_dir
extern

Server undo tablespaces directory, can be absolute path.

Server undo tablespaces directory, can be absolute path.

This can be multiple paths separated by ';' and can also be absolute paths.

◆ srv_undo_log_encrypt

bool srv_undo_log_encrypt
extern

Enable or disable Encrypt of UNDO tablespace.

◆ srv_undo_log_truncate

bool srv_undo_log_truncate
extern

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).

◆ srv_undo_tablespaces

ulong srv_undo_tablespaces
extern

Number of undo tablespaces to use.

Number of undo tablespaces to use.

◆ srv_unix_file_flush_method

enum srv_unix_flush_t srv_unix_file_flush_method
extern

◆ srv_upgrade_old_undo_found

bool srv_upgrade_old_undo_found
extern

◆ srv_use_fdatasync

bool srv_use_fdatasync
extern

Use fdatasync() instead of fsync().

◆ srv_use_native_aio

bool srv_use_native_aio
extern

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.

◆ srv_validate_tablespace_paths

bool srv_validate_tablespace_paths
extern

Whether to validate InnoDB tablespace paths on startup.

◆ srv_worker_thread_key

mysql_pfs_key_t srv_worker_thread_key
extern

◆ tbsp_extend_and_initialize

bool tbsp_extend_and_initialize
extern

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.

◆ trx_recovery_rollback_thread_key

mysql_pfs_key_t trx_recovery_rollback_thread_key
extern