#include "univ.i"
#include "sync0sync.h"
#include "os0sync.h"
#include "que0types.h"
#include "trx0types.h"
#include <string>
Go to the source code of this file.
Classes | |
struct | export_var_struct |
struct | srv_sys_struct |
Typedefs | |
typedef struct export_var_struct | export_struc |
typedef struct srv_sys_struct | srv_sys_t |
typedef struct srv_slot_struct | srv_slot_t |
typedef srv_slot_t | srv_table_t |
Enumerations | |
enum | { SRV_NOT_RAW = 0, SRV_NEW_RAW, SRV_OLD_RAW } |
enum | { SRV_UNIX_FSYNC = 1, SRV_UNIX_O_DSYNC, SRV_UNIX_LITTLESYNC, SRV_UNIX_NOSYNC, SRV_UNIX_O_DIRECT, SRV_UNIX_ALL_O_DIRECT } |
enum | { SRV_WIN_IO_NORMAL = 1, SRV_WIN_IO_UNBUFFERED } |
enum | { SRV_FORCE_IGNORE_CORRUPT = 1, SRV_FORCE_NO_BACKGROUND = 2, SRV_FORCE_NO_TRX_UNDO = 3, SRV_FORCE_NO_IBUF_MERGE = 4, SRV_FORCE_NO_UNDO_LOG_SCAN = 5, SRV_FORCE_NO_LOG_REDO = 6 } |
enum | srv_thread_type { SRV_COM = 1, SRV_CONSOLE, SRV_WORKER, SRV_MASTER } |
Functions | |
static const std::string | srv_mysql50_table_name_prefix ("#mysql50#") |
UNIV_INTERN ulint | srv_boot (void) |
UNIV_INTERN void | srv_init (void) |
UNIV_INTERN void | srv_free (void) |
UNIV_INTERN void | srv_general_init (void) |
UNIV_INTERN ulint | srv_get_n_threads (void) |
enum srv_thread_type | srv_get_thread_type (void) |
UNIV_INTERN void | srv_set_io_thread_op_info (ulint i, const char *str) |
UNIV_INTERN ulint | srv_release_threads (enum srv_thread_type type, ulint n) |
UNIV_INTERN os_thread_ret_t | srv_master_thread (void *arg) |
UNIV_INTERN void | srv_wake_purge_thread (void) |
UNIV_INTERN void | srv_active_wake_master_thread (void) |
UNIV_INTERN void | srv_wake_master_thread (void) |
UNIV_INTERN void | srv_wake_purge_thread_if_not_active (void) |
UNIV_INTERN void | srv_conc_enter_innodb (trx_t *trx) |
UNIV_INTERN void | srv_conc_force_enter_innodb (trx_t *trx) |
UNIV_INTERN void | srv_conc_force_exit_innodb (trx_t *trx) |
UNIV_INTERN void | srv_conc_exit_innodb (trx_t *trx) |
UNIV_INTERN void | srv_suspend_mysql_thread (que_thr_t *thr) |
UNIV_INTERN void | srv_release_mysql_thread_if_suspended (que_thr_t *thr) |
UNIV_INTERN os_thread_ret_t | srv_lock_timeout_thread (void *arg) |
UNIV_INTERN os_thread_ret_t | srv_monitor_thread (void *arg) |
UNIV_INTERN os_thread_ret_t | srv_error_monitor_thread (void *arg) |
UNIV_INTERN os_thread_ret_t | srv_LRU_dump_restore_thread (void *arg) |
UNIV_INTERN ibool | srv_printf_innodb_monitor (FILE *file, ibool nowait, ulint *trx_start, ulint *trx_end) |
UNIV_INTERN void | srv_export_innodb_status (void) |
UNIV_INTERN void | srv_inc_activity_count (void) |
UNIV_INTERN os_thread_ret_t | srv_purge_thread (void *) |
UNIV_INTERN void | srv_que_task_enqueue_low (que_thr_t *thr) |
UNIV_INTERN ibool | srv_is_any_background_thread_active (void) |
Variables | |
const char * | srv_main_thread_op_info |
os_event_t | srv_lock_timeout_thread_event |
os_event_t | srv_monitor_event |
os_event_t | srv_timeout_event |
os_event_t | srv_error_event |
ibool | srv_lower_case_table_names |
mutex_t | srv_monitor_file_mutex |
FILE * | srv_monitor_file |
mutex_t | srv_dict_tmpfile_mutex |
FILE * | srv_dict_tmpfile |
mutex_t | srv_misc_tmpfile_mutex |
FILE * | srv_misc_tmpfile |
char * | srv_data_home |
my_bool | srv_file_per_table |
ulint | srv_file_format |
ulint | srv_max_file_format_at_startup |
ibool | srv_locks_unsafe_for_binlog |
my_bool | srv_use_native_aio |
ulint | srv_n_data_files |
char ** | srv_data_file_names |
ulint * | srv_data_file_sizes |
ulint * | srv_data_file_is_raw_partition |
ibool | srv_auto_extend_last_data_file |
ulint | srv_last_file_size_max |
char ** | srv_log_group_home_dirs |
unsigned int | srv_auto_extend_increment |
ibool | srv_created_new_raw |
ulint | srv_n_log_groups |
ulint | srv_n_log_files |
ulint | srv_log_file_size |
ulint | srv_log_buffer_size |
ulong | srv_flush_log_at_trx_commit |
bool | srv_adaptive_flushing |
const byte * | srv_latin1_ordering |
my_bool | srv_use_sys_malloc |
ulint | srv_buf_pool_size |
ulint | srv_buf_pool_instances |
ulint | srv_buf_pool_old_size |
ulint | srv_buf_pool_curr_size |
ulint | srv_mem_pool_size |
ulint | srv_lock_table_size |
ulint | srv_n_file_io_threads |
ulong | srv_read_ahead_threshold |
ulint | srv_n_read_io_threads |
ulint | srv_n_write_io_threads |
ulong | srv_io_capacity |
char * | srv_file_flush_method_str |
ulint | srv_unix_file_flush_method |
ulint | srv_win_file_flush_method |
ulint | srv_max_n_open_files |
ulint | srv_max_dirty_pages_pct |
ulint | srv_force_recovery |
ulong | srv_thread_concurrency |
ulint | srv_max_n_threads |
lint | srv_conc_n_threads |
ulint | srv_fast_shutdown |
ibool | srv_innodb_status |
ib_uint64_t | srv_stats_sample_pages |
ibool | srv_use_doublewrite_buf |
ibool | srv_use_checksums |
ulong | srv_max_buf_pool_modified_pct |
ulong | srv_max_purge_lag |
ulong | srv_replication_delay |
uint64_t | srv_ibuf_max_size |
uint32_t | srv_ibuf_active_contract |
uint32_t | srv_ibuf_accel_rate |
uint32_t | srv_checkpoint_age_target |
uint32_t | srv_flush_neighbor_pages |
uint32_t | srv_read_ahead |
uint32_t | srv_adaptive_flushing_method |
ibool | srv_read_only |
ibool | srv_fake_write |
ibool | srv_apply_log_only |
ulint | srv_n_rows_inserted |
ulint | srv_n_rows_updated |
ulint | srv_n_rows_deleted |
ulint | srv_n_rows_read |
ibool | srv_print_innodb_monitor |
ibool | srv_print_innodb_lock_monitor |
ibool | srv_print_innodb_tablespace_monitor |
ibool | srv_print_verbose_log |
ibool | srv_print_innodb_table_monitor |
ibool | srv_lock_timeout_active |
ibool | srv_monitor_active |
ibool | srv_error_monitor_active |
ulong | srv_n_spin_wait_rounds |
ulong | srv_n_free_tickets_to_enter |
ulong | srv_thread_sleep_delay |
ulong | srv_spin_wait_delay |
ibool | srv_priority_boost |
ulint | srv_truncated_status_writes |
ulint | srv_activity_count |
ulint | srv_fatal_semaphore_wait_threshold |
ulint | srv_dml_needed_delay |
mutex_t * | kernel_mutex_temp |
mutex_t * | commit_id_mutex_temp |
const char * | srv_io_thread_op_info [] |
const char * | srv_io_thread_function [] |
ulint | srv_log_write_requests |
ulint | srv_log_writes |
ulint | srv_os_log_written |
ulint | srv_os_log_pending_writes |
ulint | srv_log_waits |
ulong | srv_n_purge_threads |
ulong | srv_purge_batch_size |
ulint | srv_data_read |
ulint | srv_data_written |
ulint | srv_dblwr_writes |
ulint | srv_dblwr_pages_written |
ulint | srv_buf_pool_write_requests |
ulint | srv_buf_pool_wait_free |
ulint | srv_buf_pool_flushed |
ulint | srv_buf_pool_reads |
uint32_t | srv_auto_lru_dump |
export_struc | export_vars |
srv_sys_t * | srv_sys |
ulint | srv_n_threads_active [] |
typedef struct export_var_struct export_struc |
typedef struct srv_slot_struct srv_slot_t |
typedef struct srv_sys_struct srv_sys_t |
typedef srv_slot_t srv_table_t |
anonymous enum |
anonymous enum |
Alternatives for the file flush option in Unix; see the InnoDB manual about what these mean
SRV_UNIX_FSYNC |
fsync, the default |
SRV_UNIX_O_DSYNC |
open log files in O_SYNC mode |
SRV_UNIX_LITTLESYNC |
do not call os_file_flush() when writing data files, but do flush after writing to log files |
SRV_UNIX_NOSYNC |
do not flush after writing |
SRV_UNIX_O_DIRECT |
invoke os_file_set_nocache() on data files |
SRV_UNIX_ALL_O_DIRECT |
Open log file also with O_DIRECT |
anonymous enum |
anonymous enum |
Alternatives for srv_force_recovery. Non-zero values are intended to help the user get a damaged database up so that he can dump intact tables and rows with SELECT INTO OUTFILE. The database must not otherwise be used with these options! A bigger number below means that all precautions of lower numbers are included.
enum srv_thread_type |
UNIV_INTERN void srv_active_wake_master_thread | ( | void | ) |
Tells the Innobase server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). Used in the MySQL interface. Note that there is a small chance that the master thread stays suspended (we do not protect our operation with the kernel mutex, for performace reasons).
Tells the InnoDB server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). Used in the MySQL interface. Note that there is a small chance that the master thread stays suspended (we do not protect our operation with the srv_sys_t->mutex, for performance reasons).
Definition at line 2582 of file srv0srv.cc.
References srv_active_wake_master_thread(), SRV_MASTER, and srv_release_threads().
Referenced by ha_innobase::close(), InnobaseEngine::doCommit(), InnobaseEngine::doCreateTable(), InnobaseEngine::doDropSchema(), InnobaseEngine::doDropTable(), InnobaseEngine::doRenameTable(), InnobaseEngine::doXaPrepare(), innobase_active_small(), srv_active_wake_master_thread(), and trx_general_rollback_for_mysql().
UNIV_INTERN ulint srv_boot | ( | void | ) |
Boots Innobase server.
Boots the InnoDB server.
Definition at line 1485 of file srv0srv.cc.
References srv_boot(), srv_general_init(), and srv_init().
Referenced by innobase_start_or_create_for_mysql(), and srv_boot().
UNIV_INTERN void srv_conc_enter_innodb | ( | trx_t * | trx | ) |
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. in: transaction object associated with the thread
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.
trx | in: transaction object associated with the thread |
Definition at line 1187 of file srv0srv.cc.
References srv_conc_slot_struct::event, trx_struct::mysql_thd, trx_struct::op_info, os_event_reset(), os_fast_mutex_lock(), os_fast_mutex_unlock(), os_thread_sleep(), srv_conc_slot_struct::reserved, srv_conc_enter_innodb(), thd_is_replication_slave_thread(), trx_struct::trx_locks, trx_print(), trx_search_latch_release_if_reserved(), ut_ad, UT_LIST_ADD_LAST, UT_LIST_GET_FIRST, UT_LIST_REMOVE, ut_print_timestamp(), UT_WAIT_FOR, and srv_conc_slot_struct::wait_ended.
Referenced by innodb_srv_conc_enter_innodb(), and srv_conc_enter_innodb().
UNIV_INTERN void srv_conc_exit_innodb | ( | trx_t * | trx | ) |
This must be called when a thread exits InnoDB. in: transaction object associated with the thread
This must be called when a thread exits InnoDB.
trx | in: transaction object associated with the thread |
Definition at line 1429 of file srv0srv.cc.
References srv_conc_exit_innodb(), and srv_conc_force_exit_innodb().
Referenced by innodb_srv_conc_exit_innodb(), and srv_conc_exit_innodb().
UNIV_INTERN void srv_conc_force_enter_innodb | ( | trx_t * | trx | ) |
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. 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.
trx | in: transaction object associated with the thread |
Definition at line 1347 of file srv0srv.cc.
References os_fast_mutex_lock(), os_fast_mutex_unlock(), srv_conc_force_enter_innodb(), and ut_ad.
Referenced by srv_conc_force_enter_innodb(), and srv_suspend_mysql_thread().
UNIV_INTERN void srv_conc_force_exit_innodb | ( | trx_t * | trx | ) |
This must be called when a thread exits InnoDB in a lock wait or at the end of an SQL statement. 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.
trx | in: transaction object associated with the thread |
Definition at line 1373 of file srv0srv.cc.
References srv_conc_slot_struct::event, trx_struct::mysql_thd, os_event_set(), os_fast_mutex_lock(), os_fast_mutex_unlock(), srv_conc_force_exit_innodb(), thd_is_replication_slave_thread(), ut_ad, UT_LIST_GET_FIRST, UT_LIST_GET_NEXT, and srv_conc_slot_struct::wait_ended.
Referenced by InnobaseEngine::doCommit(), innobase_release_stat_resources(), srv_conc_exit_innodb(), srv_conc_force_exit_innodb(), srv_suspend_mysql_thread(), and trx_free().
UNIV_INTERN os_thread_ret_t srv_error_monitor_thread | ( | void * | ) |
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.
Definition at line 2398 of file srv0srv.cc.
References log_get_lsn(), os_event_reset(), os_event_wait_time_low(), os_thread_exit(), os_thread_get_curr_id(), os_thread_pf(), srv_error_monitor_thread(), SRV_SHUTDOWN_CLEANUP, srv_start_lsn, sync_arr_wake_threads_if_sema_free(), sync_array_print_long_waits(), and ut_error.
Referenced by innobase_start_or_create_for_mysql(), and srv_error_monitor_thread().
UNIV_INTERN void srv_export_innodb_status | ( | void | ) |
Function to pass InnoDB status variables to MySQL
Definition at line 2035 of file srv0srv.cc.
References buf_pool_get_n_pages(), export_vars, export_var_struct::innodb_buffer_pool_pages_data, export_var_struct::innodb_buffer_pool_pages_dirty, export_var_struct::innodb_buffer_pool_pages_flushed, export_var_struct::innodb_buffer_pool_pages_free, export_var_struct::innodb_buffer_pool_pages_misc, export_var_struct::innodb_buffer_pool_pages_total, export_var_struct::innodb_buffer_pool_read_ahead, export_var_struct::innodb_buffer_pool_read_ahead_evicted, export_var_struct::innodb_buffer_pool_read_requests, export_var_struct::innodb_buffer_pool_reads, export_var_struct::innodb_buffer_pool_wait_free, export_var_struct::innodb_buffer_pool_write_requests, export_var_struct::innodb_data_fsyncs, export_var_struct::innodb_data_pending_fsyncs, export_var_struct::innodb_data_pending_reads, export_var_struct::innodb_data_pending_writes, export_var_struct::innodb_data_read, export_var_struct::innodb_data_reads, export_var_struct::innodb_data_writes, export_var_struct::innodb_data_written, export_var_struct::innodb_dblwr_pages_written, export_var_struct::innodb_dblwr_writes, export_var_struct::innodb_have_atomic_builtins, export_var_struct::innodb_log_waits, export_var_struct::innodb_log_write_requests, export_var_struct::innodb_log_writes, export_var_struct::innodb_os_log_fsyncs, export_var_struct::innodb_os_log_pending_fsyncs, export_var_struct::innodb_os_log_pending_writes, export_var_struct::innodb_os_log_written, export_var_struct::innodb_page_size, export_var_struct::innodb_pages_created, export_var_struct::innodb_pages_read, export_var_struct::innodb_pages_written, export_var_struct::innodb_row_lock_current_waits, export_var_struct::innodb_row_lock_time, export_var_struct::innodb_row_lock_time_avg, export_var_struct::innodb_row_lock_time_max, export_var_struct::innodb_row_lock_waits, export_var_struct::innodb_rows_deleted, export_var_struct::innodb_rows_inserted, export_var_struct::innodb_rows_read, export_var_struct::innodb_rows_updated, export_var_struct::innodb_truncated_status_writes, buf_pool_stat_struct::n_page_gets, buf_pool_stat_struct::n_pages_created, buf_pool_stat_struct::n_pages_read, buf_pool_stat_struct::n_pages_written, buf_pool_stat_struct::n_ra_pages_evicted, buf_pool_stat_struct::n_ra_pages_read, os_n_pending_reads, os_n_pending_writes, srv_buf_pool_reads, and srv_export_innodb_status().
Referenced by srv_export_innodb_status().
UNIV_INTERN void srv_free | ( | void | ) |
Frees the data structures created in srv_init().
Definition at line 1138 of file srv0srv.cc.
References mem_free, os_fast_mutex_free(), srv_free(), srv_sys, srv_sys_struct::threads, trx_i_s_cache, and trx_i_s_cache_free().
Referenced by innobase_shutdown_for_mysql(), and srv_free().
UNIV_INTERN void srv_general_init | ( | void | ) |
Initializes the synchronization primitives, memory system, and the thread local storage.
Definition at line 1165 of file srv0srv.cc.
References mem_init(), os_sync_init(), recv_sys_var_init(), srv_general_init(), sync_init(), thr_local_init(), and ut_mem_init().
Referenced by srv_boot(), and srv_general_init().
UNIV_INTERN ulint srv_get_n_threads | ( | void | ) |
Gets the number of threads in the system.
Definition at line 863 of file srv0srv.cc.
References SRV_COM, srv_get_n_threads(), and SRV_MASTER.
Referenced by srv_get_n_threads().
enum srv_thread_type srv_get_thread_type | ( | void | ) |
Returns the calling thread type.
Definition at line 1024 of file srv0srv.cc.
References os_thread_get_curr_id(), srv_get_thread_type(), SRV_MASTER, SRV_WORKER, thr_local_get_slot_no(), srv_slot_struct::type, and ut_ad.
Referenced by srv_get_thread_type().
UNIV_INTERN void srv_inc_activity_count | ( | void | ) |
Increment the server activity counter.
UNIV_INTERN void srv_init | ( | void | ) |
Initializes the server.
Definition at line 1051 of file srv0srv.cc.
References srv_conc_slot_struct::event, srv_slot_struct::event, srv_slot_struct::in_use, os_event_create(), os_fast_mutex_init(), srv_conc_slot_struct::reserved, srv_init(), SRV_MASTER, srv_sys, srv_sys_struct::tasks, srv_sys_struct::threads, trx_i_s_cache, trx_i_s_cache_init(), srv_slot_struct::type, ut_a, and UT_LIST_INIT.
Referenced by srv_boot(), and srv_init().
UNIV_INTERN ibool srv_is_any_background_thread_active | ( | void | ) |
Check whether any background thread is active.
Definition at line 2554 of file srv0srv.cc.
References SRV_COM, srv_is_any_background_thread_active(), and SRV_MASTER.
Referenced by logs_empty_and_mark_files_at_shutdown(), and srv_is_any_background_thread_active().
UNIV_INTERN os_thread_ret_t srv_lock_timeout_thread | ( | void * | ) |
A thread which wakes up threads whose lock wait may have lasted too long.
A thread which wakes up threads whose lock wait may have lasted too long.
Definition at line 2290 of file srv0srv.cc.
References srv_slot_struct::in_use, lock_cancel_waiting_and_release(), trx_struct::mysql_thd, os_event_reset(), os_event_wait_time_low(), os_thread_exit(), srv_lock_timeout_thread(), SRV_SHUTDOWN_CLEANUP, srv_slot_struct::suspend_time, thd_lock_wait_timeout(), srv_slot_struct::thr, thr_get_trx(), trx_is_interrupted(), ut_difftime(), ut_time(), and trx_struct::wait_lock.
Referenced by innobase_start_or_create_for_mysql(), and srv_lock_timeout_thread().
UNIV_INTERN os_thread_ret_t srv_LRU_dump_restore_thread | ( | void * | ) |
A thread which restores the buffer pool from a dump file on startup and does periodic buffer pool dumps.
A thread which restores the buffer pool from a dump file on startup and does periodic buffer pool dumps.
Definition at line 2505 of file srv0srv.cc.
References os_thread_exit(), os_thread_get_curr_id(), os_thread_pf(), os_thread_sleep(), srv_auto_lru_dump, srv_LRU_dump_restore_thread(), and SRV_SHUTDOWN_CLEANUP.
Referenced by innobase_start_or_create_for_mysql(), and srv_LRU_dump_restore_thread().
UNIV_INTERN os_thread_ret_t srv_master_thread | ( | void * | ) |
The master thread controlling the server.
The master thread controlling the server.
Definition at line 2709 of file srv0srv.cc.
References BUF_FLUSH_LIST, buf_pool_from_array(), srv_conc_slot_struct::event, log_checkpoint(), log_free_check(), log_struct::lsn, MAX_BUFFER_POOLS, log_struct::max_checkpoint_age, log_struct::max_modified_age_async, log_struct::mutex, log_struct::n_log_ios, buf_pool_stat_struct::n_pages_read, buf_pool_stat_struct::n_pages_written, log_struct::n_pending_writes, buf_page_struct::offset, buf_page_struct::oldest_modification, os_proc_get_number(), os_thread_exit(), os_thread_get_curr_id(), os_thread_pf(), os_thread_sleep(), row_drop_tables_for_mysql_in_background(), row_get_background_drop_list_len_low(), buf_page_struct::space, srv_buf_pool_instances, SRV_FORCE_NO_BACKGROUND, SRV_MASTER, srv_master_thread(), SRV_SHUTDOWN_EXIT_THREADS, SRV_SHUTDOWN_NONE, UT_LIST_GET_FIRST, UT_LIST_GET_LEN, UT_LIST_GET_NEXT, ut_min(), and ut_time_ms().
Referenced by innobase_start_or_create_for_mysql(), and srv_master_thread().
UNIV_INTERN os_thread_ret_t srv_monitor_thread | ( | void * | ) |
A thread which prints the info output by various InnoDB monitors.
A thread which prints the info output by various InnoDB monitors.
Definition at line 2125 of file srv0srv.cc.
References os_event_reset(), os_event_wait_time_low(), os_file_set_eof(), os_thread_exit(), os_thread_get_curr_id(), os_thread_pf(), srv_monitor_thread(), srv_printf_innodb_monitor(), SRV_SHUTDOWN_CLEANUP, ut_print_timestamp(), and ut_time().
Referenced by innobase_start_or_create_for_mysql(), and srv_monitor_thread().
|
static |
Prefix used by MySQL to indicate pre-5.1 table name encoding LOOKIE HERE!!!! This used to be srv_mysql50_table_name_prefix[10] which was a buffer overrun, because it didn't allow for the trailing '\0'. Thanks C++!
Referenced by innobase_convert_identifier(), and innobase_init().
UNIV_INTERN 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.
Outputs to a file the output of the InnoDB Monitor.
file | in: output stream |
nowait | in: whether to wait for kernel mutex |
trx_start | out: file position of the start of the list of active transactions |
trx_end | out: file position of the end of the list of active transactions |
Definition at line 1843 of file srv0srv.cc.
References btr_search_sys_struct::hash_index, ibuf_print(), lock_print_info_all_transactions(), lock_print_info_summary(), log_print(), mem_comm_pool, mem_pool_get_reserved(), os_aio_print(), dict_sys_struct::size, srv_printf_innodb_monitor(), sync_print(), trx_sys, ut_copy_file(), UT_LIST_GET_LEN, ut_print_timestamp(), and ut_total_allocated_memory.
Referenced by innodb_show_status(), srv_monitor_thread(), and srv_printf_innodb_monitor().
UNIV_INTERN os_thread_ret_t srv_purge_thread | ( | void * | ) |
Asynchronous purge thread.
Asynchronous purge thread.
Definition at line 3432 of file srv0srv.cc.
References srv_conc_slot_struct::event, srv_slot_struct::in_use, os_thread_exit(), os_thread_get_curr_id(), os_thread_pf(), os_thread_sleep(), trx_sys_struct::rseg_history_len, SRV_FORCE_NO_BACKGROUND, srv_purge_thread(), SRV_SHUTDOWN_EXIT_THREADS, SRV_WORKER, thr_local_free(), trx_purge(), trx_sys, ut_a, ut_ad, ut_min(), and ut_time_ms().
Referenced by innobase_start_or_create_for_mysql(), and srv_purge_thread().
UNIV_INTERN void srv_que_task_enqueue_low | ( | que_thr_t * | thr | ) |
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one. in: query thread
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one.
thr | in: query thread |
Definition at line 3548 of file srv0srv.cc.
References srv_que_task_enqueue_low(), srv_release_threads(), srv_sys, SRV_WORKER, srv_sys_struct::tasks, ut_ad, and UT_LIST_ADD_LAST.
Referenced by que_fork_error_handle(), que_thr_end_wait(), srv_que_task_enqueue_low(), and trx_rollback().
UNIV_INTERN void srv_release_mysql_thread_if_suspended | ( | que_thr_t * | thr | ) |
Releases a MySQL OS thread waiting for a lock to be released, if the thread is already suspended. 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.
thr | in: query thread associated with the MySQL OS thread |
Definition at line 1783 of file srv0srv.cc.
References srv_slot_struct::event, srv_slot_struct::in_use, os_event_set(), srv_release_mysql_thread_if_suspended(), srv_slot_struct::thr, and ut_ad.
Referenced by que_thr_end_wait_no_next_thr(), and srv_release_mysql_thread_if_suspended().
UNIV_INTERN ulint srv_release_threads | ( | enum srv_thread_type | type, |
ulint | n | ||
) |
Releases threads of the type given from suspension in the thread table. NOTE! The server mutex has to be reserved by the caller!
Releases threads of the type given from suspension in the thread table. NOTE! The server mutex has to be reserved by the caller!
type | in: thread type |
n | in: number of threads to release |
Definition at line 972 of file srv0srv.cc.
References srv_slot_struct::event, srv_slot_struct::id, srv_slot_struct::in_use, os_event_set(), SRV_MASTER, srv_release_threads(), SRV_WORKER, srv_slot_struct::suspended, srv_slot_struct::type, and ut_ad.
Referenced by srv_active_wake_master_thread(), srv_que_task_enqueue_low(), srv_release_threads(), srv_wake_master_thread(), srv_wake_purge_thread(), and srv_wake_purge_thread_if_not_active().
UNIV_INTERN void srv_set_io_thread_op_info | ( | ulint | i, |
const char * | str | ||
) |
Sets the info describing an i/o thread current state. in: constant char string describing the state
Sets the info describing an i/o thread current state.
i | in: the 'segment' of the i/o thread |
str | in: constant char string describing the state |
Definition at line 832 of file srv0srv.cc.
References srv_set_io_thread_op_info(), and ut_a.
Referenced by fil_aio_wait(), os_aio_simulated_handle(), and srv_set_io_thread_op_info().
UNIV_INTERN void srv_suspend_mysql_thread | ( | que_thr_t * | thr | ) |
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. in: query thread associated with the MySQL OS 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.
thr | in: query thread associated with the MySQL OS thread |
Definition at line 1584 of file srv0srv.cc.
References trx_struct::dict_operation_lock_mode, trx_struct::error_state, srv_conc_slot_struct::event, srv_slot_struct::event, srv_slot_struct::in_use, que_thr_struct::is_active, que_thr_struct::lock_state, trx_struct::mysql_thd, os_event_reset(), os_event_set(), row_mysql_unfreeze_data_dictionary(), row_mysql_unlock_data_dictionary(), srv_conc_force_enter_innodb(), srv_conc_force_exit_innodb(), srv_suspend_mysql_thread(), que_thr_struct::state, srv_slot_struct::suspend_time, thd_lock_wait_timeout(), thd_set_lock_wait_time(), srv_slot_struct::thr, thr_get_trx(), trx_is_interrupted(), ut_a, ut_ad, ut_difftime(), ut_print_timestamp(), ut_time(), and ut_usectime().
Referenced by que_run_threads(), row_ins_check_foreign_constraint(), row_mysql_handle_errors(), row_update_cascade_for_mysql(), and srv_suspend_mysql_thread().
UNIV_INTERN void srv_wake_master_thread | ( | void | ) |
Wakes up the master thread if it is suspended or being suspended.
Definition at line 2625 of file srv0srv.cc.
References SRV_MASTER, srv_release_threads(), and srv_wake_master_thread().
Referenced by innobase_shutdown_for_mysql(), row_drop_table_for_mysql(), row_truncate_table_for_mysql(), and srv_wake_master_thread().
UNIV_INTERN void srv_wake_purge_thread | ( | void | ) |
Wakes up the purge thread if it's not already awake.
Definition at line 2641 of file srv0srv.cc.
References srv_release_threads(), srv_wake_purge_thread(), SRV_WORKER, and ut_ad.
Referenced by innobase_shutdown_for_mysql(), and srv_wake_purge_thread().
UNIV_INTERN void srv_wake_purge_thread_if_not_active | ( | void | ) |
Tells the purge thread that there has been activity in the database and wakes up the purge thread if it is suspended (not sleeping). Note that there is a small chance that the purge thread stays suspended (we do not protect our operation with the kernel mutex, for performace reasons).
Definition at line 2605 of file srv0srv.cc.
References srv_release_threads(), srv_wake_purge_thread_if_not_active(), SRV_WORKER, and ut_ad.
Referenced by srv_wake_purge_thread_if_not_active(), and trx_purge_add_update_undo_to_history().
export_struc export_vars |
Status variables to be passed to MySQL
Definition at line 369 of file srv0srv.cc.
Referenced by srv_export_innodb_status().
uint32_t srv_auto_lru_dump |
Time in seconds between automatic buffer pool dumps
Definition at line 366 of file srv0srv.cc.
Referenced by innobase_init(), and srv_LRU_dump_restore_thread().
ulint srv_buf_pool_curr_size |
ulint srv_buf_pool_instances |
requested number of buffer pool instances
Definition at line 254 of file srv0srv.cc.
Referenced by buf_block_alloc(), buf_flush_free_flush_rbt(), buf_flush_free_margins(), buf_flush_init_flush_rbt(), buf_flush_list(), buf_flush_wait_batch_end(), buf_get_total_list_len(), buf_get_total_stat(), buf_LRU_buf_pool_running_out(), buf_LRU_file_dump(), buf_LRU_invalidate_tablespace(), buf_LRU_old_ratio_update(), buf_LRU_stat_update(), buf_LRU_try_free_flushed_blocks(), buf_pool_drop_hash_index(), buf_pool_get_oldest_modification(), buf_pool_init(), innobase_init(), innobase_shutdown_for_mysql(), innobase_start_or_create_for_mysql(), and srv_master_thread().
ulint srv_buf_pool_old_size |
previously requested size
Definition at line 256 of file srv0srv.cc.
Referenced by buf_pool_resize().
ulint srv_buf_pool_reads |
Number of buffer pool reads that led to the reading of a disk page
Definition at line 363 of file srv0srv.cc.
Referenced by buf_read_page(), and srv_export_innodb_status().
ulint srv_buf_pool_size |
requested size in bytes
Definition at line 252 of file srv0srv.cc.
Referenced by buf_pool_resize(), innobase_init(), and innobase_start_or_create_for_mysql().
ulint srv_file_format |
The file format to use on new *.ibd files.
Definition at line 126 of file srv0srv.cc.
Referenced by InnobaseEngine::doCreateTable(), and innobase_init().
my_bool srv_file_per_table |
store to its own file each table created by an user; data dictionary tables are in the system tablespace 0
Definition at line 124 of file srv0srv.cc.
Referenced by InnobaseEngine::doCreateTable(), innobase_init(), innobase_start_or_create_for_mysql(), and os_file_create_func().
const byte* srv_latin1_ordering |
The sort order table of the MySQL latin1_swedish_ci character set collation
Definition at line 245 of file srv0srv.cc.
ibool srv_locks_unsafe_for_binlog |
Place locks to records only i.e. do not use next-key locking except on duplicate key checking and foreign key checking
Definition at line 137 of file srv0srv.cc.
Referenced by innobase_init(), row_search_for_mysql(), row_unlock_for_mysql(), ha_innobase::store_lock(), ha_innobase::try_semi_consistent_read(), and ha_innobase::unlock_row().
ulint srv_max_file_format_at_startup |
Whether to check file format during startup. A value of DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support.
Definition at line 130 of file srv0srv.cc.
Referenced by innobase_file_format_validate_and_set(), innobase_init(), and innobase_start_or_create_for_mysql().
srv_sys_t* srv_sys |
The server system
Definition at line 776 of file srv0srv.cc.
Referenced by srv_free(), srv_init(), and srv_que_task_enqueue_low().