Commit 61c8e6ca authored by unknown's avatar unknown

Bug #20358: InnoDB hang on the adaptive hash index latch in btr0sea.c

Add --skip-innodb-adaptive-hash-index option, which is a way to
work around the bug (by disabling the adaptive hash feature entirely).

This may be useful even once the bug is fixed, for benchmarking purposes.
There are some workloads for which the adaptive hash index is not effective.


sql/ha_innodb.cc:
  Add --skip-innodb-adaptive-hash-index option.
sql/ha_innodb.h:
  Add --skip-innodb-adaptive-hash-index option.
sql/mysqld.cc:
  Add --skip-innodb-adaptive-hash-index option.
sql/set_var.cc:
  Add --skip-innodb-adaptive-hash-index option.
parent 478fb4a1
......@@ -174,6 +174,7 @@ my_bool innobase_file_per_table = FALSE;
my_bool innobase_locks_unsafe_for_binlog = FALSE;
my_bool innobase_rollback_on_timeout = FALSE;
my_bool innobase_create_status_file = FALSE;
my_bool innobase_adaptive_hash_index = TRUE;
static char *internal_innobase_data_file_path = NULL;
......@@ -1376,6 +1377,8 @@ innobase_init(void)
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums;
srv_use_adaptive_hash_indexes = (ibool) innobase_adaptive_hash_index;
os_use_large_pages = (ibool) innobase_use_large_pages;
os_large_page_size = (ulint) innobase_large_page_size;
......
......@@ -217,7 +217,8 @@ extern my_bool innobase_log_archive,
innobase_use_native_aio,
innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_rollback_on_timeout,
innobase_create_status_file;
innobase_create_status_file,
innobase_adaptive_hash_index;
extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
calling innobase_end() if you want
InnoDB to shut down without
......
......@@ -4829,7 +4829,8 @@ enum options_mysqld
OPT_MERGE,
OPT_INNODB_ROLLBACK_ON_TIMEOUT,
OPT_SECURE_FILE_PRIV,
OPT_KEEP_FILES_ON_CREATE
OPT_KEEP_FILES_ON_CREATE,
OPT_INNODB_ADAPTIVE_HASH_INDEX
};
......@@ -5057,6 +5058,12 @@ Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums,
"The common part for InnoDB table spaces.", (gptr*) &innobase_data_home_dir,
(gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"innodb_adaptive_hash_index", OPT_INNODB_ADAPTIVE_HASH_INDEX,
"Enable InnoDB adaptive hash index (enabled by default). "
"Disable with --skip-innodb-adaptive-hash-index.",
(gptr*) &innobase_adaptive_hash_index,
(gptr*) &innobase_adaptive_hash_index,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \
Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
(gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
......
......@@ -901,6 +901,7 @@ struct show_var_st init_vars[]= {
{sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},
{"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
{"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
{"innodb_adaptive_hash_index", (char*) &innobase_adaptive_hash_index, SHOW_MY_BOOL},
{"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL},
{sys_innodb_fast_shutdown.name,(char*) &sys_innodb_fast_shutdown, SHOW_SYS},
{"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment