From a10a9448b0902ca2e677f3274c06b6bf697ba3b5 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sat, 3 May 2014 19:12:17 +0300 Subject: Added new states to be able to better diagnose where server hangs. - Table locks now ends with state "After table lock" - Open table now ends with state "After opening tables" - All calls to close_thread_tables(), not only from mysql_execute_command(), has state "closing tables" - Added state "executing" for mysql admin commands, like CACHE INDEX, REPAIR TABLE etc. - Added state "Finding key cache" for CACHE INDEX - Added state "Filling schema table" when we generate temporary table for SHOW commands and information schema. Other things: Add limit from innobase for thread_sleep_delay. This fixed a failing tests case. Added db.opt to support-files to make 'make package' work mysql-test/suite/funcs_1/datadict/processlist_val.inc: Use new state mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result: Updated test result because of new state mysql-test/suite/funcs_1/r/processlist_val_no_prot.result: Updated test result because of new state sql/CMakeLists.txt: Have option files in support-files sql/lock.cc: Added new state 'After table lock' sql/sql_admin.cc: Added state "executing" and "Sending data" for mysql admin commands, like CACHE INDEX, REPAIR TABLE etc. Added state "Finding key cache" sql/sql_base.cc: open tables now ends with state "After table lock", instead of NULL sql/sql_parse.cc: Moved state "closing tables" to close_thread_tables() sql/sql_show.cc: Added state "Filling schema table" when we generate temporary table for SHOW commands and information schema. storage/xtradb/buf/buf0buf.c: Removed compiler warning storage/xtradb/handler/ha_innodb.cc: Add limit from innobase for thread_sleep_delay. This fixed a failing tests case. support-files/db.opt: cmakes needs this to create data/test directory --- sql/sql_admin.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/sql_admin.cc') diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 9beeca06945..92aa414b569 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -647,7 +647,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, } DBUG_PRINT("admin", ("calling operator_func '%s'", operator_name)); + thd_proc_info(thd, "executing"); result_code = (table->table->file->*operator_func)(thd, check_opt); + thd_proc_info(thd, "Sending data"); DBUG_PRINT("admin", ("operator_func returned: %d", result_code)); if (result_code == HA_ADMIN_NOT_IMPLEMENTED && need_repair_or_alter) @@ -769,8 +771,9 @@ send_result_message: "Table does not support optimize, doing recreate + analyze instead"), system_charset_info); } - if (protocol->write()) + if (protocol->write()) goto err; + thd_proc_info(thd, "recreating table"); DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze...")); TABLE_LIST *save_next_local= table->next_local, *save_next_global= table->next_global; @@ -975,6 +978,7 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables, KEY_CACHE *key_cache; DBUG_ENTER("mysql_assign_to_keycache"); + thd_proc_info(thd, "Finding key cache"); check_opt.init(); mysql_mutex_lock(&LOCK_global_system_variables); if (!(key_cache= get_key_cache(key_cache_name))) -- cgit v1.2.1