45 #ifndef UNIV_HOTBACKUP
52 #include "buf0checksum.h"
130 extern const char* srv_main_thread_op_info;
145 #define SRV_BUF_DUMP_FILENAME_DEFAULT "ib_buffer_pool"
146 extern char* srv_buf_dump_filename;
151 extern char srv_buffer_pool_load_at_startup;
154 extern char srv_disable_sort_file_cache;
158 #define SRV_AUTO_EXTEND_INCREMENT \
159 (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE))
164 extern FILE* srv_monitor_file;
170 extern FILE* srv_dict_tmpfile;
176 extern FILE* srv_misc_tmpfile;
180 extern char* srv_data_home;
182 #ifdef UNIV_LOG_ARCHIVE
183 extern char* srv_arch_dir;
195 #if defined(HAVE_ATOMIC_BUILTINS)
197 extern ulong srv_adaptive_max_sleep_delay;
219 extern my_bool srv_use_native_aio;
221 extern ibool srv_use_native_conditions;
235 extern ulong srv_undo_logs;
237 extern ulint srv_n_data_files;
238 extern char** srv_data_file_names;
239 extern ulint* srv_data_file_sizes;
240 extern ulint* srv_data_file_is_raw_partition;
242 extern ibool srv_auto_extend_last_data_file;
243 extern ulint srv_last_file_size_max;
244 extern char* srv_log_group_home_dir;
245 #ifndef UNIV_HOTBACKUP
246 extern ulong srv_auto_extend_increment;
248 extern ibool srv_created_new_raw;
251 #define SRV_N_LOG_FILES_MAX 100
252 extern ulong srv_n_log_files;
253 extern ib_uint64_t srv_log_file_size;
254 extern ib_uint64_t srv_log_file_size_requested;
255 extern ulint srv_log_buffer_size;
256 extern ulong srv_flush_log_at_trx_commit;
257 extern uint srv_flush_log_at_timeout;
258 extern char srv_adaptive_flushing;
263 extern my_bool srv_load_corrupted;
267 extern const byte* srv_latin1_ordering;
268 #ifndef UNIV_HOTBACKUP
269 extern my_bool srv_use_sys_malloc;
271 extern ibool srv_use_sys_malloc;
274 extern ulint srv_buf_pool_instances;
282 extern ulint srv_buf_pool_curr_size;
283 extern ulint srv_mem_pool_size;
284 extern ulint srv_lock_table_size;
286 extern ulint srv_n_file_io_threads;
287 extern my_bool srv_random_read_ahead;
288 extern ulong srv_read_ahead_threshold;
289 extern ulint srv_n_read_io_threads;
290 extern ulint srv_n_write_io_threads;
293 extern ulong srv_io_capacity;
297 #define SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT (~0UL)
298 #define SRV_MAX_IO_CAPACITY_LIMIT (~0UL)
299 extern ulong srv_max_io_capacity;
303 #define PCT_IO(p) ((ulong) (srv_io_capacity * ((double) (p) / 100.0)))
308 extern ulong srv_innodb_stats_method;
310 #ifdef UNIV_LOG_ARCHIVE
311 extern ibool srv_log_archive_on;
312 extern ibool srv_archive_recovery;
313 extern ib_uint64_t srv_archive_recovery_limit_lsn;
316 extern char* srv_file_flush_method_str;
317 extern ulint srv_unix_file_flush_method;
318 extern ulint srv_win_file_flush_method;
320 extern ulint srv_max_n_open_files;
322 extern ulong srv_max_dirty_pages_pct;
323 extern ulong srv_max_dirty_pages_pct_lwm;
325 extern ulong srv_adaptive_flushing_lwm;
326 extern ulong srv_flushing_avg_loops;
328 extern ulong srv_force_recovery;
330 extern ulong srv_force_recovery_crash;
340 extern ibool srv_innodb_status;
342 extern unsigned long long srv_stats_transient_sample_pages;
343 extern my_bool srv_stats_persistent;
344 extern unsigned long long srv_stats_persistent_sample_pages;
345 extern my_bool srv_stats_auto_recalc;
347 extern ibool srv_use_doublewrite_buf;
348 extern ulong srv_doublewrite_batch_size;
349 extern ulong srv_checksum_algorithm;
351 extern ulong srv_max_buf_pool_modified_pct;
352 extern ulong srv_max_purge_lag;
353 extern ulong srv_max_purge_lag_delay;
355 extern ulong srv_replication_delay;
358 extern my_bool srv_print_innodb_monitor;
359 extern my_bool srv_print_innodb_lock_monitor;
360 extern ibool srv_print_innodb_tablespace_monitor;
361 extern ibool srv_print_verbose_log;
362 #define DEPRECATED_MSG_INNODB_TABLE_MONITOR \
363 "Using innodb_table_monitor is deprecated and it may be removed " \
364 "in future releases. Please use the InnoDB INFORMATION_SCHEMA " \
365 "tables instead, see " REFMAN "innodb-i_s-tables.html"
366 extern ibool srv_print_innodb_table_monitor;
368 extern ibool srv_monitor_active;
369 extern ibool srv_error_monitor_active;
372 extern ibool srv_buf_dump_thread_active;
375 extern ibool srv_dict_stats_thread_active;
377 extern ulong srv_n_spin_wait_rounds;
378 extern ulong srv_n_free_tickets_to_enter;
380 extern ulong srv_spin_wait_delay;
381 extern ibool srv_priority_boost;
383 extern ulint srv_truncated_status_writes;
384 extern ulint srv_available_undo_logs;
386 extern ulint srv_mem_pool_size;
387 extern ulint srv_lock_table_size;
390 extern ibool srv_print_thread_releases;
391 extern ibool srv_print_lock_waits;
392 extern ibool srv_print_buf_io;
393 extern ibool srv_print_log_io;
394 extern ibool srv_print_latch_waits;
396 # define srv_print_thread_releases FALSE
397 # define srv_print_lock_waits FALSE
398 # define srv_print_buf_io FALSE
399 # define srv_print_log_io FALSE
400 # define srv_print_latch_waits FALSE
403 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
404 extern my_bool srv_ibuf_disable_background_merge;
408 extern my_bool srv_purge_view_update_only_debug;
411 extern ulint srv_fatal_semaphore_wait_threshold;
412 #define SRV_SEMAPHORE_WAIT_EXTENSION 7200
413 extern ulint srv_dml_needed_delay;
415 #ifndef HAVE_ATOMIC_BUILTINS
420 #define SRV_MAX_N_IO_THREADS 130
424 extern const char* srv_io_thread_op_info[];
425 extern const char* srv_io_thread_function[];
428 extern ulong srv_n_purge_threads;
431 extern ulong srv_purge_batch_size;
434 extern ulong srv_sync_array_size;
437 extern my_bool srv_print_all_deadlocks;
439 extern my_bool srv_cmp_per_index_enabled;
447 # ifdef UNIV_PFS_THREAD
449 extern mysql_pfs_key_t buf_page_cleaner_thread_key;
450 extern mysql_pfs_key_t trx_rollback_clean_thread_key;
451 extern mysql_pfs_key_t io_handler_thread_key;
452 extern mysql_pfs_key_t srv_lock_timeout_thread_key;
453 extern mysql_pfs_key_t srv_error_monitor_thread_key;
454 extern mysql_pfs_key_t srv_monitor_thread_key;
455 extern mysql_pfs_key_t srv_master_thread_key;
456 extern mysql_pfs_key_t srv_purge_thread_key;
457 extern mysql_pfs_key_t recv_writer_thread_key;
461 # define pfs_register_thread(key) \
463 struct PSI_thread* psi = PSI_THREAD_CALL(new_thread)(key, NULL, 0);\
464 PSI_THREAD_CALL(set_thread)(psi); \
468 # define pfs_delete_thread() \
470 PSI_THREAD_CALL(delete_current_thread)(); \
540 enum srv_stats_method_name_enum {
541 SRV_STATS_NULLS_EQUAL,
544 SRV_STATS_NULLS_UNEQUAL,
546 SRV_STATS_NULLS_IGNORED
549 typedef enum srv_stats_method_name_enum srv_stats_method_name_t;
551 #ifndef UNIV_HOTBACKUP
666 ulint old_activity_count);
733 void* arg __attribute__((unused)));
743 void* arg __attribute__((unused)));
876 # define srv_use_adaptive_hash_indexes FALSE
877 # define srv_use_native_aio FALSE
878 # define srv_force_recovery 0UL
879 # define srv_set_io_thread_op_info(t,info) ((void) 0)
880 # define srv_reset_io_thread_op_info() ((void) 0)
881 # define srv_is_being_started 0
882 # define srv_win_file_flush_method SRV_WIN_IO_UNBUFFERED
883 # define srv_unix_file_flush_method SRV_UNIX_O_DSYNC
884 # define srv_start_raw_disk_in_use 0
885 # define srv_file_per_table 1