summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-02-28 12:42:45 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-02-28 12:42:45 +0200
commit6cf29ab0df3131d097b9f811d8a887b54d1afca5 (patch)
tree2236238339cff253472045674efc2e0211ebff52 /storage/innobase
parentc1bcb2055ebab1e9d3e0e99b3626f78d477badd1 (diff)
downloadmariadb-git-6cf29ab0df3131d097b9f811d8a887b54d1afca5.tar.gz
MDEV-12146 Deprecate and remove innodb_instrument_semaphores
MDEV-7618 introduced configuration parameter innodb_instrument_semaphores in MariaDB Server 10.1. The parameter seems to only affect the rw-lock X-latch acquisition. Extra fields are added to rw_lock_t to remember one X-latch holder or waiter. These fields are not being consulted or reported anywhere. This is basically only adding code bloat. If the intention is to debug hangs or deadlocks, we have better tools for that in the debug server, and for the non-debug server, core dumps can reveal a lot. For example, the mini-transaction memo records the currently held buffer block or index rw-locks, to be released at mtr_t::commit(). The configuration parameter innodb_instrument_semaphores will be deprecated in 10.2.5 and removed in 10.3.0. rw_lock_t: Remove the members lock_name, file_name, line, thread_id which did not affect any output.
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/handler/ha_innodb.cc40
-rw-r--r--storage/innobase/include/srv0srv.h3
-rw-r--r--storage/innobase/include/sync0rw.h19
-rw-r--r--storage/innobase/include/sync0rw.ic19
-rw-r--r--storage/innobase/srv/srv0srv.cc3
-rw-r--r--storage/innobase/sync/sync0rw.cc17
6 files changed, 41 insertions, 60 deletions
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;