diff options
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt | 1 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result | 45 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/sysvars_innodb.result | 2 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 40 | ||||
-rw-r--r-- | storage/innobase/include/srv0srv.h | 3 | ||||
-rw-r--r-- | storage/innobase/include/sync0rw.h | 19 | ||||
-rw-r--r-- | storage/innobase/include/sync0rw.ic | 19 | ||||
-rw-r--r-- | storage/innobase/srv/srv0srv.cc | 3 | ||||
-rw-r--r-- | storage/innobase/sync/sync0rw.cc | 17 |
11 files changed, 56 insertions, 109 deletions
diff --git a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt index 22272485540..dbac5bb16a9 100644 --- a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt +++ b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt @@ -1,3 +1,2 @@ --innodb-fatal-semaphore-wait-threshold=1 --innodb-sys-semaphore-waits=1 ---innodb-instrument-semaphores=1 diff --git a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result deleted file mode 100644 index dc8fba41e0b..00000000000 --- a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result +++ /dev/null @@ -1,45 +0,0 @@ -# -# innodb_instrument_semaphores -# -# save the initial value -SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores; -# default -SELECT @@global.innodb_instrument_semaphores; -@@global.innodb_instrument_semaphores -0 - -# scope -SELECT @@session.innodb_instrument_semaphores; -ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable -SET @@global.innodb_instrument_semaphores=OFF; -SELECT @@global.innodb_instrument_semaphores; -@@global.innodb_instrument_semaphores -0 -SET @@global.innodb_instrument_semaphores=ON; -SELECT @@global.innodb_instrument_semaphores; -@@global.innodb_instrument_semaphores -1 - -# valid values -SET @@global.innodb_instrument_semaphores='OFF'; -SELECT @@global.innodb_instrument_semaphores; -@@global.innodb_instrument_semaphores -0 -SET @@global.innodb_instrument_semaphores=ON; -SELECT @@global.innodb_instrument_semaphores; -@@global.innodb_instrument_semaphores -1 -SET @@global.innodb_instrument_semaphores=default; -SELECT @@global.innodb_instrument_semaphores; -@@global.innodb_instrument_semaphores -0 - -# invalid values -SET @@global.innodb_instrument_semaphores=NULL; -ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'NULL' -SET @@global.innodb_instrument_semaphores='junk'; -ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'junk' - -# restore the initial value -SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved; -# End of test diff --git a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result index dc8fba41e0b..561ddeb5a84 100644 --- a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result @@ -12,24 +12,34 @@ SELECT @@global.innodb_instrument_semaphores; SELECT @@session.innodb_instrument_semaphores; ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable SET @@global.innodb_instrument_semaphores=OFF; +Warnings: +Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3. SELECT @@global.innodb_instrument_semaphores; @@global.innodb_instrument_semaphores 0 SET @@global.innodb_instrument_semaphores=ON; +Warnings: +Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3. SELECT @@global.innodb_instrument_semaphores; @@global.innodb_instrument_semaphores 1 # valid values SET @@global.innodb_instrument_semaphores='OFF'; +Warnings: +Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3. SELECT @@global.innodb_instrument_semaphores; @@global.innodb_instrument_semaphores 0 SET @@global.innodb_instrument_semaphores=ON; +Warnings: +Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3. SELECT @@global.innodb_instrument_semaphores; @@global.innodb_instrument_semaphores 1 SET @@global.innodb_instrument_semaphores=default; +Warnings: +Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3. SELECT @@global.innodb_instrument_semaphores; @@global.innodb_instrument_semaphores 0 @@ -42,4 +52,6 @@ ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value o # restore the initial value SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved; +Warnings: +Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3. # End of test diff --git a/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result index 6ab0a19fb57..855bccad522 100644 --- a/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result @@ -8,7 +8,7 @@ COUNT(@@GLOBAL.innodb_use_trim) 1 Expected SET @@GLOBAL.innodb_use_trim=1; Warnings: -Warning 131 Using innodb_use_trim is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html +Warning 131 Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3. SELECT COUNT(@@GLOBAL.innodb_use_trim); COUNT(@@GLOBAL.innodb_use_trim) 1 @@ -31,7 +31,7 @@ COUNT(VARIABLE_VALUE) 1 Expected SET @@global.innodb_use_trim = @start_use_trim; Warnings: -Warning 131 Using innodb_use_trim is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html +Warning 131 Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3. SELECT @@global.innodb_use_trim; @@global.innodb_use_trim 1 diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 9394692b526..edd8cc673ba 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1301,7 +1301,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Enable semaphore request instrumentation. This could have some effect on performance but allows better information on long semaphore wait problems. (Default: not enabled) +VARIABLE_COMMENT DEPRECATED. This setting has no effect. NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ded2105da05..f4ddcf3dbb4 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3751,7 +3751,15 @@ static const char* deprecated_file_format_max /** Deprecation message about innodb_use_trim */ static const char* deprecated_use_trim - = DEPRECATED_FORMAT_PARAMETER("innodb_use_trim"); + = "Using innodb_use_trim is deprecated" + " and the parameter will be removed in MariaDB 10.3."; + +/** Deprecation message about innodb_instrument_semaphores */ +static const char* deprecated_instrument_semaphores + = "Using innodb_instrument_semaphores is deprecated" + " and the parameter will be removed in MariaDB 10.3."; + +static my_bool innodb_instrument_semaphores; /** Update log_checksum_algorithm_ptr with a pointer to the function corresponding to whether checksums are enabled. @@ -4108,6 +4116,10 @@ innobase_init( ib::warn() << deprecated_file_format; } + if (innodb_instrument_semaphores) { + ib::warn() << deprecated_instrument_semaphores; + } + /* Validate the file format by animal name */ if (innobase_file_format_name != NULL) { @@ -20620,6 +20632,25 @@ innodb_use_trim_update( HA_ERR_WRONG_COMMAND, deprecated_use_trim); } +/** Update the innodb_instrument_sempahores parameter. +@param[in] thd thread handle +@param[in] var system variable +@param[out] var_ptr current value +@param[in] save immediate result from check function */ +static +void +innodb_instrument_semaphores_update( + THD* thd, + struct st_mysql_sys_var* var, + void* var_ptr, + const void* save) +{ + innodb_instrument_semaphores = *static_cast<const my_bool*>(save); + + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_WRONG_COMMAND, deprecated_instrument_semaphores); +} + /* plugin options */ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, @@ -21833,11 +21864,10 @@ static MYSQL_SYSVAR_BOOL(debug_force_scrubbing, NULL, NULL, FALSE); #endif /* UNIV_DEBUG */ -static MYSQL_SYSVAR_BOOL(instrument_semaphores, srv_instrument_semaphores, +static MYSQL_SYSVAR_BOOL(instrument_semaphores, innodb_instrument_semaphores, PLUGIN_VAR_OPCMDARG, - "Enable semaphore request instrumentation. This could have some effect on performance but allows better" - " information on long semaphore wait problems. (Default: not enabled)", - 0, 0, FALSE); + "DEPRECATED. This setting has no effect.", + NULL, innodb_instrument_semaphores_update, FALSE); static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(autoextend_increment), diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index a8c962d4a45..cbf01564cce 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -571,9 +571,6 @@ that semaphore times out in InnoDB */ #define DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT 600 extern ulong srv_fatal_semaphore_wait_threshold; -/** Enable semaphore request instrumentation */ -extern my_bool srv_instrument_semaphores; - /** Buffer pool dump status frequence in percentages */ extern ulong srv_buf_dump_status_frequency; diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h index 9a9da2d145a..79532790f76 100644 --- a/storage/innobase/include/sync0rw.h +++ b/storage/innobase/include/sync0rw.h @@ -2,6 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. +Copyright (c) 2017, MariaDB Corporation. All Rights Reserved. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -38,9 +39,6 @@ Created 9/11/1995 Heikki Tuuri #include "os0event.h" #include "ut0mutex.h" -/** Enable semaphore request instrumentation */ -extern my_bool srv_instrument_semaphores; - /** Counters for RW locks. */ struct rw_lock_stats_t { typedef ib_counter_t<int64_t, IB_N_SLOTS> int64_counter_t; @@ -127,10 +125,10 @@ if MySQL performance schema is enabled and "UNIV_PFS_RWLOCK" is defined, the rwlock are instrumented with performance schema probes. */ # ifdef UNIV_DEBUG # define rw_lock_create(K, L, level) \ - rw_lock_create_func((L), (level), #L, __FILE__, __LINE__) + rw_lock_create_func((L), (level), __FILE__, __LINE__) # else /* UNIV_DEBUG */ # define rw_lock_create(K, L, level) \ - rw_lock_create_func((L), #L, __FILE__, __LINE__) + rw_lock_create_func((L), __FILE__, __LINE__) # endif /* UNIV_DEBUG */ /**************************************************************//** @@ -215,10 +213,10 @@ unlocking, not the corresponding function. */ /* Following macros point to Performance Schema instrumented functions. */ # ifdef UNIV_DEBUG # define rw_lock_create(K, L, level) \ - pfs_rw_lock_create_func((K), (L), (level), #L, __FILE__, __LINE__) + pfs_rw_lock_create_func((K), (L), (level), __FILE__, __LINE__) # else /* UNIV_DEBUG */ # define rw_lock_create(K, L, level) \ - pfs_rw_lock_create_func((K), (L), #L, __FILE__, __LINE__) + pfs_rw_lock_create_func((K), (L), __FILE__, __LINE__) # endif /* UNIV_DEBUG */ /****************************************************************** @@ -303,7 +301,6 @@ rw_lock_create_func( #ifdef UNIV_DEBUG latch_level_t level, /*!< in: level */ #endif /* UNIV_DEBUG */ - const char* cmutex_name, /*!< in: mutex name */ const char* cfile_name, /*!< in: file name where created */ ulint cline); /*!< in: file line where created */ /******************************************************************//** @@ -637,11 +634,6 @@ struct rw_lock_t /** Line number where last time x-locked */ unsigned last_x_line:14; - const char* lock_name; - const char* file_name;/*!< File name where the lock was obtained */ - ulint line; /*!< Line where the rw-lock was locked */ - os_thread_id_t thread_id; - /** Count of os_waits. May not be accurate */ uint32_t count_os_wait; @@ -744,7 +736,6 @@ pfs_rw_lock_create_func( #ifdef UNIV_DEBUG latch_level_t level, /*!< in: level */ #endif /* UNIV_DEBUG */ - const char* cmutex_name, /*!< in: mutex name */ const char* cfile_name, /*!< in: file name where created */ ulint cline); /*!< in: file line where created */ diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic index d67e26d961d..0d2c28d9d19 100644 --- a/storage/innobase/include/sync0rw.ic +++ b/storage/innobase/include/sync0rw.ic @@ -2,6 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. +Copyright (c) 2017, MariaDB Corporation. All Rights Reserved. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -250,14 +251,6 @@ rw_lock_s_lock_low( lock->last_s_file_name = file_name; lock->last_s_line = line; - /* - if (srv_instrument_semaphores) { - lock->thread_id = os_thread_get_curr_id(); - lock->file_name = file_name; - lock->line = line; - } - */ - return(TRUE); /* locking succeeded */ } @@ -342,14 +335,6 @@ rw_lock_x_lock_func_nowait( ut_d(rw_lock_add_debug_info(lock, 0, RW_LOCK_X, file_name, line)); - /* - if (srv_instrument_semaphores) { - lock->thread_id = os_thread_get_curr_id(); - lock->file_name = file_name; - lock->line = line; - } - */ - lock->last_x_file_name = file_name; lock->last_x_line = line; @@ -507,7 +492,6 @@ pfs_rw_lock_create_func( # ifdef UNIV_DEBUG latch_level_t level, /*!< in: level */ # endif /* UNIV_DEBUG */ - const char* cmutex_name, /*!< in: mutex name */ const char* cfile_name, /*!< in: file name where created */ ulint cline) /*!< in: file line where created */ { @@ -521,7 +505,6 @@ pfs_rw_lock_create_func( #ifdef UNIV_DEBUG level, #endif /* UNIV_DEBUG */ - cmutex_name, cfile_name, cline); } diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index a884b5c1bad..0d249dfd824 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -507,9 +507,6 @@ thread ensures that we flush the log files at least once per second. */ static time_t srv_last_log_flush_time; -/** Enable semaphore request instrumentation */ -UNIV_INTERN my_bool srv_instrument_semaphores = FALSE; - /* Interval in seconds at which various tasks are performed by the master thread when server is active. In order to balance the workload, we should try to keep intervals such that they are not multiple of diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc index 5cb90ce5b8d..9160d9c8bee 100644 --- a/storage/innobase/sync/sync0rw.cc +++ b/storage/innobase/sync/sync0rw.cc @@ -202,7 +202,6 @@ rw_lock_create_func( #ifdef UNIV_DEBUG latch_level_t level, /*!< in: level */ #endif /* UNIV_DEBUG */ - const char* cmutex_name, /*!< in: mutex name */ const char* cfile_name, /*!< in: file name where created */ ulint cline) /*!< in: file line where created */ { @@ -238,10 +237,7 @@ rw_lock_create_func( less than 8192. cline is unsigned:13. */ ut_ad(cline <= 8192); lock->cline = (unsigned int) cline; - lock->lock_name = cmutex_name; lock->count_os_wait = 0; - lock->file_name = "not yet reserved"; - lock->line = 0; lock->last_s_file_name = "not yet reserved"; lock->last_x_file_name = "not yet reserved"; lock->last_s_line = 0; @@ -479,12 +475,6 @@ rw_lock_x_lock_wait_func( ut_d(rw_lock_remove_debug_info( lock, pass, RW_LOCK_X_WAIT)); - if (srv_instrument_semaphores) { - lock->thread_id = os_thread_get_curr_id(); - lock->file_name = file_name; - lock->line = line; - } - /* It is possible to wake when lock_word < 0. We must pass the while-loop check to proceed.*/ @@ -587,13 +577,6 @@ rw_lock_x_lock_low( ut_d(rw_lock_add_debug_info(lock, pass, RW_LOCK_X, file_name, line)); - - if (srv_instrument_semaphores) { - lock->thread_id = os_thread_get_curr_id(); - lock->file_name = file_name; - lock->line = line; - } - lock->last_x_file_name = file_name; lock->last_x_line = (unsigned int) line; |