MySQL  8.0.19
Source Code Documentation
srv0srv.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
4 Copyright (c) 2008, 2009, Google Inc.
5 Copyright (c) 2009, Percona Inc.
6 
7 Portions of this file contain modifications contributed and copyrighted by
8 Google, Inc. Those modifications are gratefully acknowledged and are described
9 briefly in the InnoDB documentation. The contributions by Google are
10 incorporated with their permission, and subject to the conditions contained in
11 the file COPYING.Google.
12 
13 Portions of this file contain modifications contributed and copyrighted
14 by Percona Inc.. Those modifications are
15 gratefully acknowledged and are described briefly in the InnoDB
16 documentation. The contributions by Percona Inc. are incorporated with
17 their permission, and subject to the conditions contained in the file
18 COPYING.Percona.
19 
20 This program is free software; you can redistribute it and/or modify it under
21 the terms of the GNU General Public License, version 2.0, as published by the
22 Free Software Foundation.
23 
24 This program is also distributed with certain software (including but not
25 limited to OpenSSL) that is licensed under separate terms, as designated in a
26 particular file or component or in included license documentation. The authors
27 of MySQL hereby grant you an additional permission to link the program and
28 your derivative works with the separately licensed software that they have
29 included with MySQL.
30 
31 This program is distributed in the hope that it will be useful, but WITHOUT
32 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
33 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
34 for more details.
35 
36 You should have received a copy of the GNU General Public License along with
37 this program; if not, write to the Free Software Foundation, Inc.,
38 51 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"
53 #include "log0types.h"
54 #include "mysql/psi/mysql_stage.h"
55 #include "univ.i"
56 
57 #ifndef UNIV_HOTBACKUP
58 #include "log0ddl.h"
59 #include "os0event.h"
60 #include "os0file.h"
61 #include "os0thread.h"
62 #include "que0types.h"
63 #include "srv0conc.h"
64 #include "trx0types.h"
65 #include "ut0counter.h"
66 
67 #include <future>
68 
69 /* Global counters used inside InnoDB. */
70 struct srv_stats_t {
76 
77  /** Count the amount of data written in total (in bytes) */
79 
80  /** Number of the log write requests done */
82 
83  /** Number of physical writes to the log performed */
85 
86  /** Amount of data written to the log files in bytes */
88 
89  /** Number of writes being done to the log files */
91 
92  /** We increase this counter, when we don't have enough
93  space in the log buffer and have to flush it */
95 
96  /** Count the number of times the doublewrite buffer was flushed */
98 
99  /** Store the number of pages that have been flushed to the
100  doublewrite buffer */
102 
103  /** Store the number of write requests issued */
105 
106  /** Store the number of times when we had to wait for a free page
107  in the buffer pool. It happens when the buffer pool is full and we
108  need to make a flush, in order to be able to read or create a page. */
110 
111  /** Count the number of pages that were written from buffer
112  pool to the disk */
114 
115  /** Number of buffer pool reads that led to the reading of
116  a disk page */
118 
119  /** Number of data read in total (in bytes) */
121 
122  /** Wait time of database locks */
124 
125  /** Number of database lock waits */
127 
128  /** Number of threads currently waiting on database locks */
130 
131  /** Number of rows read. */
133 
134  /** Number of rows updated */
136 
137  /** Number of rows deleted */
139 
140  /** Number of rows inserted */
142 
143  /** Number of system rows read. */
145 
146  /** Number of system rows updated */
148 
149  /** Number of system rows deleted */
151 
152  /** Number of system rows inserted */
154 
155  /** Number of sampled pages read */
157 
158  /** Number of sampled pages skipped */
160 };
161 
162 /** Structure which keeps shared future objects for InnoDB background
163 threads. One should use these objects to check if threads exited. */
164 struct Srv_threads {
165  /** Monitor thread (prints info). */
167 
168  /** Error monitor thread. */
170 
171  /** Redo closer thread. */
173 
174  /** Redo checkpointer thread. */
176 
177  /** Redo writer thread. */
179 
180  /** Redo flusher thread. */
182 
183  /** Redo write notifier thread. */
185 
186  /** Redo flush notifier thread. */
188 
189  /** Redo log archiver (used by backup). */
191 
192  /** Buffer pool dump thread. */
194 
195  /** Buffer pool resize thread. */
197 
198  /** Dict stats background thread. */
200 
201  /** Thread detecting lock wait timeouts. */
203 
204  /** The master thread. */
206 
207  /** The ts_alter_encrypt thread. */
209 
210  /** Thread doing rollbacks during recovery. */
212 
213  /** Thread writing recovered pages during recovery. */
215 
216  /** Purge coordinator (also being a worker) */
218 
219  /** Number of purge workers and size of array below. */
221 
222  /** Purge workers. Note that the m_purge_workers[0] is the same shared
223  state as m_purge_coordinator. */
225 
226  /** Page cleaner coordinator (also being a worker). */
228 
229  /** Number of page cleaner workers and size of array below. */
231 
232  /** Page cleaner workers. Note that m_page_cleaner_workers[0] is the
233  same shared state as m_page_cleaner_coordinator. */
235 
236  /** Archiver's log archiver (used by Clone). */
238 
239  /** Archiver's page archiver (used by Clone). */
241 
242  /** Thread doing optimization for FTS index. */
244 
245  /** Thread for GTID persistence */
247 
248 #ifdef UNIV_DEBUG
249  /** Used in test scenario to delay threads' cleanup until the pre_dd_shutdown
250  is ended and final plugin's shutdown is started (when plugin is DELETED).
251  Note that you may only delay the shutdown for threads for which there is no
252  waiting procedure used in the pre_dd_shutdown. */
254 #endif /* UNIV_DEBUG */
255 };
256 
257 /** Check if given thread is still active. */
258 bool srv_thread_is_active(const IB_thread &thread);
259 
260 /** Delay the thread after it discovered that the shutdown_state
261 is greater or equal to SRV_SHUTDOWN_CLEANUP, before it proceeds
262 with further clean up. This is used in the tests to see if such
263 a possible delay does not have impact on the clean shutdown.
264 @param[in] wait_for_signal wait until shutdown phase starts */
265 void srv_thread_delay_cleanup_if_needed(bool wait_for_signal);
266 
268  int n_cpu;
269  double utime_abs;
270  double stime_abs;
271  double utime_pct;
272  double stime_pct;
273 };
274 
275 /** Structure with state of srv background threads. */
276 extern Srv_threads srv_threads;
277 
278 /** Structure with cpu usage information. */
280 
281 extern Log_DDL *log_ddl;
282 
283 #ifdef INNODB_DD_TABLE
284 extern bool srv_is_upgrade_mode;
285 extern bool srv_downgrade_logs;
286 extern bool srv_upgrade_old_undo_found;
287 #endif /* INNODB_DD_TABLE */
288 
290 
291 extern const char *srv_main_thread_op_info;
292 
293 /* The monitor thread waits on this event. */
295 
296 /* The error monitor thread waits on this event. */
298 
299 /** The buffer pool dump/load thread waits on this event. */
301 
302 /** The buffer pool resize thread waits on this event. */
304 #endif /* !UNIV_HOTBACKUP */
305 
306 /** The buffer pool dump/load file name */
307 #define SRV_BUF_DUMP_FILENAME_DEFAULT "ib_buffer_pool"
308 extern char *srv_buf_dump_filename;
309 
310 /** Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown
311 and/or load it during startup. */
314 
315 /* Whether to disable file system cache if it is defined */
316 extern bool srv_disable_sort_file_cache;
317 
318 /* If the last data file is auto-extended, we add this many pages to it
319 at a time */
320 #define SRV_AUTO_EXTEND_INCREMENT (srv_sys_space.get_autoextend_increment())
321 
322 #ifndef UNIV_HOTBACKUP
323 /** Mutex protecting page_zip_stat_per_index */
324 extern ib_mutex_t page_zip_stat_per_index_mutex;
325 /* Mutex for locking srv_monitor_file. Not created if srv_read_only_mode */
326 extern ib_mutex_t srv_monitor_file_mutex;
327 /* Temporary file for innodb monitor output */
328 extern FILE *srv_monitor_file;
329 /* Mutex for locking srv_misc_tmpfile. Only created if !srv_read_only_mode.
330 This mutex has a very low rank; threads reserving it should not
331 acquire any further latches or sleep before releasing this one. */
332 extern ib_mutex_t srv_misc_tmpfile_mutex;
333 /* Temporary file for miscellanous diagnostic output */
334 extern FILE *srv_misc_tmpfile;
335 #endif /* !UNIV_HOTBACKUP */
336 
337 /* Server parameters which are read from the initfile */
338 
339 extern char *srv_data_home;
340 
341 /** Set if InnoDB must operate in read-only mode. We don't do any
342 recovery and open all tables in RO mode instead of RW mode. We don't
343 sync the max trx id to disk either. */
344 extern bool srv_read_only_mode;
345 /** Set if InnoDB operates in read-only mode or innodb-force-recovery
346 is greater than SRV_FORCE_NO_TRX_UNDO. */
347 extern bool high_level_read_only;
348 /** store to its own file each table created by an user; data
349 dictionary tables are in the system tablespace 0 */
350 extern bool srv_file_per_table;
351 /** Sleep delay for threads waiting to enter InnoDB. In micro-seconds. */
353 /** Maximum sleep delay (in micro-seconds), value of 0 disables it.*/
355 
356 /** Sort buffer size in index creation */
357 extern ulong srv_sort_buf_size;
358 
359 /** Maximum modification log file size for online index creation */
360 extern unsigned long long srv_online_max_size;
361 
362 /** Number of threads to use for parallel reads. */
364 
365 /* If this flag is TRUE, then we will use the native aio of the
366 OS (provided we compiled Innobase with it in), otherwise we will
367 use simulated aio we build below with threads.
368 Currently we support native aio on windows and linux */
369 extern bool srv_use_native_aio;
370 extern bool srv_numa_interleave;
371 
372 /* The innodb_directories variable value. This a list of directories
373 deliminated by ';', i.e the FIL_PATH_SEPARATOR. */
374 extern char *srv_innodb_directories;
375 
376 /** Server undo tablespaces directory, can be absolute path. */
377 extern char *srv_undo_dir;
378 
379 /** Number of undo tablespaces to use. */
381 
382 /** The number of rollback segments per tablespace */
384 
385 /** Maximum size of undo tablespace. */
386 extern unsigned long long srv_max_undo_tablespace_size;
387 
388 /** Rate at which UNDO records should be purged. */
390 
391 /** Enable or Disable Truncate of UNDO tablespace. */
392 extern bool srv_undo_log_truncate;
393 
394 /** Enable or disable Encrypt of UNDO tablespace. */
395 extern bool srv_undo_log_encrypt;
396 
397 /** Default size of UNDO tablespace while it is created new. */
399 
400 extern char *srv_log_group_home_dir;
401 
402 /** Enable or Disable Encrypt of REDO tablespace. */
403 extern bool srv_redo_log_encrypt;
404 
405 /* Maximum number of redo files of a cloned DB. */
406 #define SRV_N_LOG_FILES_CLONE_MAX 1000
407 
408 /** Maximum number of srv_n_log_files, or innodb_log_files_in_group */
409 #define SRV_N_LOG_FILES_MAX 100
410 extern ulong srv_n_log_files;
411 
412 #ifdef UNIV_DEBUG_DEDICATED
413 extern ulong srv_debug_system_mem_size;
414 #endif /* UNIV_DEBUG_DEDICATED */
415 
416 /** At startup, this is the current redo log file size.
417 During startup, if this is different from srv_log_file_size_requested
418 (innodb_log_file_size), the redo log will be rebuilt and this size
419 will be initialized to srv_log_file_size_requested.
420 When upgrading from a previous redo log format, this will be set to 0,
421 and writing to the redo log is not allowed.
422 
423 During startup, this is in bytes, and later converted to pages. */
425 
426 /** The value of the startup parameter innodb_log_file_size. */
428 
429 /** Space for log buffer, expressed in bytes. Note, that log buffer
430 will use only the largest power of two, which is not greater than
431 the assigned space. */
433 
434 /** When log writer follows links in the log recent written buffer,
435 it stops when it has reached at least that many bytes to write,
436 limiting how many bytes can be written in single call. */
438 
439 /** Size of block, used for writing ahead to avoid read-on-write. */
441 
442 /** Number of events used for notifications about redo write. */
444 
445 /** Number of events used for notifications about redo flush. */
447 
448 /** Number of slots in a small buffer, which is used to allow concurrent
449 writes to log buffer. The slots are addressed by LSN values modulo number
450 of the slots. */
452 
453 /** Number of slots in a small buffer, which is used to break requirement
454 for total order of dirty pages, when they are added to flush lists.
455 The slots are addressed by LSN values modulo number of the slots. */
457 
458 /** Minimum absolute value of cpu time for which spin-delay is used. */
460 
461 /** Maximum percentage of cpu time for which spin-delay is used. */
463 
464 /** Number of spin iterations, when spinning and waiting for log buffer
465 written up to given LSN, before we fallback to loop with sleeps.
466 This is not used when user thread has to wait for log flushed to disk. */
468 
469 /** Timeout used when waiting for redo write (microseconds). */
471 
472 /** Number of spin iterations, when spinning and waiting for log flushed. */
474 
475 /** Maximum value of average log flush time for which spin-delay is used.
476 When flushing takes longer, user threads no longer spin when waiting for
477 flushed redo. Expressed in microseconds. */
479 
480 /** Timeout used when waiting for redo flush (microseconds). */
482 
483 /** Number of spin iterations, for which log writer thread is waiting
484 for new data to write or flush without sleeping. */
486 
487 /** Initial timeout used to wait on writer_event. */
489 
490 /** Number of milliseconds every which a periodical checkpoint is written
491 by the log checkpointer thread (unless periodical checkpoints are disabled,
492 which is a case during initial phase of startup). */
494 
495 /** Number of spin iterations, for which log flusher thread is waiting
496 for new data to flush, without sleeping. */
498 
499 /** Initial timeout used to wait on flusher_event. */
501 
502 /** Number of spin iterations, for which log write notifier thread is waiting
503 for advanced writeed_to_disk_lsn without sleeping. */
505 
506 /** Initial timeout used to wait on write_notifier_event. */
508 
509 /** Number of spin iterations, for which log flush notifier thread is waiting
510 for advanced flushed_to_disk_lsn without sleeping. */
512 
513 /** Initial timeout used to wait on flush_notifier_event. */
515 
516 /** Number of spin iterations, for which log closerr thread is waiting
517 for a reachable untraversed link in recent_closed. */
519 
520 /** Initial sleep used in log closer after spin delay is finished. */
522 
523 /** Whether to generate and require checksums on the redo log pages. */
524 extern bool srv_log_checksums;
525 
526 #ifdef UNIV_DEBUG
527 
528 /** If true then disable checkpointing. */
529 extern bool srv_checkpoint_disabled;
530 
531 /* Used to inject a failure to find a free rollback segment. */
533 
534 #endif /* UNIV_DEBUG */
535 
539 extern bool srv_adaptive_flushing;
540 extern bool srv_flush_sync;
541 
542 /* If this flag is TRUE, then we will load the indexes' (and tables') metadata
543 even if they are marked as "corrupted". Mostly it is for DBA to process
544 corrupted index and table */
545 extern bool srv_load_corrupted;
546 
547 /** Dedicated server setting */
548 extern bool srv_dedicated_server;
549 /** Requested size in bytes */
550 extern ulint srv_buf_pool_size;
551 /** Minimum pool size in bytes */
552 extern const ulint srv_buf_pool_min_size;
553 /** Default pool size in bytes */
554 extern const ulint srv_buf_pool_def_size;
555 /** Maximum pool size in bytes */
556 extern const longlong srv_buf_pool_max_size;
557 /** Requested buffer pool chunk size. Each buffer pool instance consists
558 of one or more chunks. */
560 /** Minimum buffer pool chunk size. */
562 /** The buffer pool chunk size must be a multiple of this number. */
564 /** Maximum buffer pool chunk size. */
566 
567 /** Requested number of buffer pool instances */
569 /** Default number of buffer pool instances */
571 /** Number of locks to protect buf_pool->page_hash */
573 /** Scan depth for LRU flush batch i.e.: number of blocks scanned*/
575 /** Whether or not to flush neighbors of a block */
577 /** Previously requested size. Accesses protected by memory barriers. */
578 extern ulint srv_buf_pool_old_size;
579 /** Current size as scaling factor for the other components */
580 extern ulint srv_buf_pool_base_size;
581 /** Current size in bytes */
582 extern long long srv_buf_pool_curr_size;
583 /** Dump this % of each buffer pool during BP dump */
585 /** Lock table size in bytes */
586 extern ulint srv_lock_table_size;
587 
588 extern ulint srv_n_file_io_threads;
589 extern bool srv_random_read_ahead;
593 
595 
596 /** Default value of srv_idle_flush_pct */
597 extern const ulong srv_idle_flush_pct_default;
598 /** How much flush to be done in case of server is idle */
600 
601 /* Number of IO operations per second the server can do */
602 extern ulong srv_io_capacity;
603 
604 /* We use this dummy default value at startup for max_io_capacity.
605 The real value is set based on the value of io_capacity. */
606 #define SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT (~0UL)
607 #define SRV_MAX_IO_CAPACITY_LIMIT (~0UL)
609 /* Returns the number of IO operations that is X percent of the
610 capacity. PCT_IO(5) -> returns the number of IO operations that
611 is 5% of the max where max is srv_io_capacity. */
612 #define PCT_IO(p) ((ulong)(srv_io_capacity * ((double)(p) / 100.0)))
613 
614 /** Maximum number of purge threads, including the purge coordinator */
615 #define MAX_PURGE_THREADS 32
616 
617 /* The "innodb_stats_method" setting, decides how InnoDB is going
618 to treat NULL value when collecting statistics. It is not defined
619 as enum type because the configure option takes unsigned integer type. */
621 
622 extern ulint srv_max_n_open_files;
623 
625 
626 extern double srv_max_dirty_pages_pct;
627 extern double srv_max_dirty_pages_pct_lwm;
628 
631 
633 #ifdef UNIV_DEBUG
635 #endif /* UNIV_DEBUG */
636 
637 /** The value of the configuration parameter innodb_fast_shutdown,
638 controlling the InnoDB shutdown.
639 
640 If innodb_fast_shutdown=0, InnoDB shutdown will purge all undo log
641 records (except XA PREPARE transactions) and complete the merge of the
642 entire change buffer, and then shut down the redo log.
643 
644 If innodb_fast_shutdown=1, InnoDB shutdown will only flush the buffer
645 pool to data files, cleanly shutting down the redo log.
646 
647 If innodb_fast_shutdown=2, shutdown will effectively 'crash' InnoDB
648 (but lose no committed transactions). */
649 extern ulong srv_fast_shutdown;
650 extern ibool srv_innodb_status;
651 
652 extern unsigned long long srv_stats_transient_sample_pages;
653 extern bool srv_stats_persistent;
654 extern unsigned long long srv_stats_persistent_sample_pages;
655 extern bool srv_stats_auto_recalc;
657 
658 extern ibool srv_use_doublewrite_buf;
661 
662 extern double srv_max_buf_pool_modified_pct;
663 extern ulong srv_max_purge_lag;
665 
667 /*-------------------------------------------*/
668 
669 extern bool srv_print_innodb_monitor;
671 
676 extern ibool srv_priority_boost;
677 
678 extern ulint srv_truncated_status_writes;
679 
680 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
682 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
683 
684 #ifdef UNIV_DEBUG
685 extern bool srv_buf_pool_debug;
686 extern bool srv_sync_debug;
688 
689 /** Value of MySQL global used to disable master thread. */
691 #endif /* UNIV_DEBUG */
692 
694 #define SRV_SEMAPHORE_WAIT_EXTENSION 7200
695 extern ulint srv_dml_needed_delay;
696 
697 #ifdef UNIV_HOTBACKUP
698 // MAHI: changed from 130 to 1 assuming the apply-log is single threaded
699 #define SRV_MAX_N_IO_THREADS 1
700 #else /* UNIV_HOTBACKUP */
701 #define SRV_MAX_N_IO_THREADS 130
702 #endif /* UNIV_HOTBACKUP */
703 
704 /* Array of English strings describing the current state of an
705 i/o handler thread */
706 extern const char *srv_io_thread_op_info[];
707 extern const char *srv_io_thread_function[];
708 
709 /* the number of purge threads to use from the worker pool (currently 0 or 1) */
711 
712 /* the number of pages to purge in one batch */
714 
715 /* the number of sync wait arrays */
717 
718 /* print all user-level transactions deadlocks to mysqld stderr */
719 extern bool srv_print_all_deadlocks;
720 
721 /** Print all DDL logs to mysqld stderr */
722 extern bool srv_print_ddl_logs;
723 
724 extern bool srv_cmp_per_index_enabled;
725 
726 /** Status variables to be passed to MySQL */
727 extern struct export_var_t export_vars;
728 
729 #ifndef UNIV_HOTBACKUP
730 /** Global counters */
731 extern srv_stats_t srv_stats;
732 
733 /* Keys to register InnoDB threads with performance schema */
734 
735 #ifdef UNIV_PFS_THREAD
770 #endif /* UNIV_PFS_THREAD */
771 #endif /* !UNIV_HOTBACKUP */
772 
773 #ifdef HAVE_PSI_STAGE_INTERFACE
774 /** Performance schema stage event for monitoring ALTER TABLE progress
775 everything after flush log_make_latest_checkpoint(). */
777 
778 /** Performance schema stage event for monitoring ALTER TABLE progress
779 log_make_latest_checkpoint(). */
781 
782 /** Performance schema stage event for monitoring ALTER TABLE progress
783 row_merge_insert_index_tuples(). */
785 
786 /** Performance schema stage event for monitoring ALTER TABLE progress
787 row_log_apply(). */
789 
790 /** Performance schema stage event for monitoring ALTER TABLE progress
791 row_log_table_apply(). */
793 
794 /** Performance schema stage event for monitoring ALTER TABLE progress
795 row_merge_sort(). */
797 
798 /** Performance schema stage event for monitoring ALTER TABLE progress
799 row_merge_read_clustered_index(). */
801 
802 /** Performance schema stage event for monitoring ALTER TABLESPACE
803 ENCRYPTION progress. */
805 
806 /** Performance schema stage event for monitoring buffer pool load progress. */
808 #endif /* HAVE_PSI_STAGE_INTERFACE */
809 
810 /** Performance schema stage event for monitoring clone file copy progress. */
812 
813 /** Performance schema stage event for monitoring clone redo copy progress. */
815 
816 /** Performance schema stage event for monitoring clone page copy progress. */
818 
819 #ifndef _WIN32
820 /** Alternatives for the file flush option in Unix.
821 @see innodb_flush_method_names */
823  SRV_UNIX_FSYNC = 0, /*!< fsync, the default */
824  SRV_UNIX_O_DSYNC, /*!< open log files in O_SYNC mode */
825  SRV_UNIX_LITTLESYNC, /*!< do not call os_file_flush()
826  when writing data files, but do flush
827  after writing to log files */
828  SRV_UNIX_NOSYNC, /*!< do not flush after writing */
829  SRV_UNIX_O_DIRECT, /*!< invoke os_file_set_nocache() on
830  data files. This implies using
831  non-buffered IO but still using fsync,
832  the reason for which is that some FS
833  do not flush meta-data when
834  unbuffered IO happens */
836  /*!< do not use fsync() when using
837  direct IO i.e.: it can be set to avoid
838  the fsync() call that we make when
839  using SRV_UNIX_O_DIRECT. However, in
840  this case user/DBA should be sure about
841  the integrity of the meta-data */
842 };
844 
845 inline bool srv_is_direct_io() {
848 }
849 
850 #else
851 /** Alternatives for file i/o in Windows. @see innodb_flush_method_names. */
852 enum srv_win_flush_t {
853  /** unbuffered I/O; this is the default */
854  SRV_WIN_IO_UNBUFFERED = 0,
855  /** buffered I/O */
856  SRV_WIN_IO_NORMAL,
857 };
858 extern enum srv_win_flush_t srv_win_file_flush_method;
859 
860 inline bool srv_is_direct_io() {
861  return (srv_win_file_flush_method == SRV_WIN_IO_UNBUFFERED);
862 }
863 
864 #endif /* _WIN32 */
865 
866 /** Alternatives for srv_force_recovery. Non-zero values are intended
867 to help the user get a damaged database up so that he can dump intact
868 tables and rows with SELECT INTO OUTFILE. The database must not otherwise
869 be used with these options! A bigger number below means that all precautions
870 of lower numbers are included. */
871 enum {
872  SRV_FORCE_IGNORE_CORRUPT = 1, /*!< let the server run even if it
873  detects a corrupt page */
874  SRV_FORCE_NO_BACKGROUND = 2, /*!< prevent the main thread from
875  running: if a crash would occur
876  in purge, this prevents it */
877  SRV_FORCE_NO_TRX_UNDO = 3, /*!< do not run trx rollback after
878  recovery */
879  SRV_FORCE_NO_IBUF_MERGE = 4, /*!< prevent also ibuf operations:
880  if they would cause a crash, better
881  not do them */
882  SRV_FORCE_NO_UNDO_LOG_SCAN = 5, /*!< do not look at undo logs when
883  starting the database: InnoDB will
884  treat even incomplete transactions
885  as committed */
886  SRV_FORCE_NO_LOG_REDO = 6 /*!< do not do the log roll-forward
887  in connection with recovery */
888 };
889 
890 /* Alternatives for srv_innodb_stats_method, which could be changed by
891 setting innodb_stats_method */
893  SRV_STATS_NULLS_EQUAL, /* All NULL values are treated as
894  equal. This is the default setting
895  for innodb_stats_method */
896  SRV_STATS_NULLS_UNEQUAL, /* All NULL values are treated as
897  NOT equal. */
898  SRV_STATS_NULLS_IGNORED /* NULL values are ignored */
899 };
900 
902 
903 #ifdef UNIV_DEBUG
904 /** Force all user tables to use page compression. */
906 #endif /* UNIV_DEBUG */
907 
908 /** Types of threads existing in the system. */
910  SRV_NONE, /*!< None */
911  SRV_WORKER, /*!< threads serving parallelized
912  queries and queries released from
913  lock wait */
914  SRV_PURGE, /*!< Purge coordinator thread */
915  SRV_MASTER /*!< the master thread, (whose type
916  number must be biggest) */
917 };
918 
919 /** Boots Innobase server. */
920 void srv_boot(void);
921 /** Frees the data structures created in srv_init(). */
922 void srv_free(void);
923 /** Sets the info describing an i/o thread current state. */
925  ulint i, /*!< in: the 'segment' of the i/o thread */
926  const char *str); /*!< in: constant char string describing the
927  state */
928 /** Resets the info describing an i/o thread current state. */
930 /** Tells the purge thread that there has been activity in the database
931  and wakes up the purge thread if it is suspended (not sleeping). Note
932  that there is a small chance that the purge thread stays suspended
933  (we do not protect our operation with the srv_sys_t:mutex, for
934  performance reasons). */
936 /** Tells the Innobase server that there has been activity in the database
937  and wakes up the master thread if it is suspended (not sleeping). Used
938  in the MySQL interface. Note that there is a small chance that the master
939  thread stays suspended (we do not protect our operation with the kernel
940  mutex, for performace reasons). */
942 #define srv_active_wake_master_thread() \
943  do { \
944  if (!srv_read_only_mode) { \
945  srv_active_wake_master_thread_low(); \
946  } \
947  } while (0)
948 /** Wakes up the master thread if it is suspended or being suspended. */
949 void srv_wake_master_thread(void);
950 #ifndef UNIV_HOTBACKUP
951 /** Outputs to a file the output of the InnoDB Monitor.
952  @return false if not all information printed
953  due to failure to obtain necessary mutex */
955  FILE *file, /*!< in: output stream */
956  ibool nowait, /*!< in: whether to wait for the
957  lock_sys_t::mutex */
958  ulint *trx_start, /*!< out: file position of the start of
959  the list of active transactions */
960  ulint *trx_end); /*!< out: file position of the end of
961  the list of active transactions */
962 
963 /** Function to pass InnoDB status variables to MySQL */
964 void srv_export_innodb_status(void);
965 /** Get current server activity count. We don't hold srv_sys::mutex while
966  reading this value as it is only used in heuristics.
967  @return activity count. */
968 ulint srv_get_activity_count(void);
969 /** Check if there has been any activity.
970  @return false if no change in activity counter. */
971 ibool srv_check_activity(ulint old_activity_count); /*!< old activity count */
972 /** Increment the server activity counter. */
973 void srv_inc_activity_count(void);
974 
975 /** Enqueues a task to server task queue and releases a worker thread, if there
976  is a suspended one. */
977 void srv_que_task_enqueue_low(que_thr_t *thr); /*!< in: query thread */
978 
979 /** A thread which prints the info output by various InnoDB monitors. */
980 void srv_monitor_thread();
981 
982 /** A thread which prints warnings about semaphore waits which have lasted
983 too long. These can be used to track bugs which cause hangs. */
985 
986 /** The master thread controlling the server. */
987 void srv_master_thread();
988 
989 /** Purge coordinator thread that schedules the purge tasks. */
991 
992 /** Worker thread that reads tasks from the work queue and executes them. */
993 void srv_worker_thread();
994 
995 /** Rotate default master key for UNDO tablespace. */
997 
998 /** Set encryption for UNDO tablespace with given space id.
999 @param[in] space_id undo tablespace id
1000 @param[in] mtr mini-transaction
1001 @param[in] is_boot true if it is called during server start up.
1002 @return false for success, true otherwise */
1003 bool set_undo_tablespace_encryption(space_id_t space_id, mtr_t *mtr,
1004  bool is_boot);
1005 
1006 /** Enable UNDO tablespaces encryption.
1007 @param[in] is_boot true if it is called during server start up. In this
1008  case, default master key will be used which will be
1009  rotated later with actual master key from kyering.
1010 @return false for success, true otherwise. */
1011 bool srv_enable_undo_encryption(bool is_boot);
1012 
1013 /** Enable REDO log encryption.
1014 @param[in] is_boot true if it is called during server start up. In this
1015  case, default master key will be used which will be
1016  rotated later with actual master key from kyering.
1017 @return false for success, true otherwise. */
1018 bool srv_enable_redo_encryption(bool is_boot);
1019 
1020 /** Get count of tasks in the queue.
1021  @return number of tasks in queue */
1022 ulint srv_get_task_queue_length(void);
1023 
1024 /** Releases threads of the type given from suspension in the thread table.
1025  NOTE! The server mutex has to be reserved by the caller!
1026  @return number of threads released: this may be less than n if not
1027  enough threads were suspended at the moment */
1028 ulint srv_release_threads(enum srv_thread_type type, /*!< in: thread type */
1029  ulint n); /*!< in: number of threads to release */
1030 
1031 /** Check whether the master thread is active.
1032 This is polled during the final phase of shutdown.
1033 The first phase of server shutdown must have already been executed
1034 (or the server must not have been fully started up).
1035 @see srv_pre_dd_shutdown()
1036 @retval true if any thread is active
1037 @retval false if no thread is active */
1039 
1040 /** Wakeup the purge threads. */
1041 void srv_purge_wakeup(void);
1042 
1043 /** Check if the purge threads are active, both coordinator and worker threads
1044 @return true if any thread is active, false if no thread is active */
1046 
1047 /** Create an undo tablespace with an explicit file name
1048 @param[in] space_name tablespace name
1049 @param[in] file_name file name
1050 @param[out] space_id Tablespace ID chosen
1051 @return DB_SUCCESS or error code */
1052 dberr_t srv_undo_tablespace_create(const char *space_name,
1053  const char *file_name, space_id_t space_id);
1054 
1055 /** Initialize undo::spaces and trx_sys_undo_spaces,
1056 called once during srv_start(). */
1057 void undo_spaces_init();
1058 
1059 /** Free the resources occupied by undo::spaces and trx_sys_undo_spaces,
1060 called once during thread de-initialization. */
1061 void undo_spaces_deinit();
1062 
1063 #ifdef UNIV_DEBUG
1064 struct SYS_VAR;
1065 
1066 /** Disables master thread. It's used by:
1067  SET GLOBAL innodb_master_thread_disabled_debug = 1 (0).
1068 @param[in] thd thread handle
1069 @param[in] var pointer to system variable
1070 @param[out] var_ptr where the formal string goes
1071 @param[in] save immediate result from check function */
1073  void *var_ptr, const void *save);
1074 #endif /* UNIV_DEBUG */
1075 #endif /* !UNIV_HOTBACKUP */
1076 
1077 /** Status variables to be passed to MySQL */
1079  ulint innodb_data_pending_reads; /*!< Pending reads */
1080  ulint innodb_data_pending_writes; /*!< Pending writes */
1081  ulint innodb_data_pending_fsyncs; /*!< Pending fsyncs */
1082  ulint innodb_data_fsyncs; /*!< Number of fsyncs so far */
1083  ulint innodb_data_read; /*!< Data bytes read */
1084  ulint innodb_data_writes; /*!< I/O write requests */
1085  ulint innodb_data_written; /*!< Data bytes written */
1086  ulint innodb_data_reads; /*!< I/O read requests */
1088  128]; /*!< Buf pool dump status */
1090  128]; /*!< Buf pool load status */
1091  char innodb_buffer_pool_resize_status[512]; /*!< Buf pool resize status */
1092  ulint innodb_buffer_pool_pages_total; /*!< Buffer pool size */
1093  ulint innodb_buffer_pool_pages_data; /*!< Data pages */
1094  ulint innodb_buffer_pool_bytes_data; /*!< File bytes used */
1095  ulint innodb_buffer_pool_pages_dirty; /*!< Dirty data pages */
1096  ulint innodb_buffer_pool_bytes_dirty; /*!< File bytes modified */
1097  ulint innodb_buffer_pool_pages_misc; /*!< Miscellanous pages */
1098  ulint innodb_buffer_pool_pages_free; /*!< Free pages */
1099 #ifdef UNIV_DEBUG
1100  ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */
1101 #endif /* UNIV_DEBUG */
1102  ulint innodb_buffer_pool_read_requests; /*!< buf_pool->stat.n_page_gets */
1103  ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
1104  ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
1105  ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */
1106  ulint innodb_buffer_pool_write_requests; /*!< srv_buf_pool_write_requests */
1107  ulint innodb_buffer_pool_read_ahead_rnd; /*!< srv_read_ahead_rnd */
1108  ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
1109  ulint innodb_buffer_pool_read_ahead_evicted; /*!< srv_read_ahead evicted*/
1110  ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */
1111  ulint innodb_dblwr_writes; /*!< srv_dblwr_writes */
1112  ulint innodb_log_waits; /*!< srv_log_waits */
1113  ulint innodb_log_write_requests; /*!< srv_log_write_requests */
1114  ulint innodb_log_writes; /*!< srv_log_writes */
1115  lsn_t innodb_os_log_written; /*!< srv_os_log_written */
1116  ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */
1117  ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */
1118  ulint innodb_os_log_pending_fsyncs; /*!< fil_n_pending_log_flushes */
1119  ulint innodb_page_size; /*!< UNIV_PAGE_SIZE */
1120  ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */
1121  ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read */
1122  ulint innodb_pages_written; /*!< buf_pool->stat.n_pages_written */
1123  ulint innodb_row_lock_waits; /*!< srv_n_lock_wait_count */
1124  ulint innodb_row_lock_current_waits; /*!< srv_n_lock_wait_current_count */
1125  int64_t innodb_row_lock_time; /*!< srv_n_lock_wait_time
1126  / 1000 */
1127  ulint innodb_row_lock_time_avg; /*!< srv_n_lock_wait_time
1128  / 1000
1129  / srv_n_lock_wait_count */
1130  ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time
1131  / 1000 */
1132  ulint innodb_rows_read; /*!< srv_n_rows_read */
1133  ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
1134  ulint innodb_rows_updated; /*!< srv_n_rows_updated */
1135  ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
1136  ulint innodb_system_rows_read; /*!< srv_n_system_rows_read */
1137  ulint innodb_system_rows_inserted; /*!< srv_n_system_rows_inserted */
1138  ulint innodb_system_rows_updated; /*!< srv_n_system_rows_updated */
1139  ulint innodb_system_rows_deleted; /*!< srv_n_system_rows_deleted*/
1142  ulint innodb_num_open_files; /*!< fil_n_file_opened */
1143  ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
1144  ulint innodb_undo_tablespaces_total; /*!< total number of undo tablespaces
1145  innoDB is tracking. */
1146  ulint innodb_undo_tablespaces_implicit; /*!< number of undo tablespaces
1147  innoDB created implicitly. */
1148  ulint innodb_undo_tablespaces_explicit; /*!< number of undo tablespaces
1149  the dba created explicitly. */
1150  ulint innodb_undo_tablespaces_active; /*!< number of active undo
1151  tablespaces */
1152 #ifdef UNIV_DEBUG
1153  ulint innodb_purge_trx_id_age; /*!< rw_max_trx_no - purged trx_no */
1154  ulint innodb_purge_view_trx_id_age; /*!< rw_max_trx_no
1155  - purged view's min trx_no */
1156  ulint innodb_ahi_drop_lookups; /*!< number of adaptive hash
1157  index lookups when freeing
1158  file pages */
1159 #endif /* UNIV_DEBUG */
1160 };
1161 
1162 #ifndef UNIV_HOTBACKUP
1163 /** Thread slot in the thread table. */
1164 struct srv_slot_t {
1165  /** Thread type: user, utility etc. */
1167 
1168  /** TRUE if this slot is in use. */
1169  bool in_use;
1170 
1171  /** TRUE if the thread is waiting for the event of this slot. */
1173 
1174  /** Time when the thread was suspended. Initialized by
1175  lock_wait_table_reserve_slot() for lock wait. */
1177 
1178  /** Stores the current value of lock_wait_table_reservations, when
1179  lock_wait_table_reserve_slot is called.
1180  This can be used as a version number to avoid ABA problems.
1181  Protected by lock->wait_mutex. */
1182  uint64_t reservation_no;
1183 
1184  /** Wait time that if exceeded the thread will be timed out.
1185  Initialized by lock_wait_table_reserve_slot() for lock wait. */
1187 
1188  /** Event used in suspending the thread when it has nothing to do. */
1190 
1191  /** Suspended query thread (only used for user threads). */
1193 };
1194 #endif /* !UNIV_HOTBACKUP */
1195 
1196 #endif
srv_misc_tmpfile_mutex
ib_mutex_t srv_misc_tmpfile_mutex
Mutex for locking srv_misc_tmpfile.
Definition: srv0srv.cc:595
srv_purge_wakeup
void srv_purge_wakeup(void)
Wakeup the purge threads.
Definition: srv0srv.cc:3165
srv_n_page_hash_locks
ulong srv_n_page_hash_locks
Number of locks to protect buf_pool->page_hash.
Definition: srv0srv.cc:408
page_no_t
uint32 page_no_t
Page number.
Definition: api0api.h:57
srv_buf_pool_debug
bool srv_buf_pool_debug
This is used to enable multiple buffer pool instances with small buffer pool size.
Definition: buf0buf.cc:330
srv_is_direct_io
bool srv_is_direct_io()
Definition: srv0srv.h:845
Srv_threads::m_log_closer
IB_thread m_log_closer
Redo closer thread.
Definition: srv0srv.h:172
srv_debug_compress
ulong srv_debug_compress
Force all user tables to use page compression.
Definition: srv0srv.cc:208
lsn_t
uint64_t lsn_t
Type used for all log sequence number storage and arithmetics.
Definition: log0types.h:59
export_var_t::innodb_row_lock_current_waits
ulint innodb_row_lock_current_waits
srv_n_lock_wait_current_count
Definition: srv0srv.h:1124
log_ddl
Log_DDL * log_ddl
Object to handle Log_DDL.
Definition: log0ddl.cc:60
log_writer_thread_key
mysql_pfs_key_t log_writer_thread_key
export_var_t::innodb_rows_deleted
ulint innodb_rows_deleted
srv_n_rows_deleted
Definition: srv0srv.h:1135
srv_que_task_enqueue_low
void srv_que_task_enqueue_low(que_thr_t *thr)
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one.
Definition: srv0srv.cc:3136
export_var_t::innodb_buffer_pool_load_status
char innodb_buffer_pool_load_status[OS_FILE_MAX_PATH+128]
Buf pool load status.
Definition: srv0srv.h:1090
THD
Definition: sql_class.h:764
srv_wake_purge_thread_if_not_active
void srv_wake_purge_thread_if_not_active(void)
Tells the purge thread that there has been activity in the database and wakes up the purge thread if ...
Definition: srv0srv.cc:1897
export_var_t::innodb_buffer_pool_wait_free
ulint innodb_buffer_pool_wait_free
srv_buf_pool_wait_free
Definition: srv0srv.h:1104
srv_buf_resize_event
os_event_t srv_buf_resize_event
The buffer pool resize thread waits on this event.
Definition: srv0srv.cc:748
srv_monitor_thread
void srv_monitor_thread()
A thread which prints the info output by various InnoDB monitors.
Definition: srv0srv.cc:1693
srv_adaptive_flushing_lwm
ulong srv_adaptive_flushing_lwm
Definition: srv0srv.cc:468
srv_stats_t::os_log_pending_writes
lint_ctr_1_t os_log_pending_writes
Number of writes being done to the log files.
Definition: srv0srv.h:90
export_var_t::innodb_buffer_pool_pages_flushed
ulint innodb_buffer_pool_pages_flushed
srv_buf_pool_flushed
Definition: srv0srv.h:1105
srv_error_monitor_thread
void srv_error_monitor_thread()
A thread which prints warnings about semaphore waits which have lasted too long.
Definition: srv0srv.cc:1769
log_write_notifier_thread_key
mysql_pfs_key_t log_write_notifier_thread_key
Srv_threads::m_fts_optimize
IB_thread m_fts_optimize
Thread doing optimization for FTS index.
Definition: srv0srv.h:243
srv_log_wait_for_write_spin_delay
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:287
export_var_t::innodb_truncated_status_writes
ulint innodb_truncated_status_writes
srv_truncated_status_writes
Definition: srv0srv.h:1143
srv_stage_clone_redo_copy
PSI_stage_info srv_stage_clone_redo_copy
Performance schema stage event for monitoring clone redo copy progress.
Definition: srv0srv.cc:819
export_var_t::innodb_rows_updated
ulint innodb_rows_updated
srv_n_rows_updated
Definition: srv0srv.h:1134
srv_unix_flush_t
srv_unix_flush_t
Alternatives for the file flush option in Unix.
Definition: srv0srv.h:822
Srv_threads::m_buf_resize
IB_thread m_buf_resize
Buffer pool resize thread.
Definition: srv0srv.h:196
srv_use_doublewrite_buf
ibool srv_use_doublewrite_buf
Definition: srv0srv.cc:540
srv_stats_t::buf_pool_flushed
ulint_ctr_1_t buf_pool_flushed
Count the number of pages that were written from buffer pool to the disk.
Definition: srv0srv.h:113
srv_online_max_size
unsigned long long srv_online_max_size
Maximum modification log file size for online index creation.
Definition: srv0srv.cc:187
SYS_VAR
Definition: plugin.h:62
srv_stats_include_delete_marked
bool srv_stats_include_delete_marked
Definition: srv0srv.cc:536
Srv_threads::m_backup_log_archiver
IB_thread m_backup_log_archiver
Redo log archiver (used by backup).
Definition: srv0srv.h:190
srv_enable_redo_encryption
bool srv_enable_redo_encryption(bool is_boot)
Enable REDO log encryption.
Definition: srv0srv.cc:2447
export_var_t::innodb_sampled_pages_read
ulint innodb_sampled_pages_read
Definition: srv0srv.h:1140
srv_stage_alter_table_log_index
PSI_stage_info srv_stage_alter_table_log_index
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().
Definition: srv0srv.cc:782
Srv_threads::m_log_flush_notifier
IB_thread m_log_flush_notifier
Redo flush notifier thread.
Definition: srv0srv.h:187
srv_log_recent_written_size
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:277
srv_flush_log_at_timeout
uint srv_flush_log_at_timeout
Definition: srv0srv.cc:360
export_var_t::innodb_system_rows_read
ulint innodb_system_rows_read
srv_n_system_rows_read
Definition: srv0srv.h:1136
srv_max_purge_lag
ulong srv_max_purge_lag
Maximum allowable purge history length.
Definition: trx0purge.cc:66
srv_stats_t::log_write_requests
ulint_ctr_1_t log_write_requests
Number of the log write requests done.
Definition: srv0srv.h:81
srv_stats_t::dblwr_pages_written
ulint_ctr_1_t dblwr_pages_written
Store the number of pages that have been flushed to the doublewrite buffer.
Definition: srv0srv.h:101
srv_stats_t::ulint_ctr_64_t
ib_counter_t< ulint, 64 > ulint_ctr_64_t
Definition: srv0srv.h:71
os0thread.h
undo_rotate_default_master_key
void undo_rotate_default_master_key()
Rotate default master key for UNDO tablespace.
Definition: srv0srv.cc:2396
srv_stats_t::n_rows_inserted
ulint_ctr_64_t n_rows_inserted
Number of rows inserted.
Definition: srv0srv.h:141
srv_n_page_cleaners
ulong srv_n_page_cleaners
Definition: srv0srv.cc:456
export_var_t::innodb_row_lock_time_avg
ulint innodb_row_lock_time_avg
srv_n_lock_wait_time / 1000 / srv_n_lock_wait_count
Definition: srv0srv.h:1127
export_var_t::innodb_sampled_pages_skipped
ulint innodb_sampled_pages_skipped
Definition: srv0srv.h:1141
Srv_cpu_usage::n_cpu
int n_cpu
Definition: srv0srv.h:268
srv_buf_pool_instances
ulong srv_buf_pool_instances
Requested number of buffer pool instances.
Definition: srv0srv.cc:404
srv_stats_t::n_sampled_pages_read
ulint_ctr_64_t n_sampled_pages_read
Number of sampled pages read.
Definition: srv0srv.h:156
srv_purge_thread_key
mysql_pfs_key_t srv_purge_thread_key
srv_ibuf_disable_background_merge
bool srv_ibuf_disable_background_merge
Definition: ibuf0ibuf.cc:43
srv_buf_dump_event
os_event_t srv_buf_dump_event
The buffer pool dump/load thread waits on this event.
Definition: srv0srv.cc:745
srv_wake_master_thread
void srv_wake_master_thread(void)
Wakes up the master thread if it is suspended or being suspended.
Definition: srv0srv.cc:1907
srv_purge_coordinator_thread
void srv_purge_coordinator_thread()
Purge coordinator thread that schedules the purge tasks.
Definition: srv0srv.cc:3019
srv_stats_t::n_rows_deleted
ulint_ctr_64_t n_rows_deleted
Number of rows deleted.
Definition: srv0srv.h:138
Srv_threads::m_page_cleaner_coordinator
IB_thread m_page_cleaner_coordinator
Page cleaner coordinator (also being a worker).
Definition: srv0srv.h:227
srv_buf_pool_chunk_unit_min
const ulonglong srv_buf_pool_chunk_unit_min
Minimum buffer pool chunk size.
Definition: srv0srv.cc:397
export_var_t::innodb_pages_written
ulint innodb_pages_written
buf_pool->stat.n_pages_written
Definition: srv0srv.h:1122
srv_load_corrupted
bool srv_load_corrupted
Definition: dict0load.cc:127
io_read_thread_key
mysql_pfs_key_t io_read_thread_key
Srv_threads::m_page_archiver
IB_thread m_page_archiver
Archiver's page archiver (used by Clone).
Definition: srv0srv.h:240
srv_log_spin_cpu_pct_hwm
uint srv_log_spin_cpu_pct_hwm
Maximum percentage of cpu time for which spin-delay is used.
Definition: srv0srv.cc:254
export_var_t::innodb_buffer_pool_pages_dirty
ulint innodb_buffer_pool_pages_dirty
Dirty data pages.
Definition: srv0srv.h:1095
Srv_threads::m_dict_stats
IB_thread m_dict_stats
Dict stats background thread.
Definition: srv0srv.h:199
srv_undo_tablespace_create
dberr_t srv_undo_tablespace_create(const char *space_name, const char *file_name, space_id_t space_id)
Create an undo tablespace with an explicit file name.
Definition: srv0start.cc:1411
mtr_t
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:169
dict_stats_thread_key
mysql_pfs_key_t dict_stats_thread_key
os_event
InnoDB condition variable.
Definition: os0event.cc:66
srv_flush_neighbors
ulong srv_flush_neighbors
Whether or not to flush neighbors of a block.
Definition: srv0srv.cc:412
export_var_t::innodb_buffer_pool_read_ahead_rnd
ulint innodb_buffer_pool_read_ahead_rnd
srv_read_ahead_rnd
Definition: srv0srv.h:1107
Srv_threads::shutdown_cleanup_dbg
os_event_t 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:253
srv_stats_t::n_lock_wait_count
ulint_ctr_1_t n_lock_wait_count
Number of database lock waits.
Definition: srv0srv.h:126
srv_log_writer_spin_delay
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:304
page_zip_stat_per_index_mutex
ib_mutex_t page_zip_stat_per_index_mutex
Mutex protecting page_zip_stat_per_index.
Definition: srv0srv.cc:585
export_var_t::innodb_os_log_fsyncs
ulint innodb_os_log_fsyncs
fil_n_log_flushes
Definition: srv0srv.h:1116
srv_log_write_notifier_spin_delay
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:323
export_var_t::innodb_data_pending_fsyncs
ulint innodb_data_pending_fsyncs
Pending fsyncs.
Definition: srv0srv.h:1081
srv_log_checkpoint_every
ulong srv_log_checkpoint_every
Number of milliseconds every which a periodical checkpoint is written by the log checkpointer thread ...
Definition: srv0srv.cc:312
srv_downgrade_logs
bool srv_downgrade_logs
srv_data_home
char * srv_data_home
Definition: srv0srv.cc:127
srv_stats_t::buf_pool_write_requests
ulint_ctr_1_t buf_pool_write_requests
Store the number of write requests issued.
Definition: srv0srv.h:104
srv_stage_clone_page_copy
PSI_stage_info srv_stage_clone_page_copy
Performance schema stage event for monitoring clone page copy progress.
Definition: srv0srv.cc:823
srv_truncated_status_writes
ulint srv_truncated_status_writes
Definition: srv0srv.cc:567
longlong
long long int longlong
Definition: my_inttypes.h:54
srv_slot_t::thr
que_thr_t * thr
Suspended query thread (only used for user threads).
Definition: srv0srv.h:1192
srv_io_capacity
ulong srv_io_capacity
Definition: srv0srv.cc:452
Srv_cpu_usage::utime_pct
double utime_pct
Definition: srv0srv.h:271
srv_unix_file_flush_method
enum srv_unix_flush_t srv_unix_file_flush_method
Definition: srv0srv.cc:444
export_var_t::innodb_data_read
ulint innodb_data_read
Data bytes read.
Definition: srv0srv.h:1083
SRV_UNDO_TABLESPACE_SIZE_IN_PAGES
const page_no_t SRV_UNDO_TABLESPACE_SIZE_IN_PAGES
Default size of UNDO tablespace while it is created new.
Definition: srv0srv.cc:172
srv_redo_log_encrypt
bool srv_redo_log_encrypt
Enable or Disable Encrypt of REDO tablespace.
Definition: srv0srv.cc:223
Srv_cpu_usage::stime_abs
double stime_abs
Definition: srv0srv.h:270
dberr_t
dberr_t
Definition: db0err.h:38
SRV_STATS_NULLS_EQUAL
@ SRV_STATS_NULLS_EQUAL
Definition: srv0srv.h:893
export_var_t::innodb_dblwr_pages_written
ulint innodb_dblwr_pages_written
srv_dblwr_pages_written
Definition: srv0srv.h:1110
srv_checksum_algorithm
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:54
srv_sync_array_size
ulong srv_sync_array_size
User configured sync array size.
Definition: sync0arr.cc:166
srv_error_event
os_event_t srv_error_event
Event to signal the error thread.
Definition: srv0srv.cc:742
Srv_threads::m_purge_workers
IB_thread * m_purge_workers
Purge workers.
Definition: srv0srv.h:224
srv_stats_t::ulint_ctr_1_t
ib_counter_t< ulint, 1, single_indexer_t > ulint_ctr_1_t
Definition: srv0srv.h:73
export_var_t::innodb_system_rows_inserted
ulint innodb_system_rows_inserted
srv_n_system_rows_inserted
Definition: srv0srv.h:1137
export_var_t::innodb_ahi_drop_lookups
ulint innodb_ahi_drop_lookups
number of adaptive hash index lookups when freeing file pages
Definition: srv0srv.h:1156
srv_log_wait_for_write_timeout
ulong srv_log_wait_for_write_timeout
Timeout used when waiting for redo write (microseconds).
Definition: srv0srv.cc:291
srv_stats_t::lsn_ctr_1_t
ib_counter_t< lsn_t, 1, single_indexer_t > lsn_ctr_1_t
Definition: srv0srv.h:72
SRV_STATS_NULLS_IGNORED
@ SRV_STATS_NULLS_IGNORED
Definition: srv0srv.h:898
export_var_t::innodb_os_log_written
lsn_t innodb_os_log_written
srv_os_log_written
Definition: srv0srv.h:1115
srv_thread_is_active
bool srv_thread_is_active(const IB_thread &thread)
Check if given thread is still active.
Definition: srv0srv.cc:3204
srv_stats_t::data_written
ulint_ctr_1_t data_written
Count the amount of data written in total (in bytes)
Definition: srv0srv.h:78
srv_log_writer_timeout
ulong srv_log_writer_timeout
Initial timeout used to wait on writer_event.
Definition: srv0srv.cc:307
srv_threads
Srv_threads srv_threads
Structure with state of srv background threads.
Definition: srv0srv.cc:97
SRV_UNIX_O_DIRECT
@ SRV_UNIX_O_DIRECT
invoke os_file_set_nocache() on data files.
Definition: srv0srv.h:829
export_var_t::innodb_row_lock_waits
ulint innodb_row_lock_waits
srv_n_lock_wait_count
Definition: srv0srv.h:1123
srv_active_wake_master_thread_low
void srv_active_wake_master_thread_low(void)
Tells the Innobase server that there has been activity in the database and wakes up the master thread...
Definition: srv0srv.cc:1861
srv_buf_pool_chunk_unit
ulonglong srv_buf_pool_chunk_unit
Requested buffer pool chunk size.
Definition: srv0srv.cc:395
SRV_MASTER
@ SRV_MASTER
the master thread, (whose type number must be biggest)
Definition: srv0srv.h:915
export_var_t::innodb_buffer_pool_dump_status
char innodb_buffer_pool_dump_status[OS_FILE_MAX_PATH+128]
Buf pool dump status.
Definition: srv0srv.h:1088
srv_undo_log_truncate
bool srv_undo_log_truncate
Enable or Disable Truncate of UNDO tablespace.
Definition: srv0srv.cc:163
srv_n_log_files
ulong srv_n_log_files
Definition: srv0srv.cc:225
srv_stats_t::n_lock_wait_current_count
lint_ctr_1_t n_lock_wait_current_count
Number of threads currently waiting on database locks.
Definition: srv0srv.h:129
set_undo_tablespace_encryption
bool set_undo_tablespace_encryption(space_id_t space_id, mtr_t *mtr, bool is_boot)
Set encryption for UNDO tablespace with given space id.
Definition: srv0srv.cc:2482
io_ibuf_thread_key
mysql_pfs_key_t io_ibuf_thread_key
srv_stats_t::n_system_rows_deleted
ulint_ctr_64_t n_system_rows_deleted
Number of system rows deleted.
Definition: srv0srv.h:150
srv_read_ahead_threshold
ulong srv_read_ahead_threshold
Definition: srv0srv.cc:437
srv_sync_debug
bool srv_sync_debug
Definition: sync0debug.cc:61
Srv_threads::m_master
IB_thread m_master
The master thread.
Definition: srv0srv.h:205
export_var_t::innodb_os_log_pending_fsyncs
ulint innodb_os_log_pending_fsyncs
fil_n_pending_log_flushes
Definition: srv0srv.h:1118
buf_resize_thread_key
mysql_pfs_key_t buf_resize_thread_key
srv_log_flush_events
ulong srv_log_flush_events
Number of events used for notifications about redo flush.
Definition: srv0srv.cc:272
srv_log_closer_spin_delay
ulong srv_log_closer_spin_delay
Number of spin iterations, for which log closerr thread is waiting for a reachable untraversed link i...
Definition: srv0srv.cc:341
srv_stats_t::n_system_rows_inserted
ulint_ctr_64_t n_system_rows_inserted
Number of system rows inserted.
Definition: srv0srv.h:153
srv_io_thread_function
const char * srv_io_thread_function[]
Definition: srv0srv.cc:576
que0types.h
srv_log_wait_for_flush_spin_delay
ulong srv_log_wait_for_flush_spin_delay
Number of spin iterations, when spinning and waiting for log flushed.
Definition: srv0srv.cc:295
Srv_threads::m_log_write_notifier
IB_thread m_log_write_notifier
Redo write notifier thread.
Definition: srv0srv.h:184
srv_LRU_scan_depth
ulong srv_LRU_scan_depth
Scan depth for LRU flush batch i.e.
Definition: srv0srv.cc:410
srv_purge_threads_active
bool srv_purge_threads_active()
Check if the purge threads are active, both coordinator and worker threads.
Definition: srv0srv.cc:3182
SRV_FORCE_IGNORE_CORRUPT
@ SRV_FORCE_IGNORE_CORRUPT
let the server run even if it detects a corrupt page
Definition: srv0srv.h:872
srv_rollback_segments
ulong srv_rollback_segments
The number of rollback segments per tablespace.
Definition: srv0srv.cc:143
srv_monitor_event
os_event_t srv_monitor_event
Event to signal the monitor thread.
Definition: srv0srv.cc:739
srv_stats_t::n_rows_read
ulint_ctr_64_t n_rows_read
Number of rows read.
Definition: srv0srv.h:132
log_flush_notifier_thread_key
mysql_pfs_key_t log_flush_notifier_thread_key
buf_dump_thread_key
mysql_pfs_key_t buf_dump_thread_key
srv_max_dirty_pages_pct
double srv_max_dirty_pages_pct
srv_inject_too_many_concurrent_trxs
bool srv_inject_too_many_concurrent_trxs
Definition: srv0srv.cc:355
srv_print_innodb_monitor
bool srv_print_innodb_monitor
Definition: srv0srv.cc:569
srv_master_thread_disabled_debug
bool srv_master_thread_disabled_debug
Value of MySQL global used to disable master thread.
Definition: srv0srv.cc:212
io_log_thread_key
mysql_pfs_key_t io_log_thread_key
srv_stats_transient_sample_pages
unsigned long long srv_stats_transient_sample_pages
Definition: srv0srv.cc:534
srv_enable_undo_encryption
bool srv_enable_undo_encryption(bool is_boot)
Enable UNDO tablespaces encryption.
Definition: srv0srv.cc:2525
srv_buf_pool_chunk_unit_max
const ulonglong srv_buf_pool_chunk_unit_max
Maximum buffer pool chunk size.
Definition: srv0srv.cc:401
srv_stats_t::n_lock_wait_time
int64_ctr_1_t n_lock_wait_time
Wait time of database locks.
Definition: srv0srv.h:123
Srv_threads
Structure which keeps shared future objects for InnoDB background threads.
Definition: srv0srv.h:164
SRV_UNIX_NOSYNC
@ SRV_UNIX_NOSYNC
do not flush after writing
Definition: srv0srv.h:828
srv_stats_auto_recalc
bool srv_stats_auto_recalc
Definition: srv0srv.cc:538
Srv_threads::m_log_flusher
IB_thread m_log_flusher
Redo flusher thread.
Definition: srv0srv.h:181
srv_dml_needed_delay
ulint srv_dml_needed_delay
Definition: srv0srv.cc:118
SRV_FORCE_NO_IBUF_MERGE
@ SRV_FORCE_NO_IBUF_MERGE
prevent also ibuf operations: if they would cause a crash, better not do them
Definition: srv0srv.h:879
SRV_STATS_NULLS_UNEQUAL
@ SRV_STATS_NULLS_UNEQUAL
Definition: srv0srv.h:896
srv_stats_t::log_writes
ulint_ctr_1_t log_writes
Number of physical writes to the log performed.
Definition: srv0srv.h:84
Srv_cpu_usage::stime_pct
double stime_pct
Definition: srv0srv.h:272
high_level_read_only
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:190
srv_log_write_events
ulong srv_log_write_events
Number of events used for notifications about redo write.
Definition: srv0srv.cc:269
SRV_UNIX_LITTLESYNC
@ SRV_UNIX_LITTLESYNC
do not call os_file_flush() when writing data files, but do flush after writing to log files
Definition: srv0srv.h:825
srv_adaptive_max_sleep_delay
ulong srv_adaptive_max_sleep_delay
Maximum sleep delay (in micro-seconds), value of 0 disables it.
Definition: srv0conc.cc:62
srv_master_thread_is_active
bool srv_master_thread_is_active()
Check whether the master thread is active.
Definition: srv0srv.cc:1852
srv_flush_sync
bool srv_flush_sync
Definition: srv0srv.cc:371
recv_writer_thread_key
mysql_pfs_key_t recv_writer_thread_key
srv_log_group_home_dir
char * srv_log_group_home_dir
Definition: srv0srv.cc:220
srv_stats_t::log_waits
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:94
srv_stats_t::n_system_rows_updated
ulint_ctr_64_t n_system_rows_updated
Number of system rows updated.
Definition: srv0srv.h:147
Log_DDL
Class to write and replay ddl logs.
Definition: log0ddl.h:393
export_var_t::innodb_data_written
ulint innodb_data_written
Data bytes written.
Definition: srv0srv.h:1085
io_write_thread_key
mysql_pfs_key_t io_write_thread_key
srv_log_write_ahead_size
ulong srv_log_write_ahead_size
Size of block, used for writing ahead to avoid read-on-write.
Definition: srv0srv.h:538
srv_log_closer_timeout
ulong srv_log_closer_timeout
Initial sleep used in log closer after spin delay is finished.
Definition: srv0srv.cc:344
log0types.h
srv_stats_method_name_enum
srv_stats_method_name_enum
Definition: srv0srv.h:892
srv_stage_alter_table_insert
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:777
srv_max_io_capacity
ulong srv_max_io_capacity
Definition: srv0srv.cc:453
srv_log_recent_closed_size
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:282
srv_slot_t::type
srv_thread_type type
Thread type: user, utility etc.
Definition: srv0srv.h:1166
undo_spaces_init
void undo_spaces_init()
Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start().
Definition: srv0start.cc:1479
os0file.h
clone_gtid_thread_key
mysql_pfs_key_t clone_gtid_thread_key
SRV_UNIX_FSYNC
@ SRV_UNIX_FSYNC
fsync, the default
Definition: srv0srv.h:823
SRV_UNIX_O_DSYNC
@ SRV_UNIX_O_DSYNC
open log files in O_SYNC mode
Definition: srv0srv.h:824
SRV_WORKER
@ SRV_WORKER
threads serving parallelized queries and queries released from lock wait
Definition: srv0srv.h:911
undo_spaces_deinit
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:1491
srv_flush_log_at_trx_commit
ulong srv_flush_log_at_trx_commit
Definition: srv0srv.cc:359
srv_log_flusher_timeout
ulong srv_log_flusher_timeout
Initial timeout used to wait on flusher_event.
Definition: srv0srv.cc:319
srv_doublewrite_batch_size
ulong srv_doublewrite_batch_size
doublewrite buffer is 1MB is size i.e.
Definition: srv0srv.cc:546
srv_upgrade_old_undo_found
bool srv_upgrade_old_undo_found
export_var_t::innodb_purge_view_trx_id_age
ulint innodb_purge_view_trx_id_age
rw_max_trx_no
Definition: srv0srv.h:1154
srv_buf_pool_instances_default
const ulong srv_buf_pool_instances_default
Default number of buffer pool instances.
Definition: srv0srv.cc:406
srv_force_recovery
ulong srv_force_recovery
Normally 0.
Definition: srv0srv.cc:495
srv_monitor_thread_key
mysql_pfs_key_t srv_monitor_thread_key
log_flusher_thread_key
mysql_pfs_key_t log_flusher_thread_key
srv_disable_sort_file_cache
bool srv_disable_sort_file_cache
Definition: row0merge.cc:70
srv_adaptive_flushing
bool srv_adaptive_flushing
Definition: srv0srv.cc:368
srv_printf_innodb_monitor
ibool srv_printf_innodb_monitor(FILE *file, ibool nowait, ulint *trx_start, ulint *trx_end)
Outputs to a file the output of the InnoDB Monitor.
Definition: srv0srv.cc:1271
fts_optimize_thread_key
mysql_pfs_key_t fts_optimize_thread_key
srv_downgrade_partition_files
bool srv_downgrade_partition_files
Definition: srv0srv.cc:111
export_var_t::innodb_data_pending_writes
ulint innodb_data_pending_writes
Pending writes.
Definition: srv0srv.h:1080
srv_stats_t::buf_pool_reads
ulint_ctr_1_t buf_pool_reads
Number of buffer pool reads that led to the reading of a disk page.
Definition: srv0srv.h:117
srv_master_thread_disabled_debug_update
void srv_master_thread_disabled_debug_update(THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
Disables master thread.
Definition: srv0srv.cc:2005
uint
unsigned int uint
Definition: uca-dump.cc:29
PSI_stage_info_v1
Stage instrument information.
Definition: psi_stage_bits.h:71
srv_buf_pool_chunk_unit_blk_sz
const ulonglong srv_buf_pool_chunk_unit_blk_sz
The buffer pool chunk size must be a multiple of this number.
Definition: srv0srv.cc:399
srv_undo_log_encrypt
bool srv_undo_log_encrypt
Enable or disable Encrypt of UNDO tablespace.
Definition: srv0srv.cc:166
export_var_t::innodb_row_lock_time_max
ulint innodb_row_lock_time_max
srv_n_lock_max_wait_time / 1000
Definition: srv0srv.h:1130
Srv_threads::m_purge_workers_n
size_t m_purge_workers_n
Number of purge workers and size of array below.
Definition: srv0srv.h:220
clone_ddl_thread_key
mysql_pfs_key_t clone_ddl_thread_key
srv_error_monitor_thread_key
mysql_pfs_key_t srv_error_monitor_thread_key
srv_innodb_status
ibool srv_innodb_status
Definition: srv0srv.cc:526
srv_innodb_directories
char * srv_innodb_directories
Definition: srv0srv.cc:131
srv_undo_dir
char * srv_undo_dir
Server undo tablespaces directory, can be absolute path.
Definition: srv0srv.cc:135
srv_stage_alter_table_merge_sort
PSI_stage_info srv_stage_alter_table_merge_sort
Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().
Definition: srv0srv.cc:794
Srv_threads::m_gtid_persister
IB_thread m_gtid_persister
Thread for GTID persistence.
Definition: srv0srv.h:246
export_var_t::innodb_undo_tablespaces_active
ulint innodb_undo_tablespaces_active
number of active undo tablespaces
Definition: srv0srv.h:1150
page_archiver_thread_key
mysql_pfs_key_t page_archiver_thread_key
srv_change_buffer_max_size
uint srv_change_buffer_max_size
Maximum on-disk size of change buffer in terms of percentage of the buffer pool.
Definition: srv0srv.cc:441
trx_recovery_rollback_thread_key
mysql_pfs_key_t trx_recovery_rollback_thread_key
srv_stats_t::dblwr_writes
ulint_ctr_1_t dblwr_writes
Count the number of times the doublewrite buffer was flushed.
Definition: srv0srv.h:97
srv_buf_pool_base_size
ulint srv_buf_pool_base_size
Current size as scaling factor for the other components.
Definition: srv0srv.cc:416
srv_free
void srv_free(void)
Frees the data structures created in srv_init().
Definition: srv0srv.cc:1161
srv_slot_t::suspend_time
ib_time_monotonic_t suspend_time
Time when the thread was suspended.
Definition: srv0srv.h:1176
export_var_t::innodb_buffer_pool_pages_data
ulint innodb_buffer_pool_pages_data
Data pages.
Definition: srv0srv.h:1093
srv_inc_activity_count
void srv_inc_activity_count(void)
Increment the server activity counter.
Definition: srv0srv.cc:1843
fts_parallel_merge_thread_key
mysql_pfs_key_t fts_parallel_merge_thread_key
Srv_threads::m_recv_writer
IB_thread m_recv_writer
Thread writing recovered pages during recovery.
Definition: srv0srv.h:214
mysql_pfs_key_t
Define for performance schema registration key.
Definition: sync0sync.h:50
srv_max_buf_pool_modified_pct
double srv_max_buf_pool_modified_pct
Definition: srv0srv.cc:463
export_var_t::innodb_num_open_files
ulint innodb_num_open_files
fil_n_file_opened
Definition: srv0srv.h:1142
srv_stage_buffer_pool_load
PSI_stage_info srv_stage_buffer_pool_load
Performance schema stage event for monitoring buffer pool load progress.
Definition: srv0srv.cc:810
export_var_t::innodb_buffer_pool_resize_status
char innodb_buffer_pool_resize_status[512]
Buf pool resize status.
Definition: srv0srv.h:1091
Srv_cpu_usage
Definition: srv0srv.h:267
trx0types.h
SRV_FORCE_NO_TRX_UNDO
@ SRV_FORCE_NO_TRX_UNDO
do not run trx rollback after recovery
Definition: srv0srv.h:877
srv_log_write_notifier_timeout
ulong srv_log_write_notifier_timeout
Initial timeout used to wait on write_notifier_event.
Definition: srv0srv.cc:327
srv_n_file_io_threads
ulint srv_n_file_io_threads
Number of IO threads to use.
Definition: srv0start.cc:134
export_var_t::innodb_buffer_pool_reads
ulint innodb_buffer_pool_reads
srv_buf_pool_reads
Definition: srv0srv.h:1103
page_flush_thread_key
mysql_pfs_key_t page_flush_thread_key
srv_export_innodb_status
void srv_export_innodb_status(void)
Function to pass InnoDB status variables to MySQL.
Definition: srv0srv.cc:1503
srv0conc.h
srv_flushing_avg_loops
ulong srv_flushing_avg_loops
Definition: srv0srv.cc:471
Srv_threads::m_monitor
IB_thread m_monitor
Monitor thread (prints info).
Definition: srv0srv.h:166
log_closer_thread_key
mysql_pfs_key_t log_closer_thread_key
srv_cpu_usage
Srv_cpu_usage srv_cpu_usage
Structure with cpu usage information.
Definition: srv0srv.cc:100
srv_stats_t::n_system_rows_read
ulint_ctr_64_t n_system_rows_read
Number of system rows read.
Definition: srv0srv.h:144
srv_stage_alter_table_flush
PSI_stage_info srv_stage_alter_table_flush
Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint().
Definition: srv0srv.cc:772
srv_max_purge_lag_delay
ulong srv_max_purge_lag_delay
Max DML user threads delay in micro-seconds.
Definition: trx0purge.cc:69
consts::FILE
const std::string FILE("FILE")
export_var_t::innodb_page_size
ulint innodb_page_size
UNIV_PAGE_SIZE.
Definition: srv0srv.h:1119
export_var_t::innodb_buffer_pool_pages_free
ulint innodb_buffer_pool_pages_free
Free pages.
Definition: srv0srv.h:1098
srv_boot
void srv_boot(void)
Boots Innobase server.
Definition: srv0srv.cc:1229
srv_reset_io_thread_op_info
void srv_reset_io_thread_op_info()
Resets the info describing an i/o thread current state.
Definition: srv0srv.cc:850
srv_worker_thread
void srv_worker_thread()
Worker thread that reads tasks from the work queue and executes them.
Definition: srv0srv.cc:2782
export_var_t::innodb_buffer_pool_bytes_dirty
ulint innodb_buffer_pool_bytes_dirty
File bytes modified.
Definition: srv0srv.h:1096
srv_spin_wait_delay
ulong srv_spin_wait_delay
Definition: ut0mutex.h:110
export_var_t::innodb_data_fsyncs
ulint innodb_data_fsyncs
Number of fsyncs so far.
Definition: srv0srv.h:1082
srv_buf_dump_filename
char * srv_buf_dump_filename
The buffer pool dump/load file name.
Definition: srv0srv.cc:751
srv_stats_method_name_t
enum srv_stats_method_name_enum srv_stats_method_name_t
Definition: srv0srv.h:901
SRV_FORCE_NO_UNDO_LOG_SCAN
@ 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:882
Srv_threads::m_lock_wait_timeout
IB_thread m_lock_wait_timeout
Thread detecting lock wait timeouts.
Definition: srv0srv.h:202
export_var_t::innodb_log_write_requests
ulint innodb_log_write_requests
srv_log_write_requests
Definition: srv0srv.h:1113
Srv_threads::m_buf_dump
IB_thread m_buf_dump
Buffer pool dump thread.
Definition: srv0srv.h:193
IB_thread
Definition: os0thread.h:41
parallel_read_thread_key
mysql_pfs_key_t parallel_read_thread_key
export_var_t
Status variables to be passed to MySQL.
Definition: srv0srv.h:1078
Srv_threads::m_error_monitor
IB_thread m_error_monitor
Error monitor thread.
Definition: srv0srv.h:169
srv_stage_alter_table_end
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:767
page_flush_coordinator_thread_key
mysql_pfs_key_t page_flush_coordinator_thread_key
srv_replication_delay
ulong srv_replication_delay
Definition: srv0srv.cc:548
srv_buf_pool_max_size
const longlong srv_buf_pool_max_size
Maximum pool size in bytes.
Definition: srv0srv.cc:392
srv_thread_delay_cleanup_if_needed
void srv_thread_delay_cleanup_if_needed(bool wait_for_signal)
Delay the thread after it discovered that the shutdown_state is greater or equal to SRV_SHUTDOWN_CLEA...
Definition: srv0start.cc:3436
export_var_t::innodb_log_waits
ulint innodb_log_waits
srv_log_waits
Definition: srv0srv.h:1112
export_var_t::innodb_rows_read
ulint innodb_rows_read
srv_n_rows_read
Definition: srv0srv.h:1132
srv_max_undo_tablespace_size
unsigned long long srv_max_undo_tablespace_size
Maximum size of undo tablespace.
Definition: srv0srv.cc:169
srv_idle_flush_pct_default
const ulong srv_idle_flush_pct_default
Default value of srv_idle_flush_pct.
Definition: srv0srv.cc:424
srv_set_io_thread_op_info
void srv_set_io_thread_op_info(ulint i, const char *str)
Sets the info describing an i/o thread current state.
Definition: srv0srv.cc:839
srv_lock_table_size
ulint srv_lock_table_size
Lock table size in bytes.
Definition: srv0srv.cc:422
Srv_threads::m_ts_alter_encrypt
IB_thread m_ts_alter_encrypt
The ts_alter_encrypt thread.
Definition: srv0srv.h:208
export_var_t::innodb_buffer_pool_pages_total
ulint innodb_buffer_pool_pages_total
Buffer pool size.
Definition: srv0srv.h:1092
srv_buf_pool_min_size
const ulint srv_buf_pool_min_size
Minimum pool size in bytes.
Definition: srv0srv.cc:388
srv_ts_alter_encrypt_thread_key
mysql_pfs_key_t srv_ts_alter_encrypt_thread_key
srv_stats_t::lint_ctr_1_t
ib_counter_t< lint, 1, single_indexer_t > lint_ctr_1_t
Definition: srv0srv.h:74
srv_lock_timeout_thread_key
mysql_pfs_key_t srv_lock_timeout_thread_key
srv_numa_interleave
bool srv_numa_interleave
Definition: srv0srv.cc:204
srv_use_native_aio
bool srv_use_native_aio
Definition: srv0srv.cc:202
srv_read_only_mode
bool srv_read_only_mode
Set if InnoDB must operate in read-only mode.
Definition: srv0srv.cc:178
srv_slot_t::suspended
bool suspended
TRUE if the thread is waiting for the event of this slot.
Definition: srv0srv.h:1172
srv_stats_t
Definition: srv0srv.h:70
os0event.h
srv_stats_t::int64_ctr_1_t
ib_counter_t< int64_t, 1, single_indexer_t > int64_ctr_1_t
Definition: srv0srv.h:75
srv_n_free_tickets_to_enter
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
log0ddl.h
srv_check_activity
ibool srv_check_activity(ulint old_activity_count)
Check if there has been any activity.
Definition: srv0srv.cc:1922
Srv_cpu_usage::utime_abs
double utime_abs
Definition: srv0srv.h:269
srv_print_innodb_lock_monitor
bool srv_print_innodb_lock_monitor
Definition: srv0srv.cc:570
srv_print_all_deadlocks
bool srv_print_all_deadlocks
Print all user-level transactions deadlocks to mysqld stderr.
Definition: srv0srv.cc:503
srv_priority_boost
ibool srv_priority_boost
Definition: srv0srv.cc:553
export_var_t::innodb_pages_read
ulint innodb_pages_read
buf_pool->stat.n_pages_read
Definition: srv0srv.h:1121
srv_thread_sleep_delay
ulong srv_thread_sleep_delay
Sleep delay for threads waiting to enter InnoDB.
Definition: srv0srv.h:674
srv_max_n_open_files
ulint srv_max_n_open_files
Definition: srv0srv.cc:449
parallel_read_ahead_thread_key
mysql_pfs_key_t parallel_read_ahead_thread_key
srv_idle_flush_pct
ulong srv_idle_flush_pct
How much flush to be done in case of server is idle.
Definition: srv0srv.cc:425
log_archiver_thread_key
mysql_pfs_key_t log_archiver_thread_key
srv_monitor_file_mutex
ib_mutex_t srv_monitor_file_mutex
Definition: srv0srv.cc:588
srv_buffer_pool_load_at_startup
bool srv_buffer_pool_load_at_startup
Definition: srv0srv.cc:756
srv_main_thread_op_info
const char * srv_main_thread_op_info
Definition: srv0srv.cc:120
srv_buf_pool_def_size
const ulint srv_buf_pool_def_size
Default pool size in bytes.
Definition: srv0srv.cc:390
srv_dedicated_server
bool srv_dedicated_server
Dedicated server setting.
Definition: srv0srv.cc:384
export_var_t::innodb_buffer_pool_write_requests
ulint innodb_buffer_pool_write_requests
srv_buf_pool_write_requests
Definition: srv0srv.h:1106
srv_print_ddl_logs
bool srv_print_ddl_logs
Print all DDL logs to mysqld stderr.
Definition: srv0srv.cc:506
srv_n_write_io_threads
ulong srv_n_write_io_threads
Definition: srv0srv.cc:430
Srv_threads::m_page_cleaner_workers
IB_thread * m_page_cleaner_workers
Page cleaner workers.
Definition: srv0srv.h:234
export_var_t::innodb_purge_trx_id_age
ulint innodb_purge_trx_id_age
rw_max_trx_no - purged trx_no
Definition: srv0srv.h:1153
srv_cmp_per_index_enabled
bool srv_cmp_per_index_enabled
Enable INFORMATION_SCHEMA.innodb_cmp_per_index.
Definition: srv0srv.cc:509
srv_get_task_queue_length
ulint srv_get_task_queue_length(void)
Get count of tasks in the queue.
Definition: srv0srv.cc:3150
SRV_PURGE
@ SRV_PURGE
Purge coordinator thread.
Definition: srv0srv.h:914
export_var_t::innodb_buffer_pool_read_requests
ulint innodb_buffer_pool_read_requests
buf_pool->stat.n_page_gets
Definition: srv0srv.h:1102
HttpMethod::type
int type
Definition: http_common.h:411
Srv_threads::m_log_writer
IB_thread m_log_writer
Redo writer thread.
Definition: srv0srv.h:178
srv_slot_t::reservation_no
uint64_t reservation_no
Stores the current value of lock_wait_table_reservations, when lock_wait_table_reserve_slot is called...
Definition: srv0srv.h:1182
export_var_t::innodb_system_rows_deleted
ulint innodb_system_rows_deleted
srv_n_system_rows_deleted
Definition: srv0srv.h:1139
srv_parallel_read_threads
ulong srv_parallel_read_threads
Number of threads to use for parallel reads.
Definition: srv0srv.cc:193
Srv_threads::m_page_cleaner_workers_n
size_t m_page_cleaner_workers_n
Number of page cleaner workers and size of array below.
Definition: srv0srv.h:230
srv_stage_alter_tablespace_encryption
PSI_stage_info srv_stage_alter_tablespace_encryption
Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress.
Definition: srv0srv.cc:805
export_var_t::innodb_undo_tablespaces_total
ulint innodb_undo_tablespaces_total
total number of undo tablespaces innoDB is tracking.
Definition: srv0srv.h:1144
srv_log_file_size_requested
ulonglong srv_log_file_size_requested
The value of the startup parameter innodb_log_file_size.
Definition: srv0srv.cc:240
srv_n_spin_wait_rounds
ulong srv_n_spin_wait_rounds
Definition: ut0mutex.h:111
srv_stats_t::buf_pool_wait_free
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:109
io_handler_thread_key
mysql_pfs_key_t io_handler_thread_key
srv_io_thread_op_info
const char * srv_io_thread_op_info[]
Definition: srv0srv.cc:575
srv_slot_t::wait_timeout
ulong wait_timeout
Wait time that if exceeded the thread will be timed out.
Definition: srv0srv.h:1186
srv_force_recovery_crash
ulong srv_force_recovery_crash
Inject a crash at different steps of the recovery process.
Definition: srv0srv.cc:499
export_var_t::innodb_data_reads
ulint innodb_data_reads
I/O read requests.
Definition: srv0srv.h:1086
srv_fatal_semaphore_wait_threshold
ulong srv_fatal_semaphore_wait_threshold
Definition: srv0srv.cc:114
fil0fil.h
Srv_threads::m_purge_coordinator
IB_thread m_purge_coordinator
Purge coordinator (also being a worker)
Definition: srv0srv.h:217
srv_worker_thread_key
mysql_pfs_key_t srv_worker_thread_key
srv_buf_pool_old_size
ulint srv_buf_pool_old_size
Previously requested size.
Definition: srv0srv.cc:414
srv_log_file_size
ulonglong srv_log_file_size
At startup, this is the current redo log file size.
Definition: srv0srv.cc:237
srv_slot_t::in_use
bool in_use
TRUE if this slot is in use.
Definition: srv0srv.h:1169
SRV_FORCE_NO_BACKGROUND
@ SRV_FORCE_NO_BACKGROUND
prevent the main thread from running: if a crash would occur in purge, this prevents it
Definition: srv0srv.h:874
space_id_t
uint32 space_id_t
Tablespace identifier.
Definition: api0api.h:59
Srv_threads::m_trx_recovery_rollback
IB_thread m_trx_recovery_rollback
Thread doing rollbacks during recovery.
Definition: srv0srv.h:211
srv_is_upgrade_mode
bool srv_is_upgrade_mode
srv_fast_shutdown
ulong srv_fast_shutdown
The value of the configuration parameter innodb_fast_shutdown, controlling the InnoDB shutdown.
Definition: srv0srv.cc:523
srv_purge_rseg_truncate_frequency
ulong srv_purge_rseg_truncate_frequency
Rate at which UNDO records should be purged.
Definition: srv0srv.cc:155
ulong
unsigned long ulong
Definition: my_inttypes.h:48
export_var_t::innodb_undo_tablespaces_explicit
ulint innodb_undo_tablespaces_explicit
number of undo tablespaces the dba created explicitly.
Definition: srv0srv.h:1148
buf0checksum.h
srv_log_flush_notifier_timeout
ulong srv_log_flush_notifier_timeout
Initial timeout used to wait on flush_notifier_event.
Definition: srv0srv.cc:336
mysql_stage.h
export_var_t::innodb_buffer_pool_read_ahead
ulint innodb_buffer_pool_read_ahead
srv_read_ahead
Definition: srv0srv.h:1108
ulonglong
unsigned long long int ulonglong
Definition: my_inttypes.h:55
export_var_t::innodb_os_log_pending_writes
ulint innodb_os_log_pending_writes
srv_os_log_pending_writes
Definition: srv0srv.h:1117
OS_FILE_MAX_PATH
#define OS_FILE_MAX_PATH
Definition: os0file.h:856
export_var_t::innodb_buffer_pool_read_ahead_evicted
ulint innodb_buffer_pool_read_ahead_evicted
srv_read_ahead evicted
Definition: srv0srv.h:1109
srv_log_buffer_size
ulong srv_log_buffer_size
Space for log buffer, expressed in bytes.
Definition: srv0srv.cc:245
srv_stage_clone_file_copy
PSI_stage_info srv_stage_clone_file_copy
Performance schema stage event for monitoring clone file copy progress.
Definition: srv0srv.cc:815
export_var_t::innodb_buffer_pool_pages_misc
ulint innodb_buffer_pool_pages_misc
Miscellanous pages.
Definition: srv0srv.h:1097
srv_log_wait_for_flush_timeout
ulong srv_log_wait_for_flush_timeout
Timeout used when waiting for redo flush (microseconds).
Definition: srv0srv.cc:299
srv_buffer_pool_dump_at_shutdown
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:755
export_var_t::innodb_data_pending_reads
ulint innodb_data_pending_reads
Pending reads.
Definition: srv0srv.h:1079
srv_n_read_io_threads
ulong srv_n_read_io_threads
Definition: srv0srv.cc:429
srv_master_thread
void srv_master_thread()
The master thread controlling the server.
Definition: srv0srv.cc:2637
log_checkpointer_thread_key
mysql_pfs_key_t log_checkpointer_thread_key
srv_slot_t
Thread slot in the thread table.
Definition: srv0srv.h:1164
export_var_t::innodb_dblwr_writes
ulint innodb_dblwr_writes
srv_dblwr_writes
Definition: srv0srv.h:1111
export_var_t::innodb_buffer_pool_bytes_data
ulint innodb_buffer_pool_bytes_data
File bytes used.
Definition: srv0srv.h:1094
srv_log_write_max_size
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:266
n
int n
Definition: xcom_base.c:425
export_var_t::innodb_system_rows_updated
ulint innodb_system_rows_updated
srv_n_system_rows_updated
Definition: srv0srv.h:1138
srv_max_dirty_pages_pct_lwm
double srv_max_dirty_pages_pct_lwm
Definition: srv0srv.cc:464
srv_log_spin_cpu_abs_lwm
uint srv_log_spin_cpu_abs_lwm
Minimum absolute value of cpu time for which spin-delay is used.
Definition: srv0srv.cc:251
srv_log_flush_notifier_spin_delay
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:332
fts_parallel_tokenization_thread_key
mysql_pfs_key_t fts_parallel_tokenization_thread_key
srv_undo_tablespaces
ulong srv_undo_tablespaces
Number of undo tablespaces to use.
Definition: srv0srv.cc:139
srv_stage_alter_table_log_table
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:788
srv_log_checksums
bool srv_log_checksums
Whether to generate and require checksums on the redo log pages.
Definition: srv0srv.cc:349
srv_purge_view_update_only_debug
bool srv_purge_view_update_only_debug
Definition: trx0purge.cc:75
que_thr_t
Definition: que0que.h:246
export_var_t::innodb_buffer_pool_pages_latched
ulint innodb_buffer_pool_pages_latched
Latched pages.
Definition: srv0srv.h:1100
SRV_FORCE_NO_LOG_REDO
@ SRV_FORCE_NO_LOG_REDO
do not do the log roll-forward in connection with recovery
Definition: srv0srv.h:886
srv_log_flusher_spin_delay
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:316
export_var_t::innodb_pages_created
ulint innodb_pages_created
buf_pool->stat.n_pages_created
Definition: srv0srv.h:1120
srv_random_read_ahead
bool srv_random_read_ahead
Definition: srv0srv.cc:433
srv_stats_persistent_sample_pages
unsigned long long srv_stats_persistent_sample_pages
Definition: srv0srv.cc:537
srv_file_per_table
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:182
export_var_t::innodb_undo_tablespaces_implicit
ulint innodb_undo_tablespaces_implicit
number of undo tablespaces innoDB created implicitly.
Definition: srv0srv.h:1146
srv_buf_pool_curr_size
long long srv_buf_pool_curr_size
Current size in bytes.
Definition: srv0srv.cc:418
srv_thread_type
srv_thread_type
Types of threads existing in the system.
Definition: srv0srv.h:909
ib_time_monotonic_t
int64_t ib_time_monotonic_t
Time stamp read from the monotonic clock (returned by ut_time_monotonic()).
Definition: ut0ut.h:89
srv_sort_buf_size
ulong srv_sort_buf_size
Sort buffer size in index creation.
Definition: srv0srv.cc:185
srv_misc_tmpfile
FILE * srv_misc_tmpfile
Temporary file for miscellanous diagnostic output.
Definition: srv0srv.cc:597
srv_stats_t::data_read
ulint_ctr_1_t data_read
Number of data read in total (in bytes)
Definition: srv0srv.h:120
srv_monitor_file
FILE * srv_monitor_file
Temporary file for innodb monitor output.
Definition: srv0srv.cc:591
srv_n_purge_threads
ulong srv_n_purge_threads
Definition: srv0srv.cc:474
srv_stage_alter_table_read_pk_internal_sort
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:799
srv_buf_pool_dump_pct
ulong srv_buf_pool_dump_pct
Dump this % of each buffer pool during BP dump.
Definition: srv0srv.cc:420
srv_log_wait_for_flush_spin_hwm
ulong srv_log_wait_for_flush_spin_hwm
Maximum value of average log flush time for which spin-delay is used.
Definition: srv0srv.cc:259
Srv_threads::m_log_checkpointer
IB_thread m_log_checkpointer
Redo checkpointer thread.
Definition: srv0srv.h:175
srv_innodb_stats_method
ulong srv_innodb_stats_method
Definition: srv0srv.cc:482
export_var_t::innodb_data_writes
ulint innodb_data_writes
I/O write requests.
Definition: srv0srv.h:1084
srv_stats_t::n_sampled_pages_skipped
ulint_ctr_64_t n_sampled_pages_skipped
Number of sampled pages skipped.
Definition: srv0srv.h:159
Srv_threads::m_log_archiver
IB_thread m_log_archiver
Archiver's log archiver (used by Clone).
Definition: srv0srv.h:237
srv_get_activity_count
ulint srv_get_activity_count(void)
Get current server activity count.
Definition: srv0srv.cc:1918
srv_stats_persistent
bool srv_stats_persistent
Definition: srv0srv.cc:535
srv_stats_t::n_rows_updated
ulint_ctr_64_t n_rows_updated
Number of rows updated.
Definition: srv0srv.h:135
srv_slot_t::event
os_event_t event
Event used in suspending the thread when it has nothing to do.
Definition: srv0srv.h:1189
srv_purge_batch_size
ulong srv_purge_batch_size
Definition: srv0srv.cc:477
SRV_NONE
@ SRV_NONE
None.
Definition: srv0srv.h:910
export_var_t::innodb_rows_inserted
ulint innodb_rows_inserted
srv_n_rows_inserted
Definition: srv0srv.h:1133
ut0counter.h
export_var_t::innodb_row_lock_time
int64_t innodb_row_lock_time
srv_n_lock_wait_time / 1000
Definition: srv0srv.h:1125
srv_master_thread_key
mysql_pfs_key_t srv_master_thread_key
srv_release_threads
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:992
export_vars
struct export_var_t export_vars
Status variables to be passed to MySQL.
Definition: srv0srv.cc:489
ib_counter_t< ulint, 64 >
srv_stats
srv_stats_t srv_stats
Global counters.
Definition: srv0srv.cc:485
srv_buf_pool_size
ulint srv_buf_pool_size
Requested size in bytes.
Definition: srv0srv.cc:386
srv_stats_t::os_log_written
lsn_ctr_1_t os_log_written
Amount of data written to the log files in bytes.
Definition: srv0srv.h:87
export_var_t::innodb_log_writes
ulint innodb_log_writes
srv_log_writes
Definition: srv0srv.h:1114
SRV_UNIX_O_DIRECT_NO_FSYNC
@ SRV_UNIX_O_DIRECT_NO_FSYNC
do not use fsync() when using direct IO i.e.
Definition: srv0srv.h:835
srv_checkpoint_disabled
bool srv_checkpoint_disabled
If true then disable checkpointing.
Definition: srv0srv.cc:353