diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-01-27 17:46:31 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-01-29 07:33:52 +0000 |
commit | 7cdf759c86a3b80bf215fcc6baab87b930425170 (patch) | |
tree | fa541cde13156bd523bb9884ed5f163905aa519d /sql/mysqld.h | |
parent | 1da063a45bc43ac2c5761d8e091e55b8cac123cf (diff) | |
download | mariadb-git-7cdf759c86a3b80bf215fcc6baab87b930425170.tar.gz |
MDEV-14485 Server hangs on startup in THD::init
Solve 3 way deadlock between plugin_initialiaze(), THD::init() and
mysql_sys_var_char().
The deadlock exists because of the lock order inversion between
LOCK_global_system_variables mutex and LOCK_system_variables_hash
read-write lock-
In this case, it is enough to change LOCK_system_variables_hash to prefer
reads to fix the deadlock, i.e change it to mysql_prlock_t
Diffstat (limited to 'sql/mysqld.h')
-rw-r--r-- | sql/mysqld.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/mysqld.h b/sql/mysqld.h index 912fe3696ae..310bc1dd342 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -577,7 +577,7 @@ extern mysql_mutex_t LOCK_des_key_file; extern mysql_mutex_t LOCK_server_started; extern mysql_cond_t COND_server_started; extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; -extern mysql_rwlock_t LOCK_system_variables_hash; +extern mysql_prlock_t LOCK_system_variables_hash; extern mysql_cond_t COND_thread_count, COND_start_thread; extern mysql_cond_t COND_manager; extern mysql_cond_t COND_slave_background; |