summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-01-16 13:18:44 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2020-01-17 12:51:18 +0200
commitc4195305b2a8431f39a4c75cc1c66ba43685f7a0 (patch)
treee9e2245c9d840a283313a070adc4a52194af8baf /sql/wsrep_var.cc
parentb04429434ad1ee7f49d263762a560f4ff31dd111 (diff)
downloadmariadb-git-c4195305b2a8431f39a4c75cc1c66ba43685f7a0.tar.gz
MDEV-17062 : Test failure on galera.MW-336
Add mutex protection while we calculate required slave thread change and create them. Add error handling.
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r--sql/wsrep_var.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 0f7f7ef2acf..9777cc6ec62 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -602,16 +602,22 @@ static void wsrep_slave_count_change_update ()
bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type)
{
+ mysql_mutex_lock(&LOCK_thread_count);
+ bool res= false;
+
wsrep_slave_count_change_update();
if (wsrep_slave_count_change > 0)
{
WSREP_DEBUG("Creating %d applier threads, total %ld", wsrep_slave_count_change, wsrep_slave_threads);
- wsrep_create_appliers(wsrep_slave_count_change);
+ res= wsrep_create_appliers(wsrep_slave_count_change, true);
WSREP_DEBUG("Running %lu applier threads", wsrep_running_applier_threads);
wsrep_slave_count_change = 0;
}
- return false;
+
+ mysql_mutex_unlock(&LOCK_thread_count);
+
+ return res;
}
bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var)