diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-22 12:48:40 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-22 12:48:40 +0300 |
commit | c009ce7dd085b55b27cc6d9d4bfe3519f88e477f (patch) | |
tree | a398b0bf23e5539d8734b5111bc0f8b9db82a90e /storage | |
parent | 620c55e708b9ea94ef8ba309267a6f2f32ed8104 (diff) | |
download | mariadb-git-c009ce7dd085b55b27cc6d9d4bfe3519f88e477f.tar.gz |
MDEV-27094 Debug builds include useless InnoDB "disabled" options
This is a backport of commit 4489a89c71ea78f2562159ca0303fbb83da5baa0
in order to remove the test innodb.redo_log_during_checkpoint
that would cause trouble in the DBUG subsystem invoked by
safe_mutex_lock() via log_checkpoint(). Before
commit 7cffb5f6e8a231a041152447be8980ce35d2c9b8
these mutexes were of different type.
The following options were introduced in
commit 2e814d4702d71a04388386a9f591d14a35980bfe (mariadb-10.2.2)
and have little use:
innodb_disable_resize_buffer_pool_debug had no effect even in
MariaDB 10.2.2 or MySQL 5.7.9. It was introduced in
mysql/mysql-server@5c4094cf4971eebab89da4ee4ae92c71f69cd524
to work around a problem that was fixed in
mysql/mysql-server@2957ae4f990bf3aed25822b0ce15d3ccad0b54b6
(but the parameter was not removed).
innodb_page_cleaner_disabled_debug and innodb_master_thread_disabled_debug
are only used by the test innodb.redo_log_during_checkpoint
that will be removed as part of this commit.
innodb_dict_stats_disabled_debug is only used by that test,
and it is redundant because one could simply use
innodb_stats_persistent=OFF or the STATS_PERSISTENT=0 attribute
of the table in the test to achieve the same effect.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 3 | ||||
-rw-r--r-- | storage/innobase/buf/buf0flu.cc | 10 | ||||
-rw-r--r-- | storage/innobase/dict/dict0stats_bg.cc | 20 | ||||
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 10 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 41 | ||||
-rw-r--r-- | storage/innobase/include/buf0buf.h | 7 | ||||
-rw-r--r-- | storage/innobase/include/buf0flu.h | 7 | ||||
-rw-r--r-- | storage/innobase/include/dict0stats_bg.h | 15 | ||||
-rw-r--r-- | storage/innobase/include/srv0srv.h | 11 | ||||
-rw-r--r-- | storage/innobase/srv/srv0srv.cc | 62 |
10 files changed, 4 insertions, 182 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 8bea22b3e85..98a8f552895 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -333,9 +333,6 @@ buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_reg; buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_ref; #ifdef UNIV_DEBUG -/** Disable resizing buffer pool to make assertion code not expensive. */ -my_bool buf_disable_resize_buffer_pool_debug = TRUE; - /** This is used to insert validation operations in execution in the debug version */ static ulint buf_dbg_counter; diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 90ead952d63..def598934c9 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -83,10 +83,6 @@ static struct ulint flush_pass; } page_cleaner; -#ifdef UNIV_DEBUG -my_bool innodb_page_cleaner_disabled_debug; -#endif /* UNIV_DEBUG */ - /* @} */ #ifdef UNIV_DEBUG @@ -2434,12 +2430,6 @@ do_checkpoint: goto unemployed; } -#ifdef UNIV_DEBUG - while (innodb_page_cleaner_disabled_debug && !buf_flush_sync_lsn && - srv_shutdown_state == SRV_SHUTDOWN_NONE) - os_thread_sleep(100000); -#endif /* UNIV_DEBUG */ - #ifndef DBUG_OFF next: #endif /* !DBUG_OFF */ diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc index 69f50cccbbf..638ffc55382 100644 --- a/storage/innobase/dict/dict0stats_bg.cc +++ b/storage/innobase/dict/dict0stats_bg.cc @@ -45,11 +45,6 @@ Created Apr 25, 2012 Vasil Dimov #define MIN_RECALC_INTERVAL 10 /* seconds */ static void dict_stats_schedule(int ms); -#ifdef UNIV_DEBUG -/** Used by SET GLOBAL innodb_dict_stats_disabled_debug = 1; */ -my_bool innodb_dict_stats_disabled_debug; -#endif /* UNIV_DEBUG */ - /** This mutex protects the "recalc_pool" variable. */ static ib_mutex_t recalc_pool_mutex; @@ -416,21 +411,6 @@ next_table_id: return ret; } -#ifdef UNIV_DEBUG -/** Disables dict stats thread. It's used by: - SET GLOBAL innodb_dict_stats_disabled_debug = 1 (0). -@param[in] save immediate result from check function */ -void dict_stats_disabled_debug_update(THD*, st_mysql_sys_var*, void*, - const void* save) -{ - const bool disable = *static_cast<const my_bool*>(save); - if (disable) - dict_stats_shutdown(); - else - dict_stats_start(); -} -#endif /* UNIV_DEBUG */ - static tpool::timer* dict_stats_timer; static std::mutex dict_stats_mutex; diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index f0326b3634c..7d4938b1cd6 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -3668,12 +3668,6 @@ fil_names_clear( bool do_write) { mtr_t mtr; - ulint mtr_checkpoint_size = RECV_SCAN_SIZE - 1; - - DBUG_EXECUTE_IF( - "increase_mtr_checkpoint_size", - mtr_checkpoint_size = 75 * 1024; - ); mysql_mutex_assert_owner(&log_sys.mutex); ut_ad(lsn); @@ -3683,8 +3677,8 @@ fil_names_clear( for (fil_space_t* space = UT_LIST_GET_FIRST(fil_system.named_spaces); space != NULL; ) { if (mtr.get_log()->size() - + (3 + 5 + 1) + strlen(space->chain.start->name) - >= mtr_checkpoint_size) { + + strlen(space->chain.start->name) + >= RECV_SCAN_SIZE - (3 + 5 + 1)) { /* Prevent log parse buffer overflow */ mtr.commit_files(); mtr.start(); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b30940967b3..9daaf0fbef3 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19838,32 +19838,10 @@ static MYSQL_SYSVAR_UINT(saved_page_number_debug, "An InnoDB page number.", NULL, NULL, 0, 0, UINT_MAX32, 0); -static MYSQL_SYSVAR_BOOL(disable_resize_buffer_pool_debug, - buf_disable_resize_buffer_pool_debug, PLUGIN_VAR_NOCMDARG, - "Disable resizing buffer pool to make assertion code not expensive.", - NULL, NULL, TRUE); - -static MYSQL_SYSVAR_BOOL(page_cleaner_disabled_debug, - innodb_page_cleaner_disabled_debug, PLUGIN_VAR_OPCMDARG, - "Disable page cleaner", - NULL, NULL, FALSE); - static MYSQL_SYSVAR_BOOL(sync_debug, srv_sync_debug, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, "Enable the sync debug checks", NULL, NULL, FALSE); - -static MYSQL_SYSVAR_BOOL(dict_stats_disabled_debug, - innodb_dict_stats_disabled_debug, - PLUGIN_VAR_OPCMDARG, - "Disable dict_stats thread", - NULL, dict_stats_disabled_debug_update, FALSE); - -static MYSQL_SYSVAR_BOOL(master_thread_disabled_debug, - srv_master_thread_disabled_debug, - PLUGIN_VAR_OPCMDARG, - "Disable master thread", - NULL, srv_master_thread_disabled_debug_update, FALSE); #endif /* UNIV_DEBUG */ static MYSQL_SYSVAR_BOOL(force_primary_key, @@ -20148,10 +20126,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(data_file_size_debug), MYSQL_SYSVAR(fil_make_page_dirty_debug), MYSQL_SYSVAR(saved_page_number_debug), - MYSQL_SYSVAR(disable_resize_buffer_pool_debug), - MYSQL_SYSVAR(page_cleaner_disabled_debug), - MYSQL_SYSVAR(dict_stats_disabled_debug), - MYSQL_SYSVAR(master_thread_disabled_debug), MYSQL_SYSVAR(sync_debug), #endif /* UNIV_DEBUG */ MYSQL_SYSVAR(force_primary_key), @@ -21157,21 +21131,6 @@ innodb_buffer_pool_size_validate( return(1); } -#ifdef UNIV_DEBUG - if (buf_disable_resize_buffer_pool_debug == TRUE) { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_WRONG_ARGUMENTS, - "Cannot update innodb_buffer_pool_size," - " because innodb_disable_resize_buffer_pool_debug" - " is set."); - ib::warn() << "Cannot update innodb_buffer_pool_size," - " because innodb_disable_resize_buffer_pool_debug" - " is set."; - return(1); - } -#endif /* UNIV_DEBUG */ - - mysql_mutex_lock(&buf_pool.mutex); if (srv_buf_pool_old_size != srv_buf_pool_size) { diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index fec8dcb4e2a..17d6d10f8b7 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2021, MariaDB Corporation. +Copyright (c) 2013, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -74,11 +74,6 @@ the blocks on free list. If LRU list is very small then we can end up in thrashing. */ #define BUF_LRU_MIN_LEN 256 -# ifdef UNIV_DEBUG -extern my_bool buf_disable_resize_buffer_pool_debug; /*!< if TRUE, resizing - buffer pool is not allowed. */ -# endif /* UNIV_DEBUG */ - /** buf_page_t::state() values, distinguishing buf_page_t and buf_block_t */ enum buf_page_state { diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h index 10ead048fa6..c772f84147d 100644 --- a/storage/innobase/include/buf0flu.h +++ b/storage/innobase/include/buf0flu.h @@ -40,13 +40,6 @@ extern ulint buf_lru_flush_page_count; /** Flag indicating if the page_cleaner is in active state. */ extern bool buf_page_cleaner_is_active; -#ifdef UNIV_DEBUG - -/** Value of MySQL global variable used to disable page cleaner. */ -extern my_bool innodb_page_cleaner_disabled_debug; - -#endif /* UNIV_DEBUG */ - /** Remove all dirty pages belonging to a given tablespace when we are deleting the data file of that tablespace. The pages still remain a part of LRU and are evicted from diff --git a/storage/innobase/include/dict0stats_bg.h b/storage/innobase/include/dict0stats_bg.h index b210a2ec357..c09bf4df8e3 100644 --- a/storage/innobase/include/dict0stats_bg.h +++ b/storage/innobase/include/dict0stats_bg.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -34,11 +34,6 @@ Created Apr 26, 2012 Vasil Dimov extern mysql_pfs_key_t dict_stats_recalc_pool_mutex_key; #endif /* HAVE_PSI_INTERFACE */ -#ifdef UNIV_DEBUG -/** Value of MySQL global used to disable dict_stats thread. */ -extern my_bool innodb_dict_stats_disabled_debug; -#endif /* UNIV_DEBUG */ - /*****************************************************************//** Delete a given table from the auto recalc pool. dict_stats_recalc_pool_del() */ @@ -102,14 +97,6 @@ Free resources allocated by dict_stats_thread_init(), must be called after dict_stats task has exited. */ void dict_stats_deinit(); -#ifdef UNIV_DEBUG -/** Disables dict stats thread. It's used by: - SET GLOBAL innodb_dict_stats_disabled_debug = 1 (0). -@param[in] save immediate result from check function */ -void dict_stats_disabled_debug_update(THD*, st_mysql_sys_var*, void*, - const void* save); -#endif /* UNIV_DEBUG */ - /** Start the dict stats timer. */ void dict_stats_start(); diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 15df5d4cfbc..5fae5740dc0 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -433,8 +433,6 @@ extern my_bool innodb_evict_tables_on_commit_debug; extern my_bool srv_sync_debug; extern my_bool srv_purge_view_update_only_debug; -/** Value of MySQL global used to disable master thread. */ -extern my_bool srv_master_thread_disabled_debug; /** InnoDB system tablespace to set during recovery */ extern uint srv_sys_space_size_debug; /** whether redo log file has been created at startup */ @@ -666,15 +664,6 @@ void srv_purge_shutdown(); /** Init purge tasks*/ void srv_init_purge_tasks(); -#ifdef UNIV_DEBUG -/** Disables master thread. It's used by: - SET GLOBAL innodb_master_thread_disabled_debug = 1 (0). -@param[in] save immediate result from check function */ -void -srv_master_thread_disabled_debug_update(THD*, st_mysql_sys_var*, void*, - const void* save); -#endif /* UNIV_DEBUG */ - /** Status variables to be passed to MySQL */ struct export_var_t{ char innodb_buffer_pool_dump_status[OS_FILE_MAX_PATH + 128];/*!< Buf pool dump status */ diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index a308839ce4f..7ae557881a1 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -148,13 +148,6 @@ my_bool srv_use_atomic_writes; /** innodb_compression_algorithm; used with page compression */ ulong innodb_compression_algorithm; -#ifdef UNIV_DEBUG -/** Used by SET GLOBAL innodb_master_thread_disabled_debug = X. */ -my_bool srv_master_thread_disabled_debug; -/** Event used to inform that master thread is disabled. */ -static os_event_t srv_master_thread_disabled_event; -#endif /* UNIV_DEBUG */ - /*------------------------- LOG FILES ------------------------ */ char* srv_log_group_home_dir; @@ -659,7 +652,6 @@ static void srv_init() } need_srv_free = true; - ut_d(srv_master_thread_disabled_event = os_event_create(0)); /* page_zip_stat_per_index_mutex is acquired from: 1. page_zip_compress() (after SYNC_FSP) @@ -692,8 +684,6 @@ srv_free(void) mutex_free(&srv_sys.tasks_mutex); } - ut_d(os_event_destroy(srv_master_thread_disabled_event)); - trx_i_s_cache_free(trx_i_s_cache); srv_thread_pool_end(); } @@ -1552,54 +1542,6 @@ srv_shutdown_print_master_pending( } } -#ifdef UNIV_DEBUG -/** Waits in loop as long as master thread is disabled (debug) */ -static -void -srv_master_do_disabled_loop(void) -{ - if (!srv_master_thread_disabled_debug) { - /* We return here to avoid changing op_info. */ - return; - } - - srv_main_thread_op_info = "disabled"; - - while (srv_master_thread_disabled_debug) { - os_event_set(srv_master_thread_disabled_event); - if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { - break; - } - os_thread_sleep(100000); - } - - srv_main_thread_op_info = ""; -} - -/** Disables master thread. It's used by: - SET GLOBAL innodb_master_thread_disabled_debug = 1 (0). -@param[in] save immediate result from check function */ -void -srv_master_thread_disabled_debug_update(THD*, st_mysql_sys_var*, void*, - const void* save) -{ - /* This method is protected by mutex, as every SET GLOBAL .. */ - ut_ad(srv_master_thread_disabled_event != NULL); - - const bool disable = *static_cast<const my_bool*>(save); - - const int64_t sig_count = os_event_reset( - srv_master_thread_disabled_event); - - srv_master_thread_disabled_debug = disable; - - if (disable) { - os_event_wait_low( - srv_master_thread_disabled_event, sig_count); - } -} -#endif /* UNIV_DEBUG */ - /*********************************************************************//** Perform the tasks that the master thread is supposed to do when the server is active. There are two types of tasks. The first category is @@ -1630,8 +1572,6 @@ srv_master_do_active_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time); - ut_d(srv_master_do_disabled_loop()); - if (srv_shutdown_state > SRV_SHUTDOWN_INITIATED) { return; } @@ -1694,8 +1634,6 @@ srv_master_do_idle_tasks(void) MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time); - ut_d(srv_master_do_disabled_loop()); - if (srv_shutdown_state > SRV_SHUTDOWN_INITIATED) { return; } |