diff options
author | seppo <seppo.jaakola@iki.fi> | 2019-02-26 20:39:05 +0200 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-02-26 13:39:05 -0500 |
commit | 785092ee23e8e87fa89effc7baa57191519c2d34 (patch) | |
tree | eb0b19bf3c4780641861896fd0d516f314f954a9 /sql/wsrep_var.cc | |
parent | bb970dda77ff170e9d5850b885ba968294437020 (diff) | |
download | mariadb-git-785092ee23e8e87fa89effc7baa57191519c2d34.tar.gz |
LOCK_thread_count and COND_thread_count removed from wsrep modules (#1197)
Refactored wsrep patch to not use LOCK_thread_count and COND_thread_count anymore.
This has partially been replaced by using old LOCK_wsrep_slave_threads mutex.
For slave thread count change waiting, new COND_wsrep_slave_threads signal has been added
Added LOCK_wsrep_cluster_config mutex to control that cluster address change cannot happen in parallel
Protected wsrep_slave_threads variable changes with LOCK_cluster_config mutex
This is for avoiding concurrent slave thread count and cluster joining operations to happen
Fixes according to Teemu's review
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r-- | sql/wsrep_var.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index d091348f481..d73daf7c9f8 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -478,23 +478,24 @@ bool wsrep_cluster_address_update (sys_var *self, THD* thd, enum_var_type type) Note: releasing LOCK_global_system_variables may cause race condition, if there can be several concurrent clients changing wsrep_provider */ + WSREP_DEBUG("wsrep_cluster_address_update: %s", wsrep_cluster_address); mysql_mutex_unlock(&LOCK_global_system_variables); wsrep_stop_replication(thd); - if (wsrep_start_replication()) { wsrep_create_rollbacker(); wsrep_create_appliers(wsrep_slave_threads); } - /* locking order to be enforced is: 1. LOCK_global_system_variables - 2. LOCK_wsrep_slave_threads + 2. LOCK_wsrep_cluster_config + => have to juggle mutexes to comply with this */ - mysql_mutex_unlock(&LOCK_wsrep_slave_threads); + + mysql_mutex_unlock(&LOCK_wsrep_cluster_config); mysql_mutex_lock(&LOCK_global_system_variables); - mysql_mutex_lock(&LOCK_wsrep_slave_threads); + mysql_mutex_lock(&LOCK_wsrep_cluster_config); return false; } |