Commit 08e7444e authored by Yasufumi Kinoshita's avatar Yasufumi Kinoshita

Bug#11758510 (#50723): INNODB CHECK TABLE FATAL SEMAPHORE WAIT TIMEOUT POSSIBLY TOO SHORT FOR BI

Fixed not to check timeout during the check table.
parent 1a2cf649
...@@ -150,7 +150,7 @@ dict_print(void) ...@@ -150,7 +150,7 @@ dict_print(void)
monitor printout */ monitor printout */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
...@@ -178,7 +178,7 @@ dict_print(void) ...@@ -178,7 +178,7 @@ dict_print(void)
/* Restore the fatal semaphore wait timeout */ /* Restore the fatal semaphore wait timeout */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
return; return;
......
...@@ -173,6 +173,7 @@ extern ibool srv_print_latch_waits; ...@@ -173,6 +173,7 @@ extern ibool srv_print_latch_waits;
extern ulint srv_activity_count; extern ulint srv_activity_count;
extern ulint srv_fatal_semaphore_wait_threshold; extern ulint srv_fatal_semaphore_wait_threshold;
#define SRV_SEMAPHORE_WAIT_EXTENSION 7200
extern ulint srv_dml_needed_delay; extern ulint srv_dml_needed_delay;
extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
......
...@@ -4165,7 +4165,7 @@ row_check_table_for_mysql( ...@@ -4165,7 +4165,7 @@ row_check_table_for_mysql(
/* Enlarge the fatal lock wait timeout during CHECK TABLE. */ /* Enlarge the fatal lock wait timeout during CHECK TABLE. */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
index = dict_table_get_first_index(table); index = dict_table_get_first_index(table);
...@@ -4223,7 +4223,7 @@ row_check_table_for_mysql( ...@@ -4223,7 +4223,7 @@ row_check_table_for_mysql(
/* Restore the fatal lock wait timeout after CHECK TABLE. */ /* Restore the fatal lock wait timeout after CHECK TABLE. */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
prebuilt->trx->op_info = ""; prebuilt->trx->op_info = "";
......
...@@ -931,6 +931,11 @@ sync_array_print_long_waits( ...@@ -931,6 +931,11 @@ sync_array_print_long_waits(
ibool fatal = FALSE; ibool fatal = FALSE;
double longest_diff = 0; double longest_diff = 0;
/* For huge tables, skip the check during CHECK TABLE etc... */
if (fatal_timeout > SRV_SEMAPHORE_WAIT_EXTENSION) {
return(FALSE);
}
for (i = 0; i < sync_primary_wait_array->n_cells; i++) { for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
double diff; double diff;
......
...@@ -164,7 +164,7 @@ dict_print(void) ...@@ -164,7 +164,7 @@ dict_print(void)
monitor printout */ monitor printout */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
...@@ -192,7 +192,7 @@ dict_print(void) ...@@ -192,7 +192,7 @@ dict_print(void)
/* Restore the fatal semaphore wait timeout */ /* Restore the fatal semaphore wait timeout */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
return; return;
......
...@@ -8148,7 +8148,7 @@ ha_innobase::check( ...@@ -8148,7 +8148,7 @@ ha_innobase::check(
/* Enlarge the fatal lock wait timeout during CHECK TABLE. */ /* Enlarge the fatal lock wait timeout during CHECK TABLE. */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
for (index = dict_table_get_first_index(prebuilt->table); for (index = dict_table_get_first_index(prebuilt->table);
...@@ -8244,7 +8244,7 @@ ha_innobase::check( ...@@ -8244,7 +8244,7 @@ ha_innobase::check(
/* Restore the fatal lock wait timeout after CHECK TABLE. */ /* Restore the fatal lock wait timeout after CHECK TABLE. */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
prebuilt->trx->op_info = ""; prebuilt->trx->op_info = "";
......
...@@ -244,6 +244,7 @@ extern ibool srv_print_latch_waits; ...@@ -244,6 +244,7 @@ extern ibool srv_print_latch_waits;
extern ulint srv_activity_count; extern ulint srv_activity_count;
extern ulint srv_fatal_semaphore_wait_threshold; extern ulint srv_fatal_semaphore_wait_threshold;
#define SRV_SEMAPHORE_WAIT_EXTENSION 7200
extern ulint srv_dml_needed_delay; extern ulint srv_dml_needed_delay;
extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
......
...@@ -927,6 +927,11 @@ sync_array_print_long_waits( ...@@ -927,6 +927,11 @@ sync_array_print_long_waits(
ibool fatal = FALSE; ibool fatal = FALSE;
double longest_diff = 0; double longest_diff = 0;
/* For huge tables, skip the check during CHECK TABLE etc... */
if (fatal_timeout > SRV_SEMAPHORE_WAIT_EXTENSION) {
return(FALSE);
}
for (i = 0; i < sync_primary_wait_array->n_cells; i++) { for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
double diff; double diff;
......
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