diff options
author | Michael Widenius <monty@askmonty.org> | 2012-08-01 17:27:34 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-08-01 17:27:34 +0300 |
commit | 1d0f70c2f894b27e98773a282871d32802f67964 (patch) | |
tree | 833e683e0ced29c4323c29a9d845703d4dfcd81b /storage/innobase/include/srv0srv.h | |
parent | 5a86a61219826aadf8d08cbc447fe438f2bf50c3 (diff) | |
download | mariadb-git-1d0f70c2f894b27e98773a282871d32802f67964.tar.gz |
Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6
Diffstat (limited to 'storage/innobase/include/srv0srv.h')
-rw-r--r-- | storage/innobase/include/srv0srv.h | 453 |
1 files changed, 246 insertions, 207 deletions
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index ed2f4672a99..99cff251e3c 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2011, Innobase Oy. All Rights Reserved. +Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, 2009, Google Inc. Copyright (c) 2009, Percona Inc. @@ -26,8 +26,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ @@ -43,15 +43,18 @@ Created 10/10/1995 Heikki Tuuri #include "univ.i" #ifndef UNIV_HOTBACKUP +#include "log0log.h" #include "sync0sync.h" #include "os0sync.h" #include "que0types.h" #include "trx0types.h" +#include "srv0conc.h" +#include "buf0checksum.h" extern const char* srv_main_thread_op_info; /** Prefix used by MySQL to indicate pre-5.1 table name encoding */ -extern const char srv_mysql50_table_name_prefix[9]; +extern const char srv_mysql50_table_name_prefix[10]; /* When this event is set the lock timeout and InnoDB monitor thread starts running */ @@ -66,6 +69,21 @@ extern os_event_t srv_timeout_event; /* The error monitor thread waits on this event. */ extern os_event_t srv_error_event; +/** The buffer pool dump/load thread waits on this event. */ +extern os_event_t srv_buf_dump_event; + +/** The buffer pool dump/load file name */ +#define SRV_BUF_DUMP_FILENAME_DEFAULT "ib_buffer_pool" +extern char* srv_buf_dump_filename; + +/** Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown +and/or load it during startup. */ +extern char srv_buffer_pool_dump_at_shutdown; +extern char srv_buffer_pool_load_at_startup; + +/* Whether to disable file system cache if it is defined */ +extern char srv_disable_sort_file_cache; + /* If the last data file is auto-extended, we add this many pages to it at a time */ #define SRV_AUTO_EXTEND_INCREMENT \ @@ -91,27 +109,33 @@ extern FILE* srv_misc_tmpfile; /* Server parameters which are read from the initfile */ extern char* srv_data_home; + #ifdef UNIV_LOG_ARCHIVE extern char* srv_arch_dir; #endif /* UNIV_LOG_ARCHIVE */ /** store to its own file each table created by an user; data dictionary tables are in the system tablespace 0 */ -#ifndef UNIV_HOTBACKUP extern my_bool srv_file_per_table; -#else -extern ibool srv_file_per_table; -#endif /* UNIV_HOTBACKUP */ +/** Sleep delay for threads waiting to enter InnoDB. In micro-seconds. */ +extern ulong srv_thread_sleep_delay; +#if defined(HAVE_ATOMIC_BUILTINS) +/** Maximum sleep delay (in micro-seconds), value of 0 disables it.*/ +extern ulong srv_adaptive_max_sleep_delay; +#endif /* HAVE_ATOMIC_BUILTINS */ + /** The file format to use on new *.ibd files. */ extern ulint srv_file_format; /** Whether to check file format during startup. A value of -DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to +UNIV_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support. */ extern ulint srv_max_file_format_at_startup; /** Place locks to records only i.e. do not use next-key locking except on duplicate key checking and foreign key checking */ extern ibool srv_locks_unsafe_for_binlog; -#endif /* !UNIV_HOTBACKUP */ + +/* Variable specifying the FTS parallel sort buffer size */ +extern ulong srv_sort_buf_size; /* If this flag is TRUE, then we will use the native aio of the OS (provided we compiled Innobase with it in), otherwise we will @@ -120,7 +144,18 @@ Currently we support native aio on windows and linux */ extern my_bool srv_use_native_aio; #ifdef __WIN__ extern ibool srv_use_native_conditions; -#endif +#endif /* __WIN__ */ +#endif /* !UNIV_HOTBACKUP */ + +/** Server undo tablespaces directory, can be absolute path. */ +extern char* srv_undo_dir; + +/** Number of undo tablespaces to use. */ +extern ulong srv_undo_tablespaces; + +/* The number of undo segments to use */ +extern ulong srv_undo_logs; + extern ulint srv_n_data_files; extern char** srv_data_file_names; extern ulint* srv_data_file_sizes; @@ -136,7 +171,7 @@ extern ibool srv_created_new_raw; extern ulint srv_n_log_groups; extern ulint srv_n_log_files; -extern ulint srv_log_file_size; +extern ib_uint64_t srv_log_file_size; extern ulint srv_log_buffer_size; extern ulong srv_flush_log_at_trx_commit; extern char srv_adaptive_flushing; @@ -156,6 +191,12 @@ extern ibool srv_use_sys_malloc; #endif /* UNIV_HOTBACKUP */ extern ulint srv_buf_pool_size; /*!< requested size in bytes */ extern ulint srv_buf_pool_instances; /*!< requested number of buffer pool instances */ +extern ulong srv_n_page_hash_locks; /*!< number of locks to + protect buf_pool->page_hash */ +extern ulong srv_LRU_scan_depth; /*!< Scan depth for LRU + flush batch */ +extern my_bool srv_flush_neighbors; /*!< whether or not to flush + neighbors of a block */ extern ulint srv_buf_pool_old_size; /*!< previously requested size */ extern ulint srv_buf_pool_curr_size; /*!< current size in bytes */ extern ulint srv_mem_pool_size; @@ -172,7 +213,7 @@ extern ulong srv_io_capacity; /* Returns the number of IO operations that is X percent of the capacity. PCT_IO(5) -> returns the number of IO operations that is 5% of the max where max is srv_io_capacity. */ -#define PCT_IO(p) ((ulong) (srv_io_capacity * ((double) p / 100.0))) +#define PCT_IO(p) ((ulong) (srv_io_capacity * ((double) (p) / 100.0))) /* The "innodb_stats_method" setting, decides how InnoDB is going to treat NULL value when collecting statistics. It is not defined @@ -194,28 +235,26 @@ extern ulint srv_max_n_open_files; extern ulint srv_max_dirty_pages_pct; extern ulint srv_force_recovery; -extern ulong srv_thread_concurrency; - -extern ulint srv_max_n_threads; -extern lint srv_conc_n_threads; - -extern ulint srv_fast_shutdown; /* If this is 1, do not do a - purge and index buffer merge. - If this 2, do not even flush the - buffer pool to data files at the - shutdown: we effectively 'crash' - InnoDB (but lose no committed - transactions). */ +extern ulint srv_fast_shutdown; /*!< If this is 1, do not do a + purge and index buffer merge. + If this 2, do not even flush the + buffer pool to data files at the + shutdown: we effectively 'crash' + InnoDB (but lose no committed + transactions). */ extern ibool srv_innodb_status; -extern unsigned long long srv_stats_sample_pages; +extern unsigned long long srv_stats_transient_sample_pages; +extern unsigned long long srv_stats_persistent_sample_pages; extern ibool srv_use_doublewrite_buf; -extern ibool srv_use_checksums; +extern ulong srv_doublewrite_batch_size; +extern ulong srv_checksum_algorithm; extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_purge_lag; +extern ulong srv_max_purge_lag_delay; extern ulong srv_replication_delay; /*-------------------------------------------*/ @@ -229,19 +268,29 @@ extern ibool srv_print_innodb_monitor; extern ibool srv_print_innodb_lock_monitor; extern ibool srv_print_innodb_tablespace_monitor; extern ibool srv_print_verbose_log; +#define DEPRECATED_MSG_INNODB_TABLE_MONITOR \ + "Using innodb_table_monitor is deprecated and it may be removed " \ + "in future releases. Please use the InnoDB INFORMATION_SCHEMA " \ + "tables instead, see " REFMAN "innodb-i_s-tables.html" extern ibool srv_print_innodb_table_monitor; extern ibool srv_lock_timeout_active; extern ibool srv_monitor_active; extern ibool srv_error_monitor_active; +/* TRUE during the lifetime of the buffer pool dump/load thread */ +extern ibool srv_buf_dump_thread_active; + extern ulong srv_n_spin_wait_rounds; extern ulong srv_n_free_tickets_to_enter; extern ulong srv_thread_sleep_delay; extern ulong srv_spin_wait_delay; extern ibool srv_priority_boost; +extern ulint srv_n_lock_wait_count; + extern ulint srv_truncated_status_writes; +extern ulint srv_available_undo_logs; extern ulint srv_mem_pool_size; extern ulint srv_lock_table_size; @@ -260,16 +309,13 @@ extern ibool srv_print_latch_waits; # define srv_print_latch_waits FALSE #endif /* UNIV_DEBUG */ -extern ulint srv_activity_count; extern ulint srv_fatal_semaphore_wait_threshold; -#define SRV_SEMAPHORE_WAIT_EXTENSION 7200 extern ulint srv_dml_needed_delay; -extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, - query threads, and lock table: we allocate - it from dynamic memory to get it to the - same DRAM page as other hotspot semaphores */ -#define kernel_mutex (*kernel_mutex_temp) +#ifndef HAVE_ATOMIC_BUILTINS +/** Mutex protecting some server global variables. */ +extern mutex_t server_mutex; +#endif /* !HAVE_ATOMIC_BUILTINS */ #define SRV_MAX_N_IO_THREADS 130 @@ -285,7 +331,7 @@ extern ulint srv_log_write_requests; extern ulint srv_log_writes; /* amount of data written to the log files in bytes */ -extern ulint srv_os_log_written; +extern lsn_t srv_os_log_written; /* amount of writes being done to the log files */ extern ulint srv_os_log_pending_writes; @@ -300,8 +346,8 @@ extern ulong srv_n_purge_threads; /* the number of pages to purge in one batch */ extern ulong srv_purge_batch_size; -/* the number of rollback segments to use */ -extern ulong srv_rollback_segments; +/* the number of sync wait arrays */ +extern ulong srv_sync_array_size; /* variable that counts amount of data read in total (in bytes) */ extern ulint srv_data_read; @@ -333,20 +379,24 @@ extern ulint srv_buf_pool_flushed; reading of a disk page */ extern ulint srv_buf_pool_reads; +/* print all user-level transactions deadlocks to mysqld stderr */ +extern my_bool srv_print_all_deadlocks; + /** Status variables to be passed to MySQL */ typedef struct export_var_struct export_struc; -/** Status variables to be passed to MySQL */ -extern export_struc export_vars; +/** Thread slot in the thread table */ +typedef struct srv_slot_struct srv_slot_t; -/** The server system */ -typedef struct srv_sys_struct srv_sys_t; +/** Thread table is an array of slots */ +typedef srv_slot_t srv_table_t; -/** The server system */ -extern srv_sys_t* srv_sys; +/** Status variables to be passed to MySQL */ +extern export_struc export_vars; # ifdef UNIV_PFS_THREAD /* Keys to register InnoDB threads with performance schema */ +extern mysql_pfs_key_t buf_page_cleaner_thread_key; extern mysql_pfs_key_t trx_rollback_clean_thread_key; extern mysql_pfs_key_t io_handler_thread_key; extern mysql_pfs_key_t srv_lock_timeout_thread_key; @@ -359,20 +409,14 @@ extern mysql_pfs_key_t srv_purge_thread_key; schema */ # define pfs_register_thread(key) \ do { \ - if (PSI_server) { \ - struct PSI_thread* psi = PSI_server->new_thread(key, NULL, 0);\ - if (psi) { \ - PSI_server->set_thread(psi); \ - } \ - } \ + struct PSI_thread* psi = PSI_CALL(new_thread)(key, NULL, 0);\ + PSI_CALL(set_thread)(psi); \ } while (0) /* This macro delist the current thread from performance schema */ # define pfs_delete_thread() \ do { \ - if (PSI_server) { \ - PSI_server->delete_current_thread(); \ - } \ + PSI_CALL(delete_current_thread)(); \ } while (0) # endif /* UNIV_PFS_THREAD */ @@ -445,10 +489,13 @@ typedef enum srv_stats_method_name_enum srv_stats_method_name_t; #ifndef UNIV_HOTBACKUP /** Types of threads existing in the system. */ enum srv_thread_type { - SRV_WORKER = 0, /**< threads serving parallelized queries and - queries released from lock wait */ - SRV_MASTER /**< the master thread, (whose type number must - be biggest) */ + SRV_NONE, /*!< None */ + SRV_WORKER, /*!< threads serving parallelized + queries and queries released from + lock wait */ + SRV_PURGE, /*!< Purge coordinator thread */ + SRV_MASTER /*!< the master thread, (whose type + number must be biggest) */ }; /*********************************************************************//** @@ -478,21 +525,6 @@ void srv_general_init(void); /*==================*/ /*********************************************************************//** -Gets the number of threads in the system. -@return sum of srv_n_threads[] */ -UNIV_INTERN -ulint -srv_get_n_threads(void); -/*===================*/ -/*********************************************************************//** -Check whether thread type has reserved a slot. -@return slot number or UNDEFINED if not found*/ -UNIV_INTERN -ulint -srv_thread_has_reserved_slot( -/*=========================*/ - enum srv_thread_type type); /*!< in: thread type to check */ -/*********************************************************************//** Sets the info describing an i/o thread current state. */ UNIV_INTERN void @@ -501,32 +533,16 @@ srv_set_io_thread_op_info( ulint i, /*!< in: the 'segment' of the i/o thread */ const char* str); /*!< in: constant char string describing the state */ -/*********************************************************************//** -Releases threads of the type given from suspension in the thread table. -NOTE! The server mutex has to be reserved by the caller! -@return number of threads released: this may be less than n if not -enough threads were suspended at the moment */ -UNIV_INTERN -ulint -srv_release_threads( -/*================*/ - enum srv_thread_type type, /*!< in: thread type */ - ulint n); /*!< in: number of threads to release */ -/*********************************************************************//** -The master thread controlling the server. -@return a dummy parameter */ -UNIV_INTERN -os_thread_ret_t -srv_master_thread( -/*==============*/ - void* arg); /*!< in: a dummy parameter required by - os_thread_create */ /*******************************************************************//** -Wakes up the purge thread if it's not already awake. */ +Tells the purge thread that there has been activity in the database +and wakes up the purge thread if it is suspended (not sleeping). Note +that there is a small chance that the purge thread stays suspended +(we do not protect our operation with the srv_sys_t:mutex, for +performance reasons). */ UNIV_INTERN void -srv_wake_purge_thread(void); -/*=======================*/ +srv_wake_purge_thread_if_not_active(void); +/*=====================================*/ /*******************************************************************//** Tells the Innobase server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). Used @@ -543,150 +559,159 @@ UNIV_INTERN void srv_wake_master_thread(void); /*========================*/ -/*******************************************************************//** -Tells the purge thread that there has been activity in the database -and wakes up the purge thread if it is suspended (not sleeping). Note -that there is a small chance that the purge thread stays suspended -(we do not protect our operation with the kernel mutex, for -performace reasons). */ +/******************************************************************//** +Outputs to a file the output of the InnoDB Monitor. +@return FALSE if not all information printed +due to failure to obtain necessary mutex */ UNIV_INTERN -void -srv_wake_purge_thread_if_not_active(void); -/*=====================================*/ -/*********************************************************************//** -Puts an OS thread to wait if there are too many concurrent threads -(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */ +ibool +srv_printf_innodb_monitor( +/*======================*/ + FILE* file, /*!< in: output stream */ + ibool nowait, /*!< in: whether to wait for the + lock_sys_t::mutex */ + ulint* trx_start, /*!< out: file position of the start of + the list of active transactions */ + ulint* trx_end); /*!< out: file position of the end of + the list of active transactions */ + +/******************************************************************//** +Function to pass InnoDB status variables to MySQL */ UNIV_INTERN void -srv_conc_enter_innodb( -/*==================*/ - trx_t* trx); /*!< in: transaction object associated with the - thread */ -/*********************************************************************//** -This lets a thread enter InnoDB regardless of the number of threads inside -InnoDB. This must be called when a thread ends a lock wait. */ +srv_export_innodb_status(void); +/*==========================*/ +/*******************************************************************//** +Get current server activity count. We don't hold srv_sys::mutex while +reading this value as it is only used in heuristics. +@return activity count. */ UNIV_INTERN -void -srv_conc_force_enter_innodb( +ulint +srv_get_activity_count(void); /*========================*/ - trx_t* trx); /*!< in: transaction object associated with the - thread */ -/*********************************************************************//** -This must be called when a thread exits InnoDB in a lock wait or at the -end of an SQL statement. */ +/*******************************************************************//** +Check if there has been any activity. +@return FALSE if no change in activity counter. */ UNIV_INTERN -void -srv_conc_force_exit_innodb( -/*=======================*/ - trx_t* trx); /*!< in: transaction object associated with the - thread */ -/*********************************************************************//** -This must be called when a thread exits InnoDB. */ +ibool +srv_check_activity( +/*===============*/ + ulint old_activity_count); /*!< old activity count */ +/******************************************************************//** +Increment the server activity counter. */ UNIV_INTERN void -srv_conc_exit_innodb( -/*=================*/ - trx_t* trx); /*!< in: transaction object associated with the - thread */ -/***************************************************************//** -Puts a MySQL OS thread to wait for a lock to be released. If an error -occurs during the wait trx->error_state associated with thr is -!= DB_SUCCESS when we return. DB_LOCK_WAIT_TIMEOUT and DB_DEADLOCK -are possible errors. DB_DEADLOCK is returned if selective deadlock -resolution chose this transaction as a victim. */ +srv_inc_activity_count(void); +/*=========================*/ + +/**********************************************************************//** +Enqueues a task to server task queue and releases a worker thread, if there +is a suspended one. */ UNIV_INTERN void -srv_suspend_mysql_thread( +srv_que_task_enqueue_low( /*=====================*/ - que_thr_t* thr); /*!< in: query thread associated with the MySQL - OS thread */ -/********************************************************************//** -Releases a MySQL OS thread waiting for a lock to be released, if the -thread is already suspended. */ + que_thr_t* thr); /*!< in: query thread */ + +/**********************************************************************//** +Check whether any background thread is active. If so, return the thread +type. +@return SRV_NONE if all are are suspended or have exited, thread +type if any are still active. */ UNIV_INTERN -void -srv_release_mysql_thread_if_suspended( -/*==================================*/ - que_thr_t* thr); /*!< in: query thread associated with the - MySQL OS thread */ +enum srv_thread_type +srv_get_active_thread_type(void); +/*============================*/ + +extern "C" { + /*********************************************************************//** -A thread which wakes up threads whose lock wait may have lasted too long. +A thread which prints the info output by various InnoDB monitors. @return a dummy parameter */ UNIV_INTERN os_thread_ret_t -srv_lock_timeout_thread( -/*====================*/ +DECLARE_THREAD(srv_monitor_thread)( +/*===============================*/ void* arg); /*!< in: a dummy parameter required by os_thread_create */ + /*********************************************************************//** -A thread which prints the info output by various InnoDB monitors. +The master thread controlling the server. @return a dummy parameter */ UNIV_INTERN os_thread_ret_t -srv_monitor_thread( -/*===============*/ +DECLARE_THREAD(srv_master_thread)( +/*==============================*/ void* arg); /*!< in: a dummy parameter required by os_thread_create */ + /************************************************************************* A thread which prints warnings about semaphore waits which have lasted too long. These can be used to track bugs which cause hangs. @return a dummy parameter */ UNIV_INTERN os_thread_ret_t -srv_error_monitor_thread( -/*=====================*/ +DECLARE_THREAD(srv_error_monitor_thread)( +/*=====================================*/ void* arg); /*!< in: a dummy parameter required by os_thread_create */ -/******************************************************************//** -Outputs to a file the output of the InnoDB Monitor. -@return FALSE if not all information printed -due to failure to obtain necessary mutex */ -UNIV_INTERN -ibool -srv_printf_innodb_monitor( -/*======================*/ - FILE* file, /*!< in: output stream */ - ibool nowait, /*!< in: whether to wait for kernel mutex */ - ulint* trx_start, /*!< out: file position of the start of - the list of active transactions */ - ulint* trx_end); /*!< out: file position of the end of - the list of active transactions */ -/******************************************************************//** -Function to pass InnoDB status variables to MySQL */ +/*********************************************************************//** +Purge coordinator thread that schedules the purge tasks. +@return a dummy parameter */ UNIV_INTERN -void -srv_export_innodb_status(void); -/*==========================*/ +os_thread_ret_t +DECLARE_THREAD(srv_purge_coordinator_thread)( +/*=========================================*/ + void* arg __attribute__((unused))); /*!< in: a dummy parameter + required by os_thread_create */ /*********************************************************************//** -Asynchronous purge thread. +Worker thread that reads tasks from the work queue and executes them. @return a dummy parameter */ UNIV_INTERN os_thread_ret_t -srv_purge_thread( -/*=============*/ - void* arg __attribute__((unused))); /*!< in: a dummy parameter - required by os_thread_create */ +DECLARE_THREAD(srv_worker_thread)( +/*==============================*/ + void* arg __attribute__((unused))); /*!< in: a dummy parameter + required by os_thread_create */ +} /* extern "C" */ /**********************************************************************//** -Enqueues a task to server task queue and releases a worker thread, if there -is a suspended one. */ +Get count of tasks in the queue. +@return number of tasks in queue */ UNIV_INTERN -void -srv_que_task_enqueue_low( -/*=====================*/ - que_thr_t* thr); /*!< in: query thread */ +ulint +srv_get_task_queue_length(void); +/*===========================*/ -/**********************************************************************//** -Check whether any background thread is active. If so, return the thread -type. -@return ULINT_UNDEFINED if all are are suspended or have exited, thread -type if any are still active. */ +/*********************************************************************//** +Releases threads of the type given from suspension in the thread table. +NOTE! The server mutex has to be reserved by the caller! +@return number of threads released: this may be less than n if not +enough threads were suspended at the moment */ UNIV_INTERN ulint -srv_get_active_thread_type(void); -/*============================*/ +srv_release_threads( +/*================*/ + enum srv_thread_type type, /*!< in: thread type */ + ulint n); /*!< in: number of threads to release */ + +/**********************************************************************//** +Check whether any background thread are active. If so print which thread +is active. Send the threads wakeup signal. +@return name of thread that is active or NULL */ +UNIV_INTERN +const char* +srv_any_background_threads_are_active(void); +/*=======================================*/ + +/**********************************************************************//** +Wakeup the purge threads. */ +UNIV_INTERN +void +srv_purge_wakeup(void); +/*==================*/ /** Status variables to be passed to MySQL */ struct export_var_struct{ @@ -698,6 +723,8 @@ struct export_var_struct{ ulint innodb_data_writes; /*!< I/O write requests */ ulint innodb_data_written; /*!< Data bytes written */ ulint innodb_data_reads; /*!< I/O read requests */ + char innodb_buffer_pool_dump_status[512];/*!< Buf pool dump status */ + char innodb_buffer_pool_load_status[512];/*!< Buf pool load status */ ulint innodb_buffer_pool_pages_total; /*!< Buffer pool size */ ulint innodb_buffer_pool_pages_data; /*!< Data pages */ ulint innodb_buffer_pool_pages_dirty; /*!< Dirty data pages */ @@ -720,7 +747,7 @@ struct export_var_struct{ ulint innodb_log_waits; /*!< srv_log_waits */ ulint innodb_log_write_requests; /*!< srv_log_write_requests */ ulint innodb_log_writes; /*!< srv_log_writes */ - ulint innodb_os_log_written; /*!< srv_os_log_written */ + lsn_t innodb_os_log_written; /*!< srv_os_log_written */ ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */ ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */ ulint innodb_os_log_pending_fsyncs; /*!< fil_n_pending_log_flushes */ @@ -741,26 +768,38 @@ struct export_var_struct{ ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */ ulint innodb_rows_updated; /*!< srv_n_rows_updated */ ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */ + ulint innodb_num_open_files; /*!< fil_n_file_opened */ ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */ + ulint innodb_available_undo_logs; /*!< srv_available_undo_logs */ }; -/** Thread slot in the thread table */ -typedef struct srv_slot_struct srv_slot_t; - -/** Thread table is an array of slots */ -typedef srv_slot_t srv_table_t; - -/** The server system struct */ -struct srv_sys_struct{ - srv_table_t* threads; /*!< server thread table */ - UT_LIST_BASE_NODE_T(que_thr_t) - tasks; /*!< task queue */ +/** Thread slot in the thread table. */ +struct srv_slot_struct{ + srv_thread_type type; /*!< thread type: user, + utility etc. */ + ibool in_use; /*!< TRUE if this slot + is in use */ + ibool suspended; /*!< TRUE if the thread is + waiting for the event of this + slot */ + ib_time_t suspend_time; /*!< time when the thread was + suspended. Initialized by + lock_wait_table_reserve_slot() + for lock wait */ + ulong wait_timeout; /*!< wait time that if exceeded + the thread will be timed out. + Initialized by + lock_wait_table_reserve_slot() + for lock wait */ + os_event_t event; /*!< event used in suspending + the thread when it has nothing + to do */ + que_thr_t* thr; /*!< suspended query thread + (only used for user threads) */ }; -extern ulint srv_n_threads_active[]; #else /* !UNIV_HOTBACKUP */ # define srv_use_adaptive_hash_indexes FALSE -# define srv_use_checksums TRUE # define srv_use_native_aio FALSE # define srv_force_recovery 0UL # define srv_set_io_thread_op_info(t,info) ((void) 0) |