From c7ad886a7039306aeb591e542e827a68c3302e29 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Sun, 15 Jun 2014 13:53:43 -0400 Subject: [PATCH] MDEV#6296: runtime adjustment of wsrep_slave_threads creates threads but never removes them When wsrep_slave_threads is changed at runtime, the old "change" value is not taken into account and thus successive SETs can make wsrep_slave_threads value inconsistent with the actual number of applier threads present. --- sql/wsrep_var.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 319c5fca979..8aa2c9f321b 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -453,7 +453,7 @@ void wsrep_node_address_init (const char* value) bool wsrep_slave_threads_check (sys_var *self, THD* thd, set_var* var) { mysql_mutex_lock(&LOCK_wsrep_slave_threads); - wsrep_slave_count_change = var->value->val_int() - wsrep_slave_threads; + wsrep_slave_count_change += (var->value->val_int() - wsrep_slave_threads); mysql_mutex_unlock(&LOCK_wsrep_slave_threads); return 0;