diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-01-16 13:18:44 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-01-20 15:54:30 +0200 |
commit | 57ec527841c170f49a79fc34f3dcf68e48e24483 (patch) | |
tree | a06bd96eddb3d89996c417a7016961826c27de0b /sql/wsrep_var.cc | |
parent | 87a61355e8e499baf7908862711c26aa0225bf32 (diff) | |
download | mariadb-git-57ec527841c170f49a79fc34f3dcf68e48e24483.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.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 315cfe2c53e..5f76f650b34 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -594,15 +594,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_wsrep_slave_threads); + 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_wsrep_slave_threads); + + return res; } bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) |