MySQL 8.0.31
Source Code Documentation
srv0srv.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1995, 2022, Oracle and/or its affiliates.
4Copyright (c) 2008, 2009, Google Inc.
5Copyright (c) 2009, Percona Inc.
6
7Portions of this file contain modifications contributed and copyrighted by
8Google, Inc. Those modifications are gratefully acknowledged and are described
9briefly in the InnoDB documentation. The contributions by Google are
10incorporated with their permission, and subject to the conditions contained in
11the file COPYING.Google.
12
13Portions of this file contain modifications contributed and copyrighted
14by Percona Inc.. Those modifications are
15gratefully acknowledged and are described briefly in the InnoDB
16documentation. The contributions by Percona Inc. are incorporated with
17their permission, and subject to the conditions contained in the file
18COPYING.Percona.
19
20This program is free software; you can redistribute it and/or modify it under
21the terms of the GNU General Public License, version 2.0, as published by the
22Free Software Foundation.
23
24This program is also distributed with certain software (including but not
25limited to OpenSSL) that is licensed under separate terms, as designated in a
26particular file or component or in included license documentation. The authors
27of MySQL hereby grant you an additional permission to link the program and
28your derivative works with the separately licensed software that they have
29included with MySQL.
30
31This program is distributed in the hope that it will be useful, but WITHOUT
32ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
33FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
34for more details.
35
36You should have received a copy of the GNU General Public License along with
37this program; if not, write to the Free Software Foundation, Inc.,
3851 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
39
40*****************************************************************************/
41
42/** @file include/srv0srv.h
43 The server main program
44
45 Created 10/10/1995 Heikki Tuuri
46 *******************************************************/
47
48#ifndef srv0srv_h
49#define srv0srv_h
50
51#include "buf0checksum.h"
52#include "fil0fil.h"
54#include "univ.i"
55
56#ifndef UNIV_HOTBACKUP
57#include "log0ddl.h"
58#include "os0event.h"
59#include "os0file.h"
60#include "os0thread.h"
61#include "que0types.h"
62#include "srv0conc.h"
63#include "trx0types.h"
64#include "ut0counter.h"
65
66#include <future>
67
68/* Global counters used inside InnoDB. */
75
76 /** Count the amount of data written in total (in bytes) */
78
79 /** Number of the log write requests done */
81
82 /** Number of physical writes to the log performed */
84
85 /** Amount of data written to the log files in bytes */
87
88 /** Number of writes being done to the log files */
90
91 /** We increase this counter, when we don't have enough
92 space in the log buffer and have to flush it */
94
95 /** Count the number of times the doublewrite buffer was flushed */
97
98 /** Store the number of pages that have been flushed to the
99 doublewrite buffer */
101
102 /** Store the number of write requests issued */
104
105 /** Store the number of times when we had to wait for a free page
106 in the buffer pool. It happens when the buffer pool is full and we
107 need to make a flush, in order to be able to read or create a page. */
109
110 /** Count the number of pages that were written from buffer
111 pool to the disk */
113
114 /** Number of buffer pool reads that led to the reading of
115 a disk page */
117
118 /** Number of data read in total (in bytes) */
120
121 /** Wait time of database locks */
123
124 /** Number of database lock waits */
126
127 /** Number of threads currently waiting on database locks */
129
130 /** Number of rows read. */
132
133 /** Number of rows updated */
135
136 /** Number of rows deleted */
138
139 /** Number of rows inserted */
141
142 /** Number of system rows read. */
144
145 /** Number of system rows updated */
147
148 /** Number of system rows deleted */
150
151 /** Number of system rows inserted */
153
154 /** Number of sampled pages read */
156
157 /** Number of sampled pages skipped */
159};
160
161/** Structure which keeps shared future objects for InnoDB background
162threads. One should use these objects to check if threads exited. */
164 /** Monitor thread (prints info). */
166
167 /** Error monitor thread. */
169
170 /** Redo files governor thread. */
172
173 /** Redo checkpointer thread. */
175
176 /** Redo writer thread. */
178
179 /** Redo flusher thread. */
181
182 /** Redo write notifier thread. */
184
185 /** Redo flush notifier thread. */
187
188 /** Redo log archiver (used by backup). */
190
191 /** Buffer pool dump thread. */
193
194 /** Buffer pool resize thread. */
196
197 /** Dict stats background thread. */
199
200 /** Thread detecting lock wait timeouts. */
202
203 /** The master thread. */
205
206 /** The ts_alter_encrypt thread. */
208
209 /** Thread doing rollbacks during recovery. */
211
212 /** Thread writing recovered pages during recovery. */
214
215 /** Purge coordinator (also being a worker) */
217
218 /** Number of purge workers and size of array below. */
220
221 /** Purge workers. Note that the m_purge_workers[0] is the same shared
222 state as m_purge_coordinator. */
224
225 /** Page cleaner coordinator (also being a worker). */
227
228 /** Number of page cleaner workers and size of array below. */
230
231 /** Page cleaner workers. Note that m_page_cleaner_workers[0] is the
232 same shared state as m_page_cleaner_coordinator. */
234
235 /** Archiver's log archiver (used by Clone). */
237
238 /** Archiver's page archiver (used by Clone). */
240
241 /** Thread doing optimization for FTS index. */
243
244 /** Thread for GTID persistence */
246
247#ifdef UNIV_DEBUG
248 /** Used in test scenario to delay threads' cleanup until the pre_dd_shutdown
249 is ended and final plugin's shutdown is started (when plugin is DELETED).
250 Note that you may only delay the shutdown for threads for which there is no
251 waiting procedure used in the pre_dd_shutdown. */
253#endif /* UNIV_DEBUG */
254
255 /** When the master thread notices that shutdown has started (by noticing
256 srv_shutdown_state >= SRV_SHUTDOWN_PRE_DD_AND_SYSTEM_TRANSACTIONS), it exits
257 its main loop. Then the master thread proceeds with actions related to tasks:
258 - which it has been responsible for,
259 - and which might depend on DD objects.
260 After finishing them, the master thread sets this event.
261 @remarks We use this event to wait in srv_pre_dd_shutdown before we enter
262 next phase (SRV_SHUTDOWN_PURGE) in which master thread is not allowed to
263 use system transactions or touch DD objects. */
265};
266
267/** Check if given thread is still active. */
268bool srv_thread_is_active(const IB_thread &thread);
269
270/** Check if given thread is cleaned-up and stopped. */
271bool srv_thread_is_stopped(const IB_thread &thread);
272
273/** Delay the thread after it discovered that the shutdown_state
274is greater or equal to SRV_SHUTDOWN_CLEANUP, before it proceeds
275with further clean up. This is used in the tests to see if such
276a possible delay does not have impact on the clean shutdown.
277@param[in] wait_for_signal wait until shutdown phase starts */
278void srv_thread_delay_cleanup_if_needed(bool wait_for_signal);
279
281 int n_cpu;
282 double utime_abs;
283 double stime_abs;
284 double utime_pct;
285 double stime_pct;
286};
287
288/** Structure with state of srv background threads. */
290
291/** Structure with cpu usage information. */
293
294extern Log_DDL *log_ddl;
295
296#ifdef INNODB_DD_TABLE
297extern bool srv_is_upgrade_mode;
298extern bool srv_downgrade_logs;
300#endif /* INNODB_DD_TABLE */
301
303
304extern const char *srv_main_thread_op_info;
305
306/* The monitor thread waits on this event. */
308
309/* The error monitor thread waits on this event. */
311
312/** The buffer pool dump/load thread waits on this event. */
314
315/** The buffer pool resize thread waits on this event. */
317#endif /* !UNIV_HOTBACKUP */
318
319/** The buffer pool dump/load file name */
320#define SRV_BUF_DUMP_FILENAME_DEFAULT "ib_buffer_pool"
321extern char *srv_buf_dump_filename;
322
323/** Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown
324and/or load it during startup. */
327
328/* Whether to disable file system cache if it is defined */
330
331/** Enable or disable writing of NULLs while extending a tablespace.
332If this is false, then the server will just allocate the space without
333actually initializing it with NULLs. If the variable is true, the
334server will allocate and initialize the space by writing NULLs in it. */
336
337/* If the last data file is auto-extended, we add this many pages to it
338at a time */
339#define SRV_AUTO_EXTEND_INCREMENT (srv_sys_space.get_autoextend_increment())
340
341#ifndef UNIV_HOTBACKUP
342/** Mutex protecting page_zip_stat_per_index */
343extern ib_mutex_t page_zip_stat_per_index_mutex;
344/* Mutex for locking srv_monitor_file. Not created if srv_read_only_mode */
345extern ib_mutex_t srv_monitor_file_mutex;
346/* Temporary file for innodb monitor output */
347extern FILE *srv_monitor_file;
348/* Mutex for locking srv_misc_tmpfile. Only created if !srv_read_only_mode.
349This mutex has a very low rank; threads reserving it should not
350acquire any further latches or sleep before releasing this one. */
351extern ib_mutex_t srv_misc_tmpfile_mutex;
352/* Temporary file for miscellaneous diagnostic output */
353extern FILE *srv_misc_tmpfile;
354#endif /* !UNIV_HOTBACKUP */
355
356/* Server parameters which are read from the initfile */
357
358extern char *srv_data_home;
359
360/* Number of threads used for initializing rollback segments */
361extern uint32_t srv_rseg_init_threads;
362
363/** Number of pages per doublewrite thread/segment */
364extern ulong srv_dblwr_pages;
365
366/** Set if InnoDB must operate in read-only mode. We don't do any
367recovery and open all tables in RO mode instead of RW mode. We don't
368sync the max trx id to disk either. */
369extern bool srv_read_only_mode;
370/** Set if InnoDB operates in read-only mode or innodb-force-recovery
371is greater than SRV_FORCE_NO_TRX_UNDO. */
372extern bool high_level_read_only;
373/** store to its own file each table created by an user; data
374dictionary tables are in the system tablespace 0 */
375extern bool srv_file_per_table;
376/** Sleep delay for threads waiting to enter InnoDB. In micro-seconds. */
377extern ulong srv_thread_sleep_delay;
378/** Maximum sleep delay (in micro-seconds), value of 0 disables it.*/
380
381/** Sort buffer size in index creation */
382extern ulong srv_sort_buf_size;
383
384/** Maximum modification log file size for online index creation */
385extern unsigned long long srv_online_max_size;
386
387/** Number of threads to use for parallel reads. */
388extern ulong srv_parallel_read_threads;
389
390/* If this flag is true, then we will use the native aio of the
391OS (provided we compiled Innobase with it in), otherwise we will
392use simulated aio we build below with threads.
393Currently we support native aio on windows and linux */
394extern bool srv_use_native_aio;
395extern bool srv_numa_interleave;
396
397/* The innodb_directories variable value. This a list of directories
398deliminated by ';', i.e the FIL_PATH_SEPARATOR. */
399extern char *srv_innodb_directories;
400
401/** Server undo tablespaces directory, can be absolute path. */
402extern char *srv_undo_dir;
403
404/** Number of undo tablespaces to use. */
405extern ulong srv_undo_tablespaces;
406
407/** The number of rollback segments per tablespace */
408extern ulong srv_rollback_segments;
409
410/** Maximum size of undo tablespace. */
411extern unsigned long long srv_max_undo_tablespace_size;
412
413/** Rate at which UNDO records should be purged. */
415
416/** Enable or Disable Truncate of UNDO tablespace. */
417extern bool srv_undo_log_truncate;
418
419/** Enable or disable Encrypt of UNDO tablespace. */
420extern bool srv_undo_log_encrypt;
421
422/** Maximum number of recently truncated undo tablespace IDs for
423the same undo number. */
424extern const size_t CONCURRENT_UNDO_TRUNCATE_LIMIT;
425
426extern char *srv_log_group_home_dir;
427
428/** Enable or Disable Encrypt of REDO tablespace. */
429extern bool srv_redo_log_encrypt;
430
431/* Maximum number of redo files of a cloned DB. */
432constexpr size_t SRV_N_LOG_FILES_CLONE_MAX = 1000;
433
434/** Value of innodb_log_files_in_group. This is deprecated. */
435extern ulong srv_log_n_files;
436
437/** Value of innodb_log_file_size. Expressed in bytes. This is deprecated. */
439
440/** Value of innodb_redo_log_capacity. Expressed in bytes. Might be set
441during startup automatically when started in "dedicated server mode". */
443
444/** Assumed value of innodb_redo_log_capacity's - value which is used.
445Expressed in bytes. Might be set during startup automatically when
446started in "dedicated server mode". Might also be set during startup
447when old sysvar (innodb_log_file_size or innodb_log_files_in_group)
448are configured and the new sysvar (innodb_redo_log_capacity) is not. */
450
451#ifdef UNIV_DEBUG_DEDICATED
452extern ulong srv_debug_system_mem_size;
453#endif /* UNIV_DEBUG_DEDICATED */
454
455/** Space for log buffer, expressed in bytes. Note, that log buffer
456will use only the largest power of two, which is not greater than
457the assigned space. */
458extern ulong srv_log_buffer_size;
459
460/** When log writer follows links in the log recent written buffer,
461it stops when it has reached at least that many bytes to write,
462limiting how many bytes can be written in single call. */
463extern ulong srv_log_write_max_size;
464
465/** Size of block, used for writing ahead to avoid read-on-write. */
466extern ulong srv_log_write_ahead_size;
467
468/** Number of events used for notifications about redo write. */
469extern ulong srv_log_write_events;
470
471/** Number of events used for notifications about redo flush. */
472extern ulong srv_log_flush_events;
473
474/** Number of slots in a small buffer, which is used to allow concurrent
475writes to log buffer. The slots are addressed by LSN values modulo number
476of the slots. */
477extern ulong srv_log_recent_written_size;
478
479/** Number of slots in a small buffer, which is used to break requirement
480for total order of dirty pages, when they are added to flush lists.
481The slots are addressed by LSN values modulo number of the slots. */
482extern ulong srv_log_recent_closed_size;
483
484/** Whether to activate/pause the log writer threads. */
485extern bool srv_log_writer_threads;
486
487/** Minimum absolute value of cpu time for which spin-delay is used. */
489
490/** Maximum percentage of cpu time for which spin-delay is used. */
492
493/** Number of spin iterations, when spinning and waiting for log buffer
494written up to given LSN, before we fallback to loop with sleeps.
495This is not used when user thread has to wait for log flushed to disk. */
497
498/** Timeout used when waiting for redo write. */
499std::chrono::microseconds get_srv_log_wait_for_write_timeout();
500
501/** Number of spin iterations, when spinning and waiting for log flushed. */
503
504/** Maximum value of average log flush time for which spin-delay is used.
505When flushing takes longer, user threads no longer spin when waiting for
506flushed redo. Expressed in microseconds. */
508
509/** Timeout used when waiting for redo flush. */
510std::chrono::microseconds get_srv_log_wait_for_flush_timeout();
511
512/** Number of spin iterations, for which log writer thread is waiting
513for new data to write or flush without sleeping. */
514extern ulong srv_log_writer_spin_delay;
515
516/** Initial timeout used to wait on writer_event. */
517std::chrono::microseconds get_srv_log_writer_timeout();
518
519/** Period every which a periodical checkpoint is written by the log
520checkpointer thread (unless periodical checkpoints are disabled,
521which is a case during initial phase of startup). */
522std::chrono::milliseconds get_srv_log_checkpoint_every();
523
524/** Number of spin iterations, for which log flusher thread is waiting
525for new data to flush, without sleeping. */
526extern ulong srv_log_flusher_spin_delay;
527
528/** Initial timeout used to wait on flusher_event. */
529std::chrono::microseconds get_srv_log_flusher_timeout();
530
531/** Number of spin iterations, for which log write notifier thread is waiting
532for advanced writeed_to_disk_lsn without sleeping. */
534
535/** Initial timeout used to wait on write_notifier_event. */
536std::chrono::microseconds get_srv_log_write_notifier_timeout();
537
538/** Number of spin iterations, for which log flush notifier thread is waiting
539for advanced flushed_to_disk_lsn without sleeping. */
541
542/** Initial timeout used to wait on flush_notifier_event. */
543std::chrono::microseconds get_srv_log_flush_notifier_timeout();
544
545/** Whether to generate and require checksums on the redo log pages. */
546extern bool srv_log_checksums;
547
548#ifdef UNIV_DEBUG
549
550/** If true then disable checkpointing. */
551extern bool srv_checkpoint_disabled;
552
553/* Used to inject a failure to find a free rollback segment. */
555
556#endif /* UNIV_DEBUG */
557
558extern ulong srv_flush_log_at_trx_commit;
561extern bool srv_adaptive_flushing;
562extern bool srv_flush_sync;
563
564/* If this flag is true, then we will load the indexes' (and tables') metadata
565even if they are marked as "corrupted". Mostly it is for DBA to process
566corrupted index and table */
567extern bool srv_load_corrupted;
568
569/** Dedicated server setting */
570extern bool srv_dedicated_server;
571/** Requested size in bytes */
573/** Minimum pool size in bytes */
574extern const ulint srv_buf_pool_min_size;
575/** Default pool size in bytes */
576extern const ulint srv_buf_pool_def_size;
577/** Maximum pool size in bytes */
579/** Requested buffer pool chunk size. Each buffer pool instance consists
580of one or more chunks. */
582/** Minimum buffer pool chunk size. */
584/** The buffer pool chunk size must be a multiple of this number. */
586/** Maximum buffer pool chunk size. */
588
589/** Requested number of buffer pool instances */
590extern ulong srv_buf_pool_instances;
591/** Default number of buffer pool instances */
592extern const ulong srv_buf_pool_instances_default;
593/** Number of locks to protect buf_pool->page_hash */
594extern ulong srv_n_page_hash_locks;
595/** Whether to validate InnoDB tablespace paths on startup */
597/** Use fdatasync() instead of fsync(). */
598extern bool srv_use_fdatasync;
599/** Scan depth for LRU flush batch i.e.: number of blocks scanned*/
600extern ulong srv_LRU_scan_depth;
601/** Whether or not to flush neighbors of a block */
602extern ulong srv_flush_neighbors;
603/** Previously requested size. Accesses protected by memory barriers. */
605/** Current size as scaling factor for the other components */
607/** Current size in bytes */
608extern long long srv_buf_pool_curr_size;
609/** Dump this % of each buffer pool during BP dump */
610extern ulong srv_buf_pool_dump_pct;
611/** Lock table size in bytes */
613
615extern bool srv_random_read_ahead;
616extern ulong srv_read_ahead_threshold;
617extern ulong srv_n_read_io_threads;
618extern ulong srv_n_write_io_threads;
619
621
622/** Default value of srv_idle_flush_pct */
623extern const ulong srv_idle_flush_pct_default;
624/** How much flush to be done in case of server is idle */
625extern ulong srv_idle_flush_pct;
626
627/* Number of IO operations per second the server can do */
628extern ulong srv_io_capacity;
629
630/* We use this dummy default value at startup for max_io_capacity.
631The real value is set based on the value of io_capacity. */
633constexpr uint32_t SRV_MAX_IO_CAPACITY_LIMIT = ~0U;
634extern ulong srv_max_io_capacity;
635/* Returns the number of IO operations that is X percent of the
636capacity. PCT_IO(5) -> returns the number of IO operations that
637is 5% of the max where max is srv_io_capacity. */
638static inline ulong PCT_IO(ulong p) {
639 return (ulong)(srv_io_capacity * ((double)(p) / 100.0));
640}
641
642/** Maximum number of purge threads, including the purge coordinator */
643constexpr uint32_t MAX_PURGE_THREADS = 32;
644
645/* The "innodb_stats_method" setting, decides how InnoDB is going
646to treat NULL value when collecting statistics. It is not defined
647as enum type because the configure option takes unsigned integer type. */
648extern ulong srv_innodb_stats_method;
649
650/** Returns current value of the "innodb_open_files" configuration variable. */
652/** Sets new value of the "innodb_open_files" configuration variable to present
653to users.
654@param[in] new_limit new limit to be set. */
655void innobase_set_open_files_limit(long new_limit);
656
657extern ulong srv_n_page_cleaners;
658
659extern double srv_max_dirty_pages_pct;
660extern double srv_max_dirty_pages_pct_lwm;
661
662extern ulong srv_adaptive_flushing_lwm;
663extern ulong srv_flushing_avg_loops;
664
665extern ulong srv_force_recovery;
666#ifdef UNIV_DEBUG
667extern ulong srv_force_recovery_crash;
668#endif /* UNIV_DEBUG */
669
670/** The value of the configuration parameter innodb_fast_shutdown,
671controlling the InnoDB shutdown.
672
673If innodb_fast_shutdown=0, InnoDB shutdown will purge all undo log
674records (except XA PREPARE transactions) and complete the merge of the
675entire change buffer, and then shut down the redo log.
676
677If innodb_fast_shutdown=1, InnoDB shutdown will only flush the buffer
678pool to data files, cleanly shutting down the redo log.
679
680If innodb_fast_shutdown=2, shutdown will effectively 'crash' InnoDB
681(but lose no committed transactions). */
682extern ulong srv_fast_shutdown;
683extern bool srv_innodb_status;
684
685extern unsigned long long srv_stats_transient_sample_pages;
686extern bool srv_stats_persistent;
687extern unsigned long long srv_stats_persistent_sample_pages;
688extern bool srv_stats_auto_recalc;
690
691extern ulong srv_checksum_algorithm;
692
694extern ulong srv_max_purge_lag;
695extern ulong srv_max_purge_lag_delay;
696
697std::chrono::milliseconds get_srv_replication_delay();
698/*-------------------------------------------*/
699
700extern bool srv_print_innodb_monitor;
701/** In contrast to srv_print_innodb_monitor which is controlled by the user,
702this variable is controlled by InnoDB itself: if some module of InnoDB decides
703it would be good to print the monitoring information it increments this value,
704and decrements it when it no longer needs it. */
705extern std::atomic_uint32_t srv_innodb_needs_monitoring;
707
708extern ulong srv_n_spin_wait_rounds;
709extern ulong srv_n_free_tickets_to_enter;
710extern ulong srv_spin_wait_delay;
711extern bool srv_priority_boost;
712
714
715#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
717#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
718
719#ifdef UNIV_DEBUG
720extern bool srv_buf_pool_debug;
721extern bool srv_sync_debug;
723
724/** Value of MySQL global used to disable master thread. */
726#endif /* UNIV_DEBUG */
727
729extern std::atomic<int> srv_fatal_semaphore_wait_extend;
730
732
733#ifdef UNIV_HOTBACKUP
734// MAHI: changed from 130 to 1 assuming the apply-log is single threaded
735constexpr uint32_t SRV_MAX_N_IO_THREADS = 1;
736#else /* UNIV_HOTBACKUP */
737constexpr uint32_t SRV_MAX_N_IO_THREADS = 130;
738#endif /* UNIV_HOTBACKUP */
739
740/* Array of English strings describing the current state of an
741i/o handler thread */
742extern const char *srv_io_thread_op_info[];
743extern const char *srv_io_thread_function[];
744
745/* the number of purge threads to use from the worker pool (currently 0 or 1) */
746extern ulong srv_n_purge_threads;
747
748/* the number of pages to purge in one batch */
749extern ulong srv_purge_batch_size;
750
751/* the number of sync wait arrays */
752extern ulong srv_sync_array_size;
753
754/* print all user-level transactions deadlocks to mysqld stderr */
755extern bool srv_print_all_deadlocks;
756
757/** Print all DDL logs to mysqld stderr */
758extern bool srv_print_ddl_logs;
759
760extern bool srv_cmp_per_index_enabled;
761
762extern bool srv_redo_log;
763
764/** Status variables to be passed to MySQL */
765extern struct export_var_t export_vars;
766
767#ifndef UNIV_HOTBACKUP
768/** Global counters */
770
771/* Keys to register InnoDB threads with performance schema */
772
773#ifdef UNIV_PFS_THREAD
809#endif /* UNIV_PFS_THREAD */
810#endif /* !UNIV_HOTBACKUP */
811
812#ifdef HAVE_PSI_STAGE_INTERFACE
813/** Performance schema stage event for monitoring ALTER TABLE progress
814everything after flush log_make_latest_checkpoint(). */
816
817/** Performance schema stage event for monitoring ALTER TABLE progress
818log_make_latest_checkpoint(). */
820
821/** Performance schema stage event for monitoring ALTER TABLE progress
822row_merge_insert_index_tuples(). */
824
825/** Performance schema stage event for monitoring ALTER TABLE progress
826row_log_apply(). */
828
829/** Performance schema stage event for monitoring ALTER TABLE progress
830row_log_table_apply(). */
832
833/** Performance schema stage event for monitoring ALTER TABLE progress
834row_merge_sort(). */
836
837/** Performance schema stage event for monitoring ALTER TABLE progress
838row_merge_read_clustered_index(). */
840
841/** Performance schema stage event for monitoring ALTER TABLESPACE
842ENCRYPTION progress. */
844
845/** Performance schema stage event for monitoring buffer pool load progress. */
847#endif /* HAVE_PSI_STAGE_INTERFACE */
848
849/** Performance schema stage event for monitoring clone file copy progress. */
851
852/** Performance schema stage event for monitoring clone redo copy progress. */
854
855/** Performance schema stage event for monitoring clone page copy progress. */
857
858#ifndef _WIN32
859/** Alternatives for the file flush option in Unix.
860@see innodb_flush_method_names */
862 SRV_UNIX_FSYNC = 0, /*!< fsync, the default */
863 SRV_UNIX_O_DSYNC, /*!< open log files in O_SYNC mode */
864 SRV_UNIX_LITTLESYNC, /*!< do not call os_file_flush()
865 when writing data files, but do flush
866 after writing to log files */
867 SRV_UNIX_NOSYNC, /*!< do not flush after writing */
868 SRV_UNIX_O_DIRECT, /*!< invoke os_file_set_nocache() on
869 data files. This implies using
870 non-buffered IO but still using fsync,
871 the reason for which is that some FS
872 do not flush meta-data when
873 unbuffered IO happens */
875 /*!< do not use fsync() when using
876 direct IO i.e.: it can be set to avoid
877 the fsync() call that we make when
878 using SRV_UNIX_O_DIRECT. However, in
879 this case user/DBA should be sure about
880 the integrity of the meta-data */
883
884inline bool srv_is_direct_io() {
887}
888
889#else
890/** Alternatives for file i/o in Windows. @see innodb_flush_method_names. */
891enum srv_win_flush_t {
892 /** unbuffered I/O; this is the default */
893 SRV_WIN_IO_UNBUFFERED = 0,
894 /** buffered I/O */
895 SRV_WIN_IO_NORMAL,
896};
897extern enum srv_win_flush_t srv_win_file_flush_method;
898
899inline bool srv_is_direct_io() {
900 return (srv_win_file_flush_method == SRV_WIN_IO_UNBUFFERED);
901}
902
903#endif /* _WIN32 */
904
905/** Alternatives for srv_force_recovery. Non-zero values are intended
906to help the user get a damaged database up so that he can dump intact
907tables and rows with SELECT INTO OUTFILE. The database must not otherwise
908be used with these options! A bigger number below means that all precautions
909of lower numbers are included. */
910enum {
911 SRV_FORCE_IGNORE_CORRUPT = 1, /*!< let the server run even if it
912 detects a corrupt page */
913 SRV_FORCE_NO_BACKGROUND = 2, /*!< prevent the main thread from
914 running: if a crash would occur
915 in purge, this prevents it */
916 SRV_FORCE_NO_TRX_UNDO = 3, /*!< do not run trx rollback after
917 recovery */
918 SRV_FORCE_NO_IBUF_MERGE = 4, /*!< prevent also ibuf operations:
919 if they would cause a crash, better
920 not do them */
921 SRV_FORCE_NO_UNDO_LOG_SCAN = 5, /*!< do not look at undo logs when
922 starting the database: InnoDB will
923 treat even incomplete transactions
924 as committed */
925 SRV_FORCE_NO_LOG_REDO = 6 /*!< do not do the log roll-forward
926 in connection with recovery */
928
929/* Alternatives for srv_innodb_stats_method, which could be changed by
930setting innodb_stats_method */
932 SRV_STATS_NULLS_EQUAL, /* All NULL values are treated as
933 equal. This is the default setting
934 for innodb_stats_method */
935 SRV_STATS_NULLS_UNEQUAL, /* All NULL values are treated as
936 NOT equal. */
937 SRV_STATS_NULLS_IGNORED /* NULL values are ignored */
939
941
942#ifdef UNIV_DEBUG
943/** Force all user tables to use page compression. */
944extern ulong srv_debug_compress;
945#endif /* UNIV_DEBUG */
946
947/** Types of threads existing in the system. */
949 SRV_NONE, /*!< None */
950 SRV_WORKER, /*!< threads serving parallelized
951 queries and queries released from
952 lock wait */
953 SRV_PURGE, /*!< Purge coordinator thread */
954 SRV_MASTER /*!< the master thread, (whose type
955 number must be biggest) */
957
958/** Boots Innobase server. */
959void srv_boot(void);
960/** Frees the data structures created in srv_init(). */
961void srv_free(void);
962
963/** Sets the info describing an i/o thread current state.
964@param[in] i The 'segment' of the i/o thread
965@param[in] str Constant char string describing the state */
966void srv_set_io_thread_op_info(ulint i, const char *str);
967
968/** Resets the info describing an i/o thread current state. */
970/** Tells the purge thread that there has been activity in the database
971 and wakes up the purge thread if it is suspended (not sleeping). Note
972 that there is a small chance that the purge thread stays suspended
973 (we do not protect our operation with the srv_sys_t:mutex, for
974 performance reasons). */
976/** Tells the Innobase server that there has been activity in the database
977 and wakes up the master thread if it is suspended (not sleeping). Used
978 in the MySQL interface. Note that there is a small chance that the master
979 thread stays suspended (we do not protect our operation with the kernel
980 mutex, for performance reasons). */
982static inline void srv_active_wake_master_thread() {
983 if (!srv_read_only_mode) {
985 }
986}
987/** Wakes up the master thread if it is suspended or being suspended. */
988void srv_wake_master_thread(void);
989#ifndef UNIV_HOTBACKUP
990/** Outputs to a file the output of the InnoDB Monitor.
991@param[in] file output stream
992@param[in] nowait whether to wait for the exclusive global lock_sys latch
993@param[out] trx_start file position of the start of the list of active
994 transactions
995@param[out] trx_end file position of the end of the list of active
996 transactions
997@return false if not all information printed due to failure to obtain necessary
998 mutex */
999bool srv_printf_innodb_monitor(FILE *file, bool nowait, ulint *trx_start,
1000 ulint *trx_end);
1001
1002/** Function to pass InnoDB status variables to MySQL */
1003void srv_export_innodb_status(void);
1004/** Get current server activity count. We don't hold srv_sys::mutex while
1005 reading this value as it is only used in heuristics.
1006 @return activity count. */
1008/** Check if there has been any activity.
1009 @return false if no change in activity counter. */
1010bool srv_check_activity(ulint old_activity_count); /*!< old activity count */
1011/** Increment the server activity counter. */
1012void srv_inc_activity_count(void);
1013
1014/** Enqueues a task to server task queue and releases a worker thread, if there
1015is a suspended one. */
1016void srv_que_task_enqueue_low(que_thr_t *thr); /*!< in: query thread */
1017
1018/** A thread which prints the info output by various InnoDB monitors. */
1019void srv_monitor_thread();
1020
1021/** A thread which prints warnings about semaphore waits which have lasted
1022too long. These can be used to track bugs which cause hangs. */
1024
1025/** The master thread controlling the server. */
1026void srv_master_thread();
1027
1028/** Purge coordinator thread that schedules the purge tasks. */
1030
1031/** Worker thread that reads tasks from the work queue and executes them. */
1032void srv_worker_thread();
1033
1034/** Set encryption for UNDO tablespace with given space id.
1035@param[in] space_id Undo tablespace id
1036@param[in] mtr Mini-transaction
1037@return false for success, true otherwise */
1039
1040/** Enable UNDO tablespaces encryption.
1041@return false for success, true otherwise. */
1043
1044/** Enable REDO log encryption.
1045@return false for success, true otherwise. */
1047
1048/** Get count of tasks in the queue.
1049 @return number of tasks in queue */
1051
1052/** Releases threads of the type given from suspension in the thread table.
1053 NOTE! The server mutex has to be reserved by the caller!
1054 @return number of threads released: this may be less than n if not
1055 enough threads were suspended at the moment */
1056ulint srv_release_threads(enum srv_thread_type type, /*!< in: thread type */
1057 ulint n); /*!< in: number of threads to release */
1058
1059/** Check whether the master thread is active.
1060This is polled during the final phase of shutdown.
1061The first phase of server shutdown must have already been executed
1062(or the server must not have been fully started up).
1063@see srv_pre_dd_shutdown()
1064@retval true if any thread is active
1065@retval false if no thread is active */
1067
1068/** Wakeup the purge threads. */
1069void srv_purge_wakeup(void);
1070
1071/** Check if the purge threads are active, both coordinator and worker threads
1072@return true if any thread is active, false if no thread is active */
1074
1075/** Create an undo tablespace with an explicit file name
1076This is called during CREATE UNDO TABLESPACE.
1077@param[in] space_name tablespace name
1078@param[in] file_name file name
1079@param[in] space_id Tablespace ID
1080@return DB_SUCCESS or error code */
1081dberr_t srv_undo_tablespace_create(const char *space_name,
1082 const char *file_name, space_id_t space_id);
1083
1084/** Initialize undo::spaces and trx_sys_undo_spaces,
1085called once during srv_start(). */
1086void undo_spaces_init();
1087
1088/** Free the resources occupied by undo::spaces and trx_sys_undo_spaces,
1089called once during thread de-initialization. */
1090void undo_spaces_deinit();
1091
1092/** Set redo log variable for performance schema global status.
1093@param[in] enable true => redo log enabled, false => redo log disabled */
1094void set_srv_redo_log(bool enable);
1095
1096#ifdef UNIV_DEBUG
1097struct SYS_VAR;
1098
1099/** Disables master thread. It's used by:
1100 SET GLOBAL innodb_master_thread_disabled_debug = 1 (0).
1101@param[in] thd thread handle
1102@param[in] var pointer to system variable
1103@param[out] var_ptr where the formal string goes
1104@param[in] save immediate result from check function */
1106 void *var_ptr, const void *save);
1107#endif /* UNIV_DEBUG */
1108#endif /* !UNIV_HOTBACKUP */
1109
1110/** Status variables to be passed to MySQL */
1112 ulint innodb_data_pending_reads; /*!< Pending reads */
1113 ulint innodb_data_pending_writes; /*!< Pending writes */
1114 ulint innodb_data_pending_fsyncs; /*!< Pending fsyncs */
1115 ulint innodb_data_fsyncs; /*!< Number of fsyncs so far */
1116 ulint innodb_data_read; /*!< Data bytes read */
1117 ulint innodb_data_writes; /*!< I/O write requests */
1118 ulint innodb_data_written; /*!< Data bytes written */
1119 ulint innodb_data_reads; /*!< I/O read requests */
1121 128]; /*!< Buf pool dump status */
1123 128]; /*!< Buf pool load status */
1124 char innodb_buffer_pool_resize_status[512]; /*!< Buf pool resize status */
1125 uint32_t
1126 innodb_buffer_pool_resize_status_code; /*!< Buf pool resize status code */
1127 uint32_t innodb_buffer_pool_resize_status_progress; /*!< Buf pool resize
1128 status progess */
1129 ulint innodb_buffer_pool_pages_total; /*!< Buffer pool size */
1131 ulint innodb_buffer_pool_bytes_data; /*!< File bytes used */
1132 ulint innodb_buffer_pool_pages_dirty; /*!< Dirty data pages */
1133 ulint innodb_buffer_pool_bytes_dirty; /*!< File bytes modified */
1134 ulint innodb_buffer_pool_pages_misc; /*!< Miscellaneous pages */
1136#ifdef UNIV_DEBUG
1138#endif /* UNIV_DEBUG */
1139 ulint innodb_buffer_pool_read_requests; /*!< buf_pool->stat.n_page_gets */
1140 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
1141 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
1142 ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */
1143 ulint innodb_buffer_pool_write_requests; /*!< srv_buf_pool_write_requests */
1144 ulint innodb_buffer_pool_read_ahead_rnd; /*!< srv_read_ahead_rnd */
1145 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
1146 ulint innodb_buffer_pool_read_ahead_evicted; /*!< srv_read_ahead evicted*/
1147 ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */
1148 ulint innodb_dblwr_writes; /*!< srv_dblwr_writes */
1149 char innodb_redo_log_resize_status[512]; /*!< Redo log resize status */
1150 bool innodb_redo_log_read_only; /*!< Is redo log read-only ? */
1151 ulonglong innodb_redo_log_uuid; /*!< Redo log UUID */
1152 ulonglong innodb_redo_log_checkpoint_lsn; /*!< Redo log checkpoint LSN */
1153 ulonglong innodb_redo_log_current_lsn; /*!< Redo log current LSN */
1154 ulonglong
1155 innodb_redo_log_flushed_to_disk_lsn; /*!< Redo log flushed to disk LSN */
1156 ulonglong innodb_redo_log_logical_size; /*!< Redo log logical size */
1157 ulonglong innodb_redo_log_physical_size; /*!< Redo log physical size */
1158 ulonglong innodb_redo_log_capacity_resized; /*!< Redo log capacity after
1159 the last finished redo resize */
1160 ulint innodb_log_waits; /*!< srv_log_waits */
1161 ulint innodb_log_write_requests; /*!< srv_log_write_requests */
1162 ulint innodb_log_writes; /*!< srv_log_writes */
1163 lsn_t innodb_os_log_written; /*!< srv_os_log_written */
1164 ulint innodb_os_log_fsyncs; /*!< log_total_flushes() */
1165 ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */
1166 ulint innodb_os_log_pending_fsyncs; /*!< log_pending_flushes() */
1167 ulint innodb_page_size; /*!< UNIV_PAGE_SIZE */
1168 ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */
1169 ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read */
1170 ulint innodb_pages_written; /*!< buf_pool->stat.n_pages_written */
1171 bool innodb_redo_log_enabled; /*!< srv_redo_log */
1172 ulint innodb_row_lock_waits; /*!< srv_n_lock_wait_count */
1173 ulint innodb_row_lock_current_waits; /*!< srv_n_lock_wait_current_count */
1174 int64_t innodb_row_lock_time; /*!< srv_n_lock_wait_time
1175 / 1000 */
1176 ulint innodb_row_lock_time_avg; /*!< srv_n_lock_wait_time
1177 / 1000
1178 / srv_n_lock_wait_count */
1179 ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time
1180 / 1000 */
1181 ulint innodb_rows_read; /*!< srv_n_rows_read */
1182 ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
1183 ulint innodb_rows_updated; /*!< srv_n_rows_updated */
1184 ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
1185 ulint innodb_system_rows_read; /*!< srv_n_system_rows_read */
1186 ulint innodb_system_rows_inserted; /*!< srv_n_system_rows_inserted */
1187 ulint innodb_system_rows_updated; /*!< srv_n_system_rows_updated */
1188 ulint innodb_system_rows_deleted; /*!< srv_n_system_rows_deleted*/
1191 ulint innodb_num_open_files; /*!< fil_n_files_open */
1192 ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
1193 ulint innodb_undo_tablespaces_total; /*!< total number of undo tablespaces
1194 innoDB is tracking. */
1195 ulint innodb_undo_tablespaces_implicit; /*!< number of undo tablespaces
1196 innoDB created implicitly. */
1197 ulint innodb_undo_tablespaces_explicit; /*!< number of undo tablespaces
1198 the dba created explicitly. */
1199 ulint innodb_undo_tablespaces_active; /*!< number of active undo
1200 tablespaces */
1201#ifdef UNIV_DEBUG
1202 ulint innodb_purge_trx_id_age; /*!< rw_max_trx_no - purged trx_no */
1204 - purged view's min trx_no */
1205 ulint innodb_ahi_drop_lookups; /*!< number of adaptive hash
1206 index lookups when freeing
1207 file pages */
1208#endif /* UNIV_DEBUG */
1209};
1210
1211#ifndef UNIV_HOTBACKUP
1212/** Thread slot in the thread table. */
1214 /** Thread type: user, utility etc. */
1216
1217 /** true if this slot is in use. */
1219
1220 /** true if the thread is waiting for the event of this slot. */
1222
1223 /** Time when the thread was suspended. Initialized by
1224 lock_wait_table_reserve_slot() for lock wait. */
1225 std::chrono::steady_clock::time_point suspend_time;
1226
1227 /** Stores the current value of lock_wait_table_reservations, when
1228 lock_wait_table_reserve_slot is called.
1229 This can be used as a version number to avoid ABA problems.
1230 The difference lock_wait_table_reservations - reservation_no tells us how many
1231 other threads got suspended while our thr was sleeping.
1232 This can be used to determine if the wait was unfairly long, and it is time to
1233 boost trx->lock.schedule_weight.
1234 Protected by lock->wait_mutex. */
1236
1237 /** Wait time that if exceeded the thread will be timed out.
1238 Initialized by lock_wait_table_reserve_slot() for lock wait. */
1239 std::chrono::steady_clock::duration wait_timeout;
1240
1241 /** Event used in suspending the thread when it has nothing to do. */
1243
1244 /** Suspended query thread (only used for user threads). */
1246};
1247#endif /* !UNIV_HOTBACKUP */
1248
1249#endif
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:50
Buffer pool checksum functions, also linked from /extra/innochecksum.cc.
Definition: os0thread.h:45
Class to write and replay ddl logs.
Definition: log0ddl.h:407
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
const char * p
Definition: ctype-mb.cc:1236
#define U
Definition: ctype-tis620.cc:74
dberr_t
Definition: db0err.h:38
The low-level file system.
DDL log.
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:62
unsigned long long int ulonglong
Definition: my_inttypes.h:55
long long int longlong
Definition: my_inttypes.h:54
Instrumentation helpers for stages.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1063
const std::string FILE("FILE")
Definition: os0file.h:85
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:93
The interface to the operating system condition variables.
The interface to the operating system file io.
constexpr uint32_t OS_FILE_MAX_PATH
Definition: os0file.h:716
The interface to the operating system process and thread control primitives.
Query graph global types.
required string type
Definition: replication_group_member_actions.proto:33
InnoDB concurrency manager header file.
bool high_level_read_only
Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UN...
Definition: srv0srv.cc:208
PSI_stage_info srv_stage_alter_tablespace_encryption
Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress.
Definition: srv0srv.cc:839
ib_mutex_t srv_monitor_file_mutex
Definition: srv0srv.cc:625
FILE * srv_monitor_file
Temporary file for innodb monitor output.
Definition: srv0srv.cc:628
ulint srv_buf_pool_size
Requested size in bytes.
Definition: srv0srv.cc:420
constexpr uint32_t SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT
Definition: srv0srv.h:632
mysql_pfs_key_t log_archiver_thread_key
ulong srv_buf_pool_dump_pct
Dump this % of each buffer pool during BP dump.
Definition: srv0srv.cc:458
bool srv_downgrade_logs
ulong srv_log_n_files
Value of innodb_log_files_in_group.
Definition: srv0srv.cc:239
bool set_undo_tablespace_encryption(space_id_t space_id, mtr_t *mtr)
Set encryption for UNDO tablespace with given space id.
Definition: srv0srv.cc:2535
@ SRV_FORCE_NO_BACKGROUND
prevent the main thread from running: if a crash would occur in purge, this prevents it
Definition: srv0srv.h:913
@ SRV_FORCE_NO_IBUF_MERGE
prevent also ibuf operations: if they would cause a crash, better not do them
Definition: srv0srv.h:918
@ SRV_FORCE_NO_LOG_REDO
do not do the log roll-forward in connection with recovery
Definition: srv0srv.h:925
@ SRV_FORCE_IGNORE_CORRUPT
let the server run even if it detects a corrupt page
Definition: srv0srv.h:911
@ SRV_FORCE_NO_TRX_UNDO
do not run trx rollback after recovery
Definition: srv0srv.h:916
@ SRV_FORCE_NO_UNDO_LOG_SCAN
do not look at undo logs when starting the database: InnoDB will treat even incomplete transactions a...
Definition: srv0srv.h:921
bool srv_numa_interleave
Definition: srv0srv.cc:218
void set_srv_redo_log(bool enable)
Set redo log variable for performance schema global status.
Definition: srv0srv.cc:3270
bool srv_thread_is_active(const IB_thread &thread)
Check if given thread is still active.
Definition: srv0srv.cc:3256
mysql_pfs_key_t log_flush_notifier_thread_key
srv_thread_type
Types of threads existing in the system.
Definition: srv0srv.h:948
@ SRV_WORKER
threads serving parallelized queries and queries released from lock wait
Definition: srv0srv.h:950
@ SRV_MASTER
the master thread, (whose type number must be biggest)
Definition: srv0srv.h:954
@ SRV_NONE
None.
Definition: srv0srv.h:949
@ SRV_PURGE
Purge coordinator thread.
Definition: srv0srv.h:953
mysql_pfs_key_t srv_lock_timeout_thread_key
ulong srv_n_write_io_threads
Definition: srv0srv.cc:468
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 ...
Definition: srv0srv.cc:1948
ulong srv_log_write_notifier_spin_delay
Number of spin iterations, for which log write notifier thread is waiting for advanced writeed_to_dis...
Definition: srv0srv.cc:353
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 start...
Definition: srv0srv.cc:792
constexpr uint32_t SRV_MAX_IO_CAPACITY_LIMIT
Definition: srv0srv.h:633
mysql_pfs_key_t ddl_thread_key
mysql_pfs_key_t fts_parallel_tokenization_thread_key
PSI_stage_info srv_stage_alter_table_log_table
Performance schema stage event for monitoring ALTER TABLE progress row_log_table_apply().
Definition: srv0srv.cc:824
const ulonglong srv_buf_pool_chunk_unit_min
Minimum buffer pool chunk size.
Definition: srv0srv.cc:431
bool srv_sync_debug
Definition: sync0debug.cc:65
ulong srv_checksum_algorithm
the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t her...
Definition: checksum.cc:56
ulong srv_log_flush_notifier_spin_delay
Number of spin iterations, for which log flush notifier thread is waiting for advanced flushed_to_dis...
Definition: srv0srv.cc:366
ulong srv_fast_shutdown
The value of the configuration parameter innodb_fast_shutdown, controlling the InnoDB shutdown.
Definition: srv0srv.cc:564
ulong srv_log_wait_for_write_spin_delay
Number of spin iterations, when spinning and waiting for log buffer written up to given LSN,...
Definition: srv0srv.cc:297
ib_mutex_t page_zip_stat_per_index_mutex
Mutex protecting page_zip_stat_per_index.
Definition: srv0srv.cc:622
mysql_pfs_key_t log_flusher_thread_key
PSI_stage_info srv_stage_alter_table_flush
Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint().
Definition: srv0srv.cc:809
unsigned long long srv_max_undo_tablespace_size
Maximum size of undo tablespace.
Definition: srv0srv.cc:186
ulong srv_log_write_ahead_size
Size of block, used for writing ahead to avoid read-on-write.
Definition: srv0srv.h:559
bool srv_print_ddl_logs
Print all DDL logs to mysqld stderr.
Definition: srv0srv.cc:544
uint srv_change_buffer_max_size
Maximum on-disk size of change buffer in terms of percentage of the buffer pool.
Definition: srv0srv.cc:479
bool srv_use_fdatasync
Use fdatasync() instead of fsync().
Definition: srv0srv.cc:446
void srv_purge_wakeup(void)
Wakeup the purge threads.
Definition: srv0srv.cc:3218
PSI_stage_info srv_stage_alter_table_end
Performance schema stage event for monitoring ALTER TABLE progress everything after flush log_make_la...
Definition: srv0srv.cc:804
mysql_pfs_key_t io_log_thread_key
ulong srv_sync_array_size
User configured sync array size.
Definition: sync0arr.cc:57
ulong srv_force_recovery_crash
Inject a crash at different steps of the recovery process.
Definition: srv0srv.cc:537
const ulint srv_buf_pool_def_size
Default pool size in bytes.
Definition: srv0srv.cc:424
void undo_spaces_deinit()
Free the resources occupied by undo::spaces and trx_sys_undo_spaces, called once during thread de-ini...
Definition: srv0start.cc:1169
char * srv_log_group_home_dir
Definition: srv0srv.cc:234
bool srv_ibuf_disable_background_merge
Definition: ibuf0ibuf.cc:43
mysql_pfs_key_t io_read_thread_key
std::chrono::seconds get_srv_flush_log_at_timeout()
Definition: srv0srv.cc:392
mysql_pfs_key_t srv_monitor_thread_key
uint srv_log_spin_cpu_pct_hwm
Maximum percentage of cpu time for which spin-delay is used.
Definition: srv0srv.cc:264
bool srv_stats_auto_recalc
Definition: srv0srv.cc:579
constexpr uint32_t MAX_PURGE_THREADS
Maximum number of purge threads, including the purge coordinator.
Definition: srv0srv.h:643
ulong srv_max_io_capacity
Definition: srv0srv.cc:489
ulong srv_log_flusher_spin_delay
Number of spin iterations, for which log flusher thread is waiting for new data to flush,...
Definition: srv0srv.cc:342
bool srv_purge_threads_active()
Check if the purge threads are active, both coordinator and worker threads.
Definition: srv0srv.cc:3235
const ulonglong srv_buf_pool_chunk_unit_blk_sz
The buffer pool chunk size must be a multiple of this number.
Definition: srv0srv.cc:433
void srv_worker_thread()
Worker thread that reads tasks from the work queue and executes them.
Definition: srv0srv.cc:2831
void srv_export_innodb_status(void)
Function to pass InnoDB status variables to MySQL.
Definition: srv0srv.cc:1564
ulong srv_undo_tablespaces
Number of undo tablespaces to use.
Definition: srv0srv.cc:155
ulong srv_spin_wait_delay
Definition: ut0mutex.h:106
std::chrono::milliseconds get_srv_replication_delay()
Definition: srv0srv.cc:582
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 ...
Definition: srv0srv.cc:606
bool srv_file_per_table
store to its own file each table created by an user; data dictionary tables are in the system tablesp...
Definition: srv0srv.cc:200
const char * srv_main_thread_op_info
Definition: srv0srv.cc:129
const ulint srv_buf_pool_min_size
Minimum pool size in bytes.
Definition: srv0srv.cc:422
double srv_max_dirty_pages_pct_lwm
Definition: srv0srv.cc:500
mysql_pfs_key_t srv_ts_alter_encrypt_thread_key
ulong srv_log_buffer_size
Space for log buffer, expressed in bytes.
Definition: srv0srv.cc:252
void srv_inc_activity_count(void)
Increment the server activity counter.
Definition: srv0srv.cc:1894
ulong srv_log_recent_written_size
Number of slots in a small buffer, which is used to allow concurrent writes to log buffer.
Definition: srv0srv.cc:287
constexpr uint32_t SRV_MAX_N_IO_THREADS
Definition: srv0srv.h:737
double srv_max_buf_pool_modified_pct
Definition: srv0srv.cc:499
ulong srv_flush_log_at_trx_commit
Definition: srv0srv.cc:390
FILE * srv_misc_tmpfile
Temporary file for miscellaneous diagnostic output.
Definition: srv0srv.cc:634
void srv_purge_coordinator_thread()
Purge coordinator thread that schedules the purge tasks.
Definition: srv0srv.cc:3078
bool srv_adaptive_flushing
Definition: srv0srv.cc:402
bool srv_enable_redo_encryption()
Enable REDO log encryption.
Definition: srv0srv.cc:2501
bool srv_cmp_per_index_enabled
Enable INFORMATION_SCHEMA.innodb_cmp_per_index.
Definition: srv0srv.cc:547
bool srv_downgrade_partition_files
Definition: srv0srv.cc:115
void srv_set_io_thread_op_info(ulint i, const char *str)
Sets the info describing an i/o thread current state.
Definition: srv0srv.cc:875
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.
Definition: srv0start.cc:1088
enum srv_unix_flush_t srv_unix_file_flush_method
Definition: srv0srv.cc:482
ulint srv_n_file_io_threads
Number of IO threads to use.
Definition: srv0start.cc:137
ulong srv_LRU_scan_depth
Scan depth for LRU flush batch i.e.
Definition: srv0srv.cc:448
void srv_free(void)
Frees the data structures created in srv_init().
Definition: srv0srv.cc:1209
ulong srv_log_write_events
Number of events used for notifications about redo write.
Definition: srv0srv.cc:279
ulint srv_buf_pool_base_size
Current size as scaling factor for the other components.
Definition: srv0srv.cc:454
ulong srv_n_spin_wait_rounds
Definition: ut0mutex.h:107
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_CLEA...
Definition: srv0start.cc:3104
static ulong PCT_IO(ulong p)
Definition: srv0srv.h:638
mysql_pfs_key_t clone_gtid_thread_key
unsigned long long srv_stats_persistent_sample_pages
Definition: srv0srv.cc:578
mysql_pfs_key_t parallel_read_thread_key
mysql_pfs_key_t io_handler_thread_key
bool srv_disable_sort_file_cache
Whether to disable file system cache.
Definition: ddl0ddl.cc:46
const ulonglong srv_buf_pool_chunk_unit_max
Maximum buffer pool chunk size.
Definition: srv0srv.cc:435
mysql_pfs_key_t recv_writer_thread_key
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...
Definition: srv0srv.cc:1912
ulong srv_dblwr_pages
Number of pages per doublewrite thread/segment.
ulong srv_idle_flush_pct
How much flush to be done in case of server is idle.
Definition: srv0srv.cc:463
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 i...
Definition: srv0srv.cc:216
mysql_pfs_key_t srv_error_monitor_thread_key
mysql_pfs_key_t io_write_thread_key
mysql_pfs_key_t dict_stats_thread_key
ulong srv_flush_neighbors
Whether or not to flush neighbors of a block.
Definition: srv0srv.cc:450
bool tbsp_extend_and_initialize
Enable or disable writing of NULLs while extending a tablespace.
Definition: srv0srv.cc:520
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.
Definition: srv0srv.cc:3197
bool srv_buf_pool_debug
This is used to enable multiple buffer pool instances with small buffer pool size.
Definition: buf0buf.cc:332
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.
Definition: srv0srv.cc:1341
bool srv_log_writer_threads
Whether to activate/pause the log writer threads.
Definition: srv0srv.cc:258
char * srv_buf_dump_filename
The buffer pool dump/load file name.
Definition: srv0srv.cc:788
ulong srv_log_writer_spin_delay
Number of spin iterations, for which log writer thread is waiting for new data to write or flush with...
Definition: srv0srv.cc:322
std::atomic< int > srv_fatal_semaphore_wait_extend
Definition: srv0srv.cc:119
void undo_spaces_init()
Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start().
Definition: srv0start.cc:1156
bool srv_redo_log
If innodb redo logging is enabled.
Definition: srv0srv.cc:550
ulint srv_dml_needed_delay
Definition: srv0srv.cc:127
bool srv_priority_boost
Definition: srv0srv.cc:589
mysql_pfs_key_t buf_dump_thread_key
void srv_wake_master_thread(void)
Wakes up the master thread if it is suspended or being suspended.
Definition: srv0srv.cc:1958
ulong srv_max_purge_lag
Maximum allowable purge history length.
Definition: trx0purge.cc:69
struct export_var_t export_vars
Status variables to be passed to MySQL.
Definition: srv0srv.cc:527
uint32_t srv_rseg_init_threads
Number of threads spawned for initializing rollback segments in parallel.
Definition: srv0srv.cc:147
char * srv_undo_dir
Server undo tablespaces directory, can be absolute path.
Definition: srv0srv.cc:151
ulint srv_truncated_status_writes
Definition: srv0srv.cc:603
std::chrono::milliseconds get_srv_log_checkpoint_every()
Period every which a periodical checkpoint is written by the log checkpointer thread (unless periodic...
Definition: srv0srv.cc:336
bool srv_undo_log_encrypt
Enable or disable Encrypt of UNDO tablespace.
Definition: srv0srv.cc:183
const char * srv_io_thread_function[]
Definition: srv0srv.cc:613
std::chrono::microseconds get_srv_log_wait_for_flush_timeout()
Timeout used when waiting for redo flush.
Definition: srv0srv.cc:316
ulint srv_lock_table_size
Lock table size in bytes.
Definition: srv0srv.cc:460
bool srv_validate_tablespace_paths
Whether to validate InnoDB tablespace paths on startup.
Definition: srv0srv.cc:444
bool srv_check_activity(ulint old_activity_count)
Check if there has been any activity.
Definition: srv0srv.cc:1975
std::chrono::microseconds get_srv_log_write_notifier_timeout()
Initial timeout used to wait on write_notifier_event.
Definition: srv0srv.cc:360
ulint srv_get_activity_count(void)
Get current server activity count.
Definition: srv0srv.cc:1969
ulonglong srv_buf_pool_chunk_unit
Requested buffer pool chunk size.
Definition: srv0srv.cc:429
ulong srv_log_wait_for_flush_spin_delay
Number of spin iterations, when spinning and waiting for log flushed.
Definition: srv0srv.cc:309
char * srv_innodb_directories
The innodb_directories variable value.
Definition: srv0srv.cc:143
ulong srv_innodb_stats_method
Definition: srv0srv.cc:518
bool srv_master_thread_disabled_debug
Value of MySQL global used to disable master thread.
Definition: srv0srv.cc:226
ulong srv_debug_compress
Force all user tables to use page compression.
Definition: srv0srv.cc:222
void srv_boot(void)
Boots Innobase server.
Definition: srv0srv.cc:1280
PSI_stage_info srv_stage_clone_file_copy
Performance schema stage event for monitoring clone file copy progress.
Definition: srv0srv.cc:849
const ulong srv_idle_flush_pct_default
Default value of srv_idle_flush_pct.
Definition: srv0srv.cc:462
bool srv_print_innodb_monitor
Definition: srv0srv.cc:605
ulonglong srv_log_file_size
Value of innodb_log_file_size.
Definition: srv0srv.cc:241
ulong srv_buf_pool_instances
Requested number of buffer pool instances.
Definition: srv0srv.cc:438
mysql_pfs_key_t log_write_notifier_thread_key
srv_unix_flush_t
Alternatives for the file flush option in Unix.
Definition: srv0srv.h:861
@ SRV_UNIX_O_DSYNC
open log files in O_SYNC mode
Definition: srv0srv.h:863
@ SRV_UNIX_FSYNC
fsync, the default
Definition: srv0srv.h:862
@ SRV_UNIX_NOSYNC
do not flush after writing
Definition: srv0srv.h:867
@ SRV_UNIX_O_DIRECT_NO_FSYNC
do not use fsync() when using direct IO i.e.
Definition: srv0srv.h:874
@ SRV_UNIX_LITTLESYNC
do not call os_file_flush() when writing data files, but do flush after writing to log files
Definition: srv0srv.h:864
@ SRV_UNIX_O_DIRECT
invoke os_file_set_nocache() on data files.
Definition: srv0srv.h:868
mysql_pfs_key_t log_writer_thread_key
mysql_pfs_key_t buf_resize_thread_key
bool srv_is_direct_io()
Definition: srv0srv.h:884
bool srv_upgrade_old_undo_found
ulong srv_n_page_hash_locks
Number of locks to protect buf_pool->page_hash.
Definition: srv0srv.cc:442
bool srv_checkpoint_disabled
If true then disable checkpointing.
Definition: srv0srv.cc:384
std::chrono::seconds get_srv_fatal_semaphore_wait_threshold()
Definition: srv0srv.cc:121
ulong srv_adaptive_max_sleep_delay
Maximum sleep delay (in micro-seconds), value of 0 disables it.
Definition: srv0conc.cc:62
ulong srv_parallel_read_threads
Number of threads to use for parallel reads.
Definition: srv0srv.cc:211
unsigned long long srv_online_max_size
Maximum modification log file size for online index creation.
Definition: srv0srv.cc:205
ulong srv_flushing_avg_loops
Definition: srv0srv.cc:507
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,...
Definition: srv0srv.cc:292
bool srv_inject_too_many_concurrent_trxs
Definition: srv0srv.cc:386
ulint srv_buf_pool_old_size
Previously requested size.
Definition: srv0srv.cc:452
char * srv_data_home
Definition: srv0srv.cc:136
bool srv_load_corrupted
Definition: dict0load.cc:138
ulong srv_n_page_cleaners
Definition: srv0srv.cc:492
bool srv_random_read_ahead
Definition: srv0srv.cc:471
bool srv_buffer_pool_load_at_startup
Definition: srv0srv.cc:793
ulong srv_n_read_io_threads
Definition: srv0srv.cc:467
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 t...
Definition: srv0conc.cc:59
PSI_stage_info srv_stage_buffer_pool_load
Performance schema stage event for monitoring buffer pool load progress.
Definition: srv0srv.cc:844
double srv_max_dirty_pages_pct
mysql_pfs_key_t srv_purge_thread_key
std::chrono::microseconds get_srv_log_flush_notifier_timeout()
Initial timeout used to wait on flush_notifier_event.
Definition: srv0srv.cc:373
void srv_master_thread_disabled_debug_update(THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
Disables master thread.
Definition: srv0srv.cc:2053
ulong srv_purge_batch_size
Definition: srv0srv.cc:513
os_event_t srv_monitor_event
Event to signal the monitor thread.
Definition: srv0srv.cc:776
ulonglong srv_redo_log_capacity
Value of innodb_redo_log_capacity.
Definition: srv0srv.cc:243
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().
Definition: srv0srv.cc:833
mysql_pfs_key_t srv_master_thread_key
ulonglong srv_redo_log_capacity_used
Assumed value of innodb_redo_log_capacity's - value which is used.
Definition: srv0srv.cc:243
ulong srv_purge_rseg_truncate_frequency
Rate at which UNDO records should be purged.
Definition: srv0srv.cc:171
os_event_t srv_error_event
Event to signal the error thread.
Definition: srv0srv.cc:779
PSI_stage_info srv_stage_alter_table_insert
Performance schema stage event for monitoring ALTER TABLE progress row_merge_insert_index_tuples().
Definition: srv0srv.cc:813
mysql_pfs_key_t io_ibuf_thread_key
srv_stats_method_name_enum
Definition: srv0srv.h:931
@ SRV_STATS_NULLS_UNEQUAL
Definition: srv0srv.h:935
@ SRV_STATS_NULLS_IGNORED
Definition: srv0srv.h:937
@ SRV_STATS_NULLS_EQUAL
Definition: srv0srv.h:932
PSI_stage_info srv_stage_alter_table_merge_sort
Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().
Definition: srv0srv.cc:829
PSI_stage_info srv_stage_clone_page_copy
Performance schema stage event for monitoring clone page copy progress.
Definition: srv0srv.cc:857
uint srv_log_spin_cpu_abs_lwm
Minimum absolute value of cpu time for which spin-delay is used.
Definition: srv0srv.cc:261
os_event_t srv_buf_dump_event
The buffer pool dump/load thread waits on this event.
Definition: srv0srv.cc:782
bool srv_stats_persistent
Definition: srv0srv.cc:576
ulong srv_read_ahead_threshold
Definition: srv0srv.cc:475
void innobase_set_open_files_limit(long new_limit)
Sets new value of the "innodb_open_files" configuration variable to present to users.
Definition: ha_innodb.cc:5078
mysql_pfs_key_t log_checkpointer_thread_key
mysql_pfs_key_t page_flush_thread_key
bool srv_read_only_mode
Set if InnoDB must operate in read-only mode.
Definition: srv0srv.cc:196
ulong srv_log_wait_for_flush_spin_hwm
Maximum value of average log flush time for which spin-delay is used.
Definition: srv0srv.cc:269
bool srv_purge_view_update_only_debug
Definition: trx0purge.cc:85
mysql_pfs_key_t log_files_governor_thread_key
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...
Definition: srv0srv.cc:276
void srv_monitor_thread()
A thread which prints the info output by various InnoDB monitors.
Definition: srv0srv.cc:1763
bool srv_log_checksums
Whether to generate and require checksums on the redo log pages.
Definition: srv0srv.cc:380
bool srv_innodb_status
Definition: srv0srv.cc:567
enum srv_stats_method_name_enum srv_stats_method_name_t
Definition: srv0srv.h:940
const longlong srv_buf_pool_max_size
Maximum pool size in bytes.
Definition: srv0srv.cc:426
Srv_cpu_usage srv_cpu_usage
Structure with cpu usage information.
Definition: srv0srv.cc:104
mysql_pfs_key_t page_archiver_thread_key
bool srv_undo_log_truncate
Enable or Disable Truncate of UNDO tablespace.
Definition: srv0srv.cc:180
mysql_pfs_key_t clone_ddl_thread_key
mysql_pfs_key_t parallel_rseg_init_thread_key
bool srv_print_innodb_lock_monitor
Definition: srv0srv.cc:607
ib_mutex_t srv_misc_tmpfile_mutex
Mutex for locking srv_misc_tmpfile.
Definition: srv0srv.cc:632
ulong srv_force_recovery
Normally 0.
Definition: srv0srv.cc:533
bool srv_stats_include_delete_marked
Definition: srv0srv.cc:577
ulong srv_adaptive_flushing_lwm
Definition: srv0srv.cc:504
ulong srv_n_purge_threads
Definition: srv0srv.cc:510
std::chrono::microseconds get_srv_log_writer_timeout()
Initial timeout used to wait on writer_event.
Definition: srv0srv.cc:327
const char * srv_io_thread_op_info[]
Definition: srv0srv.cc:612
bool srv_dedicated_server
Dedicated server setting.
Definition: srv0srv.cc:418
Log_DDL * log_ddl
Object to handle Log_DDL.
Definition: log0ddl.cc:61
std::chrono::microseconds get_srv_log_wait_for_write_timeout()
Timeout used when waiting for redo write.
Definition: srv0srv.cc:304
bool srv_flush_sync
Definition: srv0srv.cc:405
PSI_stage_info srv_stage_clone_redo_copy
Performance schema stage event for monitoring clone redo copy progress.
Definition: srv0srv.cc:853
long long srv_buf_pool_curr_size
Current size in bytes.
Definition: srv0srv.cc:456
ulong srv_log_flush_events
Number of events used for notifications about redo flush.
Definition: srv0srv.cc:282
void srv_reset_io_thread_op_info()
Resets the info describing an i/o thread current state.
Definition: srv0srv.cc:882
unsigned long long srv_stats_transient_sample_pages
Definition: srv0srv.cc:575
srv_stats_t srv_stats
Global counters.
Definition: srv0srv.cc:523
ulong srv_io_capacity
Definition: srv0srv.cc:488
bool srv_is_upgrade_mode
mysql_pfs_key_t trx_recovery_rollback_thread_key
bool srv_master_thread_is_active()
Check whether the master thread is active.
Definition: srv0srv.cc:1903
void srv_error_monitor_thread()
A thread which prints warnings about semaphore waits which have lasted too long.
Definition: srv0srv.cc:1823
mysql_pfs_key_t srv_worker_thread_key
void srv_master_thread()
The master thread controlling the server.
Definition: srv0srv.cc:2732
const size_t CONCURRENT_UNDO_TRUNCATE_LIMIT
Maximum number of recently truncated undo tablespace IDs for the same undo number.
Definition: srv0srv.cc:190
ulong srv_sort_buf_size
Sort buffer size in index creation.
Definition: srv0srv.cc:203
Srv_threads srv_threads
Structure with state of srv background threads.
Definition: srv0srv.cc:101
PSI_stage_info srv_stage_alter_table_log_index
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().
Definition: srv0srv.cc:818
const ulong srv_buf_pool_instances_default
Default number of buffer pool instances.
Definition: srv0srv.cc:440
ulong srv_thread_sleep_delay
Sleep delay for threads waiting to enter InnoDB.
Definition: srv0conc.cc:64
mysql_pfs_key_t page_flush_coordinator_thread_key
std::chrono::microseconds get_srv_log_flusher_timeout()
Initial timeout used to wait on flusher_event.
Definition: srv0srv.cc:347
ulint srv_release_threads(enum srv_thread_type type, ulint n)
Releases threads of the type given from suspension in the thread table.
Definition: srv0srv.cc:1024
bool srv_print_all_deadlocks
Print all user-level transactions deadlocks to mysqld stderr.
Definition: srv0srv.cc:541
ulint srv_get_task_queue_length(void)
Get count of tasks in the queue.
Definition: srv0srv.cc:3211
ulong srv_max_purge_lag_delay
Max DML user threads delay in micro-seconds.
Definition: trx0purge.cc:72
bool srv_thread_is_stopped(const IB_thread &thread)
Check if given thread is cleaned-up and stopped.
Definition: srv0srv.cc:3260
mysql_pfs_key_t fts_parallel_merge_thread_key
ulong srv_rollback_segments
The number of rollback segments per tablespace.
Definition: srv0srv.cc:159
constexpr size_t SRV_N_LOG_FILES_CLONE_MAX
Definition: srv0srv.h:432
bool srv_enable_undo_encryption()
Enable UNDO tablespaces encryption.
Definition: srv0srv.cc:2579
os_event_t srv_buf_resize_event
The buffer pool resize thread waits on this event.
Definition: srv0srv.cc:785
mysql_pfs_key_t fts_optimize_thread_key
bool srv_redo_log_encrypt
Enable or Disable Encrypt of REDO tablespace.
Definition: srv0srv.cc:237
static void srv_active_wake_master_thread()
Definition: srv0srv.h:982
long innobase_get_open_files_limit()
Returns current value of the "innodb_open_files" configuration variable.
Definition: ha_innodb.cc:5077
Stage instrument information.
Definition: psi_stage_bits.h:73
Definition: plugin.h:65
Definition: srv0srv.h:280
double stime_abs
Definition: srv0srv.h:283
double utime_abs
Definition: srv0srv.h:282
double stime_pct
Definition: srv0srv.h:285
int n_cpu
Definition: srv0srv.h:281
double utime_pct
Definition: srv0srv.h:284
Structure which keeps shared future objects for InnoDB background threads.
Definition: srv0srv.h:163
IB_thread m_recv_writer
Thread writing recovered pages during recovery.
Definition: srv0srv.h:213
IB_thread m_gtid_persister
Thread for GTID persistence.
Definition: srv0srv.h:245
IB_thread * m_purge_workers
Purge workers.
Definition: srv0srv.h:223
IB_thread m_error_monitor
Error monitor thread.
Definition: srv0srv.h:168
IB_thread m_ts_alter_encrypt
The ts_alter_encrypt thread.
Definition: srv0srv.h:207
os_event_t m_shutdown_cleanup_dbg
Used in test scenario to delay threads' cleanup until the pre_dd_shutdown is ended and final plugin's...
Definition: srv0srv.h:252
size_t m_purge_workers_n
Number of purge workers and size of array below.
Definition: srv0srv.h:219
IB_thread m_purge_coordinator
Purge coordinator (also being a worker)
Definition: srv0srv.h:216
IB_thread m_log_flush_notifier
Redo flush notifier thread.
Definition: srv0srv.h:186
IB_thread * m_page_cleaner_workers
Page cleaner workers.
Definition: srv0srv.h:233
IB_thread m_buf_resize
Buffer pool resize thread.
Definition: srv0srv.h:195
IB_thread m_lock_wait_timeout
Thread detecting lock wait timeouts.
Definition: srv0srv.h:201
IB_thread m_backup_log_archiver
Redo log archiver (used by backup).
Definition: srv0srv.h:189
IB_thread m_log_flusher
Redo flusher thread.
Definition: srv0srv.h:180
IB_thread m_fts_optimize
Thread doing optimization for FTS index.
Definition: srv0srv.h:242
IB_thread m_log_files_governor
Redo files governor thread.
Definition: srv0srv.h:171
IB_thread m_log_archiver
Archiver's log archiver (used by Clone).
Definition: srv0srv.h:236
IB_thread m_page_cleaner_coordinator
Page cleaner coordinator (also being a worker).
Definition: srv0srv.h:226
IB_thread m_page_archiver
Archiver's page archiver (used by Clone).
Definition: srv0srv.h:239
IB_thread m_trx_recovery_rollback
Thread doing rollbacks during recovery.
Definition: srv0srv.h:210
IB_thread m_log_write_notifier
Redo write notifier thread.
Definition: srv0srv.h:183
IB_thread m_buf_dump
Buffer pool dump thread.
Definition: srv0srv.h:192
IB_thread m_monitor
Monitor thread (prints info).
Definition: srv0srv.h:165
os_event_t m_master_ready_for_dd_shutdown
When the master thread notices that shutdown has started (by noticing srv_shutdown_state >= SRV_SHUTD...
Definition: srv0srv.h:264
IB_thread m_log_writer
Redo writer thread.
Definition: srv0srv.h:177
IB_thread m_dict_stats
Dict stats background thread.
Definition: srv0srv.h:198
size_t m_page_cleaner_workers_n
Number of page cleaner workers and size of array below.
Definition: srv0srv.h:229
IB_thread m_log_checkpointer
Redo checkpointer thread.
Definition: srv0srv.h:174
IB_thread m_master
The master thread.
Definition: srv0srv.h:204
Status variables to be passed to MySQL.
Definition: srv0srv.h:1111
ulonglong innodb_redo_log_uuid
Redo log UUID.
Definition: srv0srv.h:1151
ulint innodb_buffer_pool_pages_flushed
srv_buf_pool_flushed
Definition: srv0srv.h:1142
ulonglong innodb_redo_log_logical_size
Redo log logical size.
Definition: srv0srv.h:1156
ulint innodb_buffer_pool_pages_latched
Latched pages.
Definition: srv0srv.h:1137
ulint innodb_system_rows_updated
srv_n_system_rows_updated
Definition: srv0srv.h:1187
ulint innodb_sampled_pages_read
Definition: srv0srv.h:1189
ulint innodb_buffer_pool_write_requests
srv_buf_pool_write_requests
Definition: srv0srv.h:1143
ulint innodb_data_written
Data bytes written.
Definition: srv0srv.h:1118
ulint innodb_pages_created
buf_pool->stat.n_pages_created
Definition: srv0srv.h:1168
ulint innodb_buffer_pool_read_ahead
srv_read_ahead
Definition: srv0srv.h:1145
ulint innodb_system_rows_read
srv_n_system_rows_read
Definition: srv0srv.h:1185
bool innodb_redo_log_read_only
Is redo log read-only ?
Definition: srv0srv.h:1150
char innodb_buffer_pool_resize_status[512]
Buf pool resize status.
Definition: srv0srv.h:1124
ulint innodb_num_open_files
fil_n_files_open
Definition: srv0srv.h:1191
int64_t innodb_row_lock_time
srv_n_lock_wait_time / 1000
Definition: srv0srv.h:1174
ulint innodb_data_read
Data bytes read.
Definition: srv0srv.h:1116
ulint innodb_data_pending_reads
Pending reads.
Definition: srv0srv.h:1112
ulint innodb_data_fsyncs
Number of fsyncs so far.
Definition: srv0srv.h:1115
ulint innodb_purge_view_trx_id_age
rw_max_trx_no
Definition: srv0srv.h:1203
ulint innodb_buffer_pool_bytes_dirty
File bytes modified.
Definition: srv0srv.h:1133
ulint innodb_buffer_pool_pages_free
Free pages.
Definition: srv0srv.h:1135
char innodb_redo_log_resize_status[512]
Redo log resize status.
Definition: srv0srv.h:1149
ulint innodb_dblwr_pages_written
srv_dblwr_pages_written
Definition: srv0srv.h:1147
ulint innodb_ahi_drop_lookups
number of adaptive hash index lookups when freeing file pages
Definition: srv0srv.h:1205
ulint innodb_buffer_pool_read_ahead_evicted
srv_read_ahead evicted
Definition: srv0srv.h:1146
ulint innodb_dblwr_writes
srv_dblwr_writes
Definition: srv0srv.h:1148
ulint innodb_buffer_pool_read_ahead_rnd
srv_read_ahead_rnd
Definition: srv0srv.h:1144
ulint innodb_data_pending_fsyncs
Pending fsyncs.
Definition: srv0srv.h:1114
ulint innodb_rows_deleted
srv_n_rows_deleted
Definition: srv0srv.h:1184
ulint innodb_data_reads
I/O read requests.
Definition: srv0srv.h:1119
ulint innodb_row_lock_time_avg
srv_n_lock_wait_time / 1000 / srv_n_lock_wait_count
Definition: srv0srv.h:1176
ulint innodb_page_size
UNIV_PAGE_SIZE.
Definition: srv0srv.h:1167
char innodb_buffer_pool_load_status[OS_FILE_MAX_PATH+128]
Buf pool load status.
Definition: srv0srv.h:1123
bool innodb_redo_log_enabled
srv_redo_log
Definition: srv0srv.h:1171
ulint innodb_undo_tablespaces_implicit
number of undo tablespaces innoDB created implicitly.
Definition: srv0srv.h:1195
ulint innodb_rows_inserted
srv_n_rows_inserted
Definition: srv0srv.h:1182
ulint innodb_buffer_pool_reads
srv_buf_pool_reads
Definition: srv0srv.h:1140
ulint innodb_undo_tablespaces_active
number of active undo tablespaces
Definition: srv0srv.h:1199
ulint innodb_data_writes
I/O write requests.
Definition: srv0srv.h:1117
ulint innodb_purge_trx_id_age
rw_max_trx_no - purged trx_no
Definition: srv0srv.h:1202
ulint innodb_buffer_pool_pages_dirty
Dirty data pages.
Definition: srv0srv.h:1132
ulint innodb_log_writes
srv_log_writes
Definition: srv0srv.h:1162
lsn_t innodb_os_log_written
srv_os_log_written
Definition: srv0srv.h:1163
ulonglong innodb_redo_log_capacity_resized
Redo log capacity after the last finished redo resize.
Definition: srv0srv.h:1158
ulonglong innodb_redo_log_current_lsn
Redo log current LSN.
Definition: srv0srv.h:1153
ulint innodb_rows_updated
srv_n_rows_updated
Definition: srv0srv.h:1183
ulint innodb_os_log_fsyncs
log_total_flushes()
Definition: srv0srv.h:1164
uint32_t innodb_buffer_pool_resize_status_progress
Buf pool resize status progess.
Definition: srv0srv.h:1127
ulint innodb_os_log_pending_writes
srv_os_log_pending_writes
Definition: srv0srv.h:1165
ulint innodb_buffer_pool_pages_total
Buffer pool size.
Definition: srv0srv.h:1129
ulint innodb_undo_tablespaces_total
total number of undo tablespaces innoDB is tracking.
Definition: srv0srv.h:1193
ulint innodb_buffer_pool_pages_misc
Miscellaneous pages.
Definition: srv0srv.h:1134
ulint innodb_row_lock_waits
srv_n_lock_wait_count
Definition: srv0srv.h:1172
ulint innodb_buffer_pool_pages_data
Data pages.
Definition: srv0srv.h:1130
ulint innodb_data_pending_writes
Pending writes.
Definition: srv0srv.h:1113
ulint innodb_buffer_pool_wait_free
srv_buf_pool_wait_free
Definition: srv0srv.h:1141
ulonglong innodb_redo_log_checkpoint_lsn
Redo log checkpoint LSN.
Definition: srv0srv.h:1152
ulint innodb_buffer_pool_bytes_data
File bytes used.
Definition: srv0srv.h:1131
uint32_t innodb_buffer_pool_resize_status_code
Buf pool resize status code.
Definition: srv0srv.h:1126
ulint innodb_buffer_pool_read_requests
buf_pool->stat.n_page_gets
Definition: srv0srv.h:1139
ulint innodb_log_write_requests
srv_log_write_requests
Definition: srv0srv.h:1161
ulonglong innodb_redo_log_physical_size
Redo log physical size.
Definition: srv0srv.h:1157
ulonglong innodb_redo_log_flushed_to_disk_lsn
Redo log flushed to disk LSN.
Definition: srv0srv.h:1155
ulint innodb_os_log_pending_fsyncs
log_pending_flushes()
Definition: srv0srv.h:1166
ulint innodb_pages_written
buf_pool->stat.n_pages_written
Definition: srv0srv.h:1170
ulint innodb_row_lock_current_waits
srv_n_lock_wait_current_count
Definition: srv0srv.h:1173
ulint innodb_undo_tablespaces_explicit
number of undo tablespaces the dba created explicitly.
Definition: srv0srv.h:1197
ulint innodb_pages_read
buf_pool->stat.n_pages_read
Definition: srv0srv.h:1169
ulint innodb_log_waits
srv_log_waits
Definition: srv0srv.h:1160
char innodb_buffer_pool_dump_status[OS_FILE_MAX_PATH+128]
Buf pool dump status.
Definition: srv0srv.h:1121
ulint innodb_sampled_pages_skipped
Definition: srv0srv.h:1190
ulint innodb_system_rows_inserted
srv_n_system_rows_inserted
Definition: srv0srv.h:1186
ulint innodb_truncated_status_writes
srv_truncated_status_writes
Definition: srv0srv.h:1192
ulint innodb_row_lock_time_max
srv_n_lock_max_wait_time / 1000
Definition: srv0srv.h:1179
ulint innodb_rows_read
srv_n_rows_read
Definition: srv0srv.h:1181
ulint innodb_system_rows_deleted
srv_n_system_rows_deleted
Definition: srv0srv.h:1188
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:181
Define for performance schema registration key.
Definition: sync0sync.h:50
InnoDB condition variable.
Definition: os0event.cc:62
Definition: que0que.h:241
Thread slot in the thread table.
Definition: srv0srv.h:1213
bool in_use
true if this slot is in use.
Definition: srv0srv.h:1218
bool suspended
true if the thread is waiting for the event of this slot.
Definition: srv0srv.h:1221
std::chrono::steady_clock::duration wait_timeout
Wait time that if exceeded the thread will be timed out.
Definition: srv0srv.h:1239
que_thr_t * thr
Suspended query thread (only used for user threads).
Definition: srv0srv.h:1245
std::chrono::steady_clock::time_point suspend_time
Time when the thread was suspended.
Definition: srv0srv.h:1225
uint64_t reservation_no
Stores the current value of lock_wait_table_reservations, when lock_wait_table_reserve_slot is called...
Definition: srv0srv.h:1235
os_event_t event
Event used in suspending the thread when it has nothing to do.
Definition: srv0srv.h:1242
srv_thread_type type
Thread type: user, utility etc.
Definition: srv0srv.h:1215
Definition: srv0srv.h:69
ulint_ctr_64_t n_rows_inserted
Number of rows inserted.
Definition: srv0srv.h:140
ulint_ctr_64_t n_system_rows_inserted
Number of system rows inserted.
Definition: srv0srv.h:152
ulint_ctr_1_t buf_pool_reads
Number of buffer pool reads that led to the reading of a disk page.
Definition: srv0srv.h:116
ulint_ctr_1_t data_read
Number of data read in total (in bytes)
Definition: srv0srv.h:119
ulint_ctr_1_t log_write_requests
Number of the log write requests done.
Definition: srv0srv.h:80
ulint_ctr_1_t data_written
Count the amount of data written in total (in bytes)
Definition: srv0srv.h:77
ib_counter_t< lint, 1, single_indexer_t > lint_ctr_1_t
Definition: srv0srv.h:73
ulint_ctr_64_t n_rows_deleted
Number of rows deleted.
Definition: srv0srv.h:137
ulint_ctr_1_t dblwr_writes
Count the number of times the doublewrite buffer was flushed.
Definition: srv0srv.h:96
lint_ctr_1_t n_lock_wait_current_count
Number of threads currently waiting on database locks.
Definition: srv0srv.h:128
ulint_ctr_64_t n_system_rows_read
Number of system rows read.
Definition: srv0srv.h:143
ulint_ctr_64_t n_sampled_pages_read
Number of sampled pages read.
Definition: srv0srv.h:155
ulint_ctr_1_t buf_pool_write_requests
Store the number of write requests issued.
Definition: srv0srv.h:103
ulint_ctr_1_t buf_pool_flushed
Count the number of pages that were written from buffer pool to the disk.
Definition: srv0srv.h:112
ulint_ctr_64_t n_rows_read
Number of rows read.
Definition: srv0srv.h:131
ulint_ctr_64_t n_system_rows_deleted
Number of system rows deleted.
Definition: srv0srv.h:149
lint_ctr_1_t os_log_pending_writes
Number of writes being done to the log files.
Definition: srv0srv.h:89
ulint_ctr_1_t buf_pool_wait_free
Store the number of times when we had to wait for a free page in the buffer pool.
Definition: srv0srv.h:108
int64_ctr_1_t n_lock_wait_time
Wait time of database locks.
Definition: srv0srv.h:122
lsn_ctr_1_t os_log_written
Amount of data written to the log files in bytes.
Definition: srv0srv.h:86
ib_counter_t< int64_t, 1, single_indexer_t > int64_ctr_1_t
Definition: srv0srv.h:74
ulint_ctr_64_t n_rows_updated
Number of rows updated.
Definition: srv0srv.h:134
ulint_ctr_64_t n_sampled_pages_skipped
Number of sampled pages skipped.
Definition: srv0srv.h:158
ib_counter_t< ulint, 64 > ulint_ctr_64_t
Definition: srv0srv.h:70
ulint_ctr_1_t n_lock_wait_count
Number of database lock waits.
Definition: srv0srv.h:125
ulint_ctr_1_t dblwr_pages_written
Store the number of pages that have been flushed to the doublewrite buffer.
Definition: srv0srv.h:100
ib_counter_t< ulint, 1, single_indexer_t > ulint_ctr_1_t
Definition: srv0srv.h:72
ulint_ctr_64_t n_system_rows_updated
Number of system rows updated.
Definition: srv0srv.h:146
ib_counter_t< lsn_t, 1, single_indexer_t > lsn_ctr_1_t
Definition: srv0srv.h:71
ulint_ctr_1_t log_waits
We increase this counter, when we don't have enough space in the log buffer and have to flush it.
Definition: srv0srv.h:93
ulint_ctr_1_t log_writes
Number of physical writes to the log performed.
Definition: srv0srv.h:83
double seconds()
Definition: task.cc:309
Transaction system global type definitions.
unsigned int uint
Definition: uca-dump.cc:29
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:407
Counter utility class.
int n
Definition: xcom_base.cc:505