MySQL 8.0.39
Source Code Documentation
|
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_DDL * | log_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... | |
The server main program.
Created 10/10/1995 Heikki Tuuri
#define SRV_AUTO_EXTEND_INCREMENT (srv_sys_space.get_autoextend_increment()) |
#define SRV_BUF_DUMP_FILENAME_DEFAULT "ib_buffer_pool" |
The buffer pool dump/load file name.
typedef enum srv_stats_method_name_enum srv_stats_method_name_t |
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.
enum srv_thread_type |
enum srv_unix_flush_t |
Alternatives for the file flush option in Unix.
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 | ( | ) |
long innobase_get_open_files_limit | ( | ) |
Returns current value of the "innodb_open_files" configuration variable.
void innobase_set_open_files_limit | ( | long | new_limit | ) |
Sets new value of the "innodb_open_files" configuration variable to present to users.
[in] | new_limit | new limit to be set. |
|
inlinestatic |
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 |
|
inlinestatic |
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).
void srv_boot | ( | void | ) |
Boots Innobase 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 |
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().
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.
ulint srv_get_task_queue_length | ( | void | ) |
Get count of tasks in the queue.
void srv_inc_activity_count | ( | void | ) |
Increment the server activity counter.
Increment the server activity counter.
|
inline |
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 |
void srv_monitor_thread | ( | ) |
A thread which prints the info output by various InnoDB monitors.
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 |
void srv_purge_coordinator_thread | ( | ) |
Purge coordinator thread that schedules the purge tasks.
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 |
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!
NOTE! The server mutex has to be reserved by the caller!
type | in: thread type |
n | in: number of threads to release |
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 |
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.
[in] | wait_for_signal | wait until shutdown phase starts |
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.
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.
[in] | space_name | tablespace name |
[in] | file_name | file name |
[in] | space_id | Tablespace ID |
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 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).
void srv_worker_thread | ( | ) |
Worker thread that reads tasks from the work queue and executes them.
void undo_spaces_deinit | ( | ) |
Free the resources occupied by undo::spaces and trx_sys_undo_spaces, called once during thread de-initialization.
void undo_spaces_init | ( | ) |
Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start().
|
extern |
|
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.
|
extern |
|
extern |
|
extern |
|
extern |
Maximum number of recently truncated undo tablespace IDs for the same undo number.
|
extern |
|
extern |
|
extern |
Status variables to be passed to MySQL.
|
extern |
|
extern |
|
extern |
|
extern |
Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UNDO.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Object to handle Log_DDL.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
constexpr |
Maximum number of purge threads, including the purge coordinator.
|
extern |
|
extern |
|
extern |
|
extern |
Mutex protecting page_zip_stat_per_index.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Maximum sleep delay (in micro-seconds), value of 0 disables it.
|
extern |
A value that basically stores the same as btr_search_enabled, but is not atomic and thus can be used as SYSVAR.
|
extern |
The buffer pool dump/load thread waits on this event.
The buffer pool dump/load thread waits on this event.
|
extern |
The buffer pool dump/load file name.
|
extern |
Current size as scaling factor for the other components.
|
extern |
Requested buffer pool chunk size.
Each buffer pool instance consists of one or more chunks.
|
extern |
The buffer pool chunk size must be a multiple of this number.
|
extern |
Maximum buffer pool chunk size.
|
extern |
Minimum buffer pool chunk size.
|
extern |
Current size in bytes.
|
extern |
This is used to enable multiple buffer pool instances with small buffer pool size.
|
extern |
Default pool size in bytes.
|
extern |
Dump this % of each buffer pool during BP dump.
|
extern |
Requested number of buffer pool instances.
|
extern |
Default number of buffer pool instances.
|
extern |
Maximum pool size in bytes.
|
extern |
Minimum pool size in bytes.
|
extern |
Previously requested size.
Accesses protected by memory barriers.
|
extern |
Requested size in bytes.
|
extern |
The buffer pool resize thread waits on this event.
The buffer pool resize thread waits on this event.
|
extern |
Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown and/or load it during startup.
|
extern |
|
extern |
Maximum on-disk size of change buffer in terms of percentage of the buffer pool.
|
extern |
If true then disable checkpointing.
|
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
|
extern |
Enable INFORMATION_SCHEMA.innodb_cmp_per_index.
|
extern |
Structure with cpu usage information.
|
extern |
|
extern |
Number of pages per doublewrite thread/segment.
|
extern |
Force all user tables to use page compression.
|
extern |
Dedicated server setting.
|
extern |
Whether to disable file system cache.
|
extern |
|
extern |
|
extern |
|
extern |
Event to signal the error thread.
|
extern |
|
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).
|
extern |
|
extern |
|
extern |
store to its own file each table created by an user; data dictionary tables are in the system tablespace 0
|
extern |
|
extern |
|
extern |
Whether or not to flush neighbors of a block.
|
extern |
|
extern |
|
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.
|
extern |
Inject a crash at different steps of the recovery process.
This is for testing and debugging only.
|
extern |
|
extern |
How much flush to be done in case of server is idle.
|
extern |
Default value of srv_idle_flush_pct.
|
extern |
|
extern |
The innodb_directories variable value.
This a list of directories deliminated by ';', i.e the FIL_PATH_SEPARATOR.
|
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.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Lock table size in bytes.
|
extern |
|
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.
|
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).
|
extern |
Whether to generate and require checksums on the redo log pages.
|
extern |
Value of innodb_log_file_size.
Expressed in bytes. This is deprecated.
|
extern |
Number of events used for notifications about redo flush.
|
extern |
Number of spin iterations, for which log flush notifier thread is waiting for advanced flushed_to_disk_lsn without sleeping.
|
extern |
Initial timeout used to wait on flush_notifier_event.
|
extern |
Number of spin iterations, for which log flusher thread is waiting for new data to flush, without sleeping.
|
extern |
Initial timeout used to wait on flusher_event.
|
extern |
|
extern |
Value of innodb_log_files_in_group.
This is deprecated.
|
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.
|
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.
|
extern |
Minimum absolute value of cpu time for which spin-delay is used.
|
extern |
Maximum percentage of cpu time for which spin-delay is used.
|
extern |
Number of spin iterations, when spinning and waiting for log flushed.
|
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.
|
extern |
Timeout used when waiting for redo flush (microseconds).
|
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.
|
extern |
Timeout used when waiting for redo write (microseconds).
|
extern |
Size of block, used for writing ahead to avoid read-on-write.
|
extern |
Number of events used for notifications about redo write.
|
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.
|
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.
|
extern |
Initial timeout used to wait on write_notifier_event.
|
extern |
Number of spin iterations, for which log writer thread is waiting for new data to write or flush without sleeping.
|
extern |
Whether to activate/pause the log writer threads.
|
extern |
Initial timeout used to wait on writer_event.
|
extern |
Scan depth for LRU flush batch i.e.
: number of blocks scanned
|
extern |
|
extern |
Value of MySQL global used to disable master thread.
Value of MySQL global used to disable master thread.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
constexpr |
|
constexpr |
|
constexpr |
|
extern |
Maximum allowable purge history length.
<=0 means 'infinite'.
|
extern |
Max DML user threads delay in micro-seconds.
|
extern |
Maximum size of undo tablespace.
|
extern |
Temporary file for miscellaneous diagnostic output.
|
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.
|
extern |
Event to signal the monitor thread.
|
extern |
Temporary file for innodb monitor output.
|
extern |
|
extern |
|
extern |
Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket.
|
constexpr |
|
extern |
|
extern |
Number of locks to protect buf_pool->page_hash.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Maximum modification log file size for online index creation.
|
extern |
Number of threads to use for parallel reads.
|
extern |
Print all user-level transactions deadlocks to mysqld stderr.
|
extern |
Print all DDL logs to mysqld stderr.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Rate at which UNDO records should be purged.
|
extern |
|
extern |
|
extern |
|
extern |
|
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.
|
extern |
If innodb redo logging is enabled.
|
extern |
Value of innodb_redo_log_capacity.
Expressed in bytes. Might be set during startup automatically when started in "dedicated server mode".
|
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.
|
extern |
Enable or Disable Encrypt of REDO tablespace.
Enable or Disable Encrypt of REDO tablespace.
|
extern |
|
extern |
The number of rollback segments per tablespace.
|
extern |
Number of threads spawned for initializing rollback segments in parallel.
|
extern |
Sort buffer size in index creation.
|
extern |
|
extern |
Performance schema stage event for monitoring ALTER TABLE progress everything after flush log_make_latest_checkpoint().
|
extern |
Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint().
|
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().
|
extern |
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().
|
extern |
Performance schema stage event for monitoring ALTER TABLE progress row_log_table_apply().
|
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().
|
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().
|
extern |
Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress.
|
extern |
Performance schema stage event for monitoring buffer pool load progress.
|
extern |
Performance schema stage event for monitoring clone file copy progress.
|
extern |
Performance schema stage event for monitoring clone page copy progress.
|
extern |
Performance schema stage event for monitoring clone redo copy progress.
|
extern |
Global counters.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
User configured sync array size.
|
extern |
|
extern |
Sleep delay for threads waiting to enter InnoDB.
In micro-seconds.
|
extern |
Structure with state of srv background threads.
|
extern |
|
extern |
|
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.
|
extern |
Enable or disable Encrypt of UNDO tablespace.
|
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).
|
extern |
Number of undo tablespaces to use.
Number of undo tablespaces to use.
|
extern |
|
extern |
|
extern |
Use fdatasync() instead of fsync().
|
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.
|
extern |
Whether to validate InnoDB tablespace paths on startup.
|
extern |
|
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.
|
extern |