From 48a0a66ffa3241c91324606911f7964e956bc99f Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Mon, 27 Jun 2016 18:15:47 -0400 Subject: MDEV-10186: mysqld crash when runtime setting wsrep_cluster_address without wsrep_on=ON On wsrep_cluster_address update, node restarts the replication and attempts to connect to the new address. In this process it makes a call to wsrep provider's connect API, which could lead to segfault if wsrep provider is not loaded (wsrep_on=OFF). Fixed by making sure that it proceeds only if a provider is loaded. --- sql/wsrep_var.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sql/wsrep_var.cc') diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 9c01e54f48d..fb784cbcca3 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -348,7 +348,16 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var) bool wsrep_cluster_address_update (sys_var *self, THD* thd, enum_var_type type) { - bool wsrep_on_saved= thd->variables.wsrep_on; + bool wsrep_on_saved; + + /* Do not proceed if wsrep provider is not loaded. */ + if (!wsrep) + { + WSREP_INFO("wsrep provider is not loaded, can't re(start) replication."); + return false; + } + + wsrep_on_saved= thd->variables.wsrep_on; thd->variables.wsrep_on= false; /* stop replication is heavy operation, and includes closing all client -- cgit v1.2.1