From 0d6fb43e6d6ca1eb9060d7369efcbabcda324f1e Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 2 May 2019 16:49:47 +0300 Subject: Fixed some compilation warnings/errors --- sql/mysqld.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 212ab8e2a13..f0ffa7eae8c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3043,9 +3043,8 @@ static bool cache_thread(THD *thd) Create new instrumentation for the new THD job, and attach it to this running pthread. */ - PSI_thread *psi= PSI_CALL_new_thread(key_thread_one_connection, - thd, thd->thread_id); - PSI_CALL_set_thread(psi); + PSI_CALL_set_thread(PSI_CALL_new_thread(key_thread_one_connection, + thd, thd->thread_id)); /* reset abort flag for the thread */ thd->mysys_var->abort= 0; -- cgit v1.2.1 From 2be28a91b15010c5e6146e78e78fbe10a9b86153 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 15 Mar 2019 11:52:26 +0400 Subject: Cleanup session tracker API - Session_sysvars_tracker::server_init_check() -> sysvartrack_validate_value() - Session_sysvars_tracker::check_var_list() -> sysvartrack_validate_value() - Session_sysvars_tracker::server_init_process() -> sysvartrack_global_update() - sysvartrack_reprint_value() -> sysvartrack_global_update() - sysvartrack_value_len() -> sysvartrack_session_value_ptr() - sysvartrack_value_construct() -> sysvartrack_session_value_ptr() - sysvartrack_update() -> Session_sysvars_tracker::update() - Session_tracker::server_boot_verify() -> session_tracker_init() - sysvar_tracker() -> /dev/null Part of MDEV-14984 - regression in connect performance --- sql/mysqld.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f0ffa7eae8c..73dd7ce36af 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5420,14 +5420,8 @@ static int init_server_components() #endif #ifndef EMBEDDED_LIBRARY - { - if (Session_tracker::server_boot_verify(system_charset_info)) - { - sql_print_error("The variable session_track_system_variables has " - "invalid values."); - unireg_abort(1); - } - } + if (session_tracker_init()) + return 1; #endif //EMBEDDED_LIBRARY /* we do want to exit if there are any other unknown options */ -- cgit v1.2.1 From 779fb636daf4c127dbb90f75bab004ac1bbe12df Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 20 Mar 2019 18:35:20 +0400 Subject: Revert THD::THD(skip_global_sys_var_lock) argument Originally introduced by e972125f1 to avoid harmless wait for LOCK_global_system_variables in a newly created thread, which creation was initiated by system variable update. At the same time it opens dangerous hole, when system variable update thread already released LOCK_global_system_variables and ack_receiver thread haven't yet completed new THD construction. In this case THD constructor goes completely unprotected. Since ack_receiver.stop() waits for the thread to go down, we have to temporarily release LOCK_global_system_variables so that it doesn't deadlock with ack_receiver.run(). Unfortunately it breaks atomicity of rpl_semi_sync_master_enabled updates and makes them not serialized. LOCK_rpl_semi_sync_master_enabled was introduced to workaround the above. TODO: move ack_receiver start/stop into repl_semisync_master enable_master/disable_master under LOCK_binlog protection? Part of MDEV-14984 - regression in connect performance --- sql/mysqld.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 73dd7ce36af..4f5026fd3b5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -941,6 +941,7 @@ PSI_mutex_key key_LOCK_relaylog_end_pos; PSI_mutex_key key_LOCK_thread_id; PSI_mutex_key key_LOCK_slave_state, key_LOCK_binlog_state, key_LOCK_rpl_thread, key_LOCK_rpl_thread_pool, key_LOCK_parallel_entry; +PSI_mutex_key key_LOCK_rpl_semi_sync_master_enabled; PSI_mutex_key key_LOCK_binlog; PSI_mutex_key key_LOCK_stats, @@ -1038,6 +1039,7 @@ static PSI_mutex_info all_server_mutexes[]= { &key_LOCK_rpl_thread_pool, "LOCK_rpl_thread_pool", 0}, { &key_LOCK_parallel_entry, "LOCK_parallel_entry", 0}, { &key_LOCK_ack_receiver, "Ack_receiver::mutex", 0}, + { &key_LOCK_rpl_semi_sync_master_enabled, "LOCK_rpl_semi_sync_master_enabled", 0}, { &key_LOCK_binlog, "LOCK_binlog", 0} }; -- cgit v1.2.1