summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0srv.cc41
-rw-r--r--storage/innobase/srv/srv0start.cc28
2 files changed, 9 insertions, 60 deletions
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index d176a69bee6..bb9b62dcde1 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -838,11 +838,11 @@ srv_printf_innodb_monitor(
"-----------------\n", file);
srv_print_master_thread_info(file);
+ /* This section is intentionally left blank, for tools like "innotop" */
fputs("----------\n"
"SEMAPHORES\n"
"----------\n", file);
-
- sync_array_print(file);
+ /* End of intentionally blank section */
/* Conceptually, srv_innodb_monitor_mutex has a very high latching
order level in sync0sync.h, while dict_foreign_err_mutex has a very
@@ -1347,21 +1347,11 @@ static void srv_monitor()
srv_refresh_innodb_monitor_stats(current_time);
}
-/*********************************************************************//**
-A task which prints warnings about semaphore waits which have lasted
-too long. These can be used to track bugs which cause hangs.
-*/
+/** Periodic task which prints the info output by various InnoDB monitors.*/
void srv_monitor_task(void*)
{
/* number of successive fatal timeouts observed */
- static ulint fatal_cnt;
static lsn_t old_lsn = recv_sys.recovered_lsn;
- /* longest waiting thread for a semaphore */
- os_thread_id_t waiter;
- static os_thread_id_t old_waiter = os_thread_get_curr_id();
- /* the semaphore that is being waited for */
- const void* sema = NULL;
- static const void* old_sema = NULL;
ut_ad(!srv_read_only_mode);
@@ -1383,31 +1373,6 @@ void srv_monitor_task(void*)
eviction policy. */
buf_LRU_stat_update();
- if (sync_array_print_long_waits(&waiter, &sema)
- && sema == old_sema && os_thread_eq(waiter, old_waiter)) {
-#if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES)
- if (UNIV_UNLIKELY(innodb_disallow_writes)) {
- fprintf(stderr,
- "WSREP: avoiding InnoDB self crash due to "
- "long semaphore wait of > %lu seconds\n"
- "Server is processing SST donor operation, "
- "fatal_cnt now: " ULINTPF,
- srv_fatal_semaphore_wait_threshold, fatal_cnt);
- return;
- }
-#endif /* WITH_WSREP */
- if (fatal_cnt++) {
- ib::fatal() << "Semaphore wait has lasted > "
- << srv_fatal_semaphore_wait_threshold
- << " seconds. We intentionally crash the"
- " server because it appears to be hung.";
- }
- } else {
- fatal_cnt = 0;
- old_waiter = waiter;
- old_sema = sema;
- }
-
srv_monitor();
}
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index fa9484d8545..b8a1a4e2cfc 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -100,7 +100,7 @@ Created 2/16/1996 Heikki Tuuri
#include "ut0crc32.h"
/** We are prepared for a situation that we have this many threads waiting for
-a semaphore inside InnoDB. srv_start() sets the value. */
+a transactional lock inside InnoDB. srv_start() sets the value. */
ulint srv_max_n_threads;
/** Log sequence number at shutdown */
@@ -1109,27 +1109,11 @@ dberr_t srv_start(bool create_new_db)
mysql_stage_register("innodb", srv_stages,
static_cast<int>(UT_ARR_SIZE(srv_stages)));
- /* Set the maximum number of threads which can wait for a semaphore
- inside InnoDB: this is the 'sync wait array' size */
-
- srv_max_n_threads = 1 /* io_ibuf_thread */
- + 1 /* io_log_thread */
- + 1 /* srv_print_monitor_task */
- + 1 /* srv_purge_coordinator_thread */
- + 1 /* buf_dump_thread */
- + 1 /* dict_stats_thread */
- + 1 /* fts_optimize_thread */
- + 1 /* trx_rollback_all_recovered */
- + 128 /* added as margin, for use of
- InnoDB Memcached etc. */
- + 1/* buf_flush_page_cleaner */
- + max_connections
- + srv_n_read_io_threads
- + srv_n_write_io_threads
- + srv_n_purge_threads
- /* FTS Parallel Sort */
- + fts_sort_pll_degree * FTS_NUM_AUX_INDEX
- * max_connections;
+ srv_max_n_threads =
+ 1 /* dict_stats_thread */
+ + 1 /* fts_optimize_thread */
+ + 128 /* safety margin */
+ + max_connections;
srv_boot();