summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2017-02-08 23:36:34 +0100
committerJan Lindström <jan.lindstrom@mariadb.com>2017-08-11 12:31:26 +0300
commit364b15c090e7337eb752eec4bea239052f73b2ed (patch)
tree2d886478eaa0a9ef662d3298b839da71131a8127 /sql/sys_vars.cc
parent7af44d7aa07e1678bb48d4f4b9ce2c809b611079 (diff)
downloadmariadb-git-364b15c090e7337eb752eec4bea239052f73b2ed.tar.gz
MW-336 Avoid slave threads leaking
This patch fixes two problems that may arise when changing the value of wsrep_slave_threads: 1) Threads may be leaked if wsrep_slave_threads is changed repeatedly. Specifically, when changing the number of slave threads, we keep track of wsrep_slave_count_change, the number of slaves to start / stop. The problem arises when wsrep_slave_count_change is updated before slaves had a chance to exit (threads may take some time to exit, as they exit only after commiting one more replication event). The fix is to update wsrep_slave_count_change such that it reflects the number of threads that already exited or are scheduled to exit. 2) Attempting to set out of range value for wsrep_slave_threads (below 1 / above 512) results in wsrep_slave_count_change to be computed based on the out of range value, even though a warning is generated and wsrep_slave_threads is set to a truncated value. wsrep_slave_count_change is computed in wsrep_slave_threads_check(), which is called before mysql checks for valid range. Fix is to update wsrep_count_change whenever wsrep_slave_threads is updated with a valid value.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 000a424faeb..e234d441b78 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -4568,7 +4568,7 @@ static Sys_var_ulong Sys_wsrep_slave_threads(
GLOBAL_VAR(wsrep_slave_threads), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1, 512), DEFAULT(1), BLOCK_SIZE(1),
&PLock_wsrep_slave_threads, NOT_IN_BINLOG,
- ON_CHECK(wsrep_slave_threads_check),
+ ON_CHECK(NULL),
ON_UPDATE(wsrep_slave_threads_update));
static Sys_var_charptr Sys_wsrep_dbug_option(