[Commits] 6bd6d0a: MDEV-7798: mysql.server init script can't stop mysqld when WSREP is turned off

Nirbhay Choubey nirbhay at mariadb.com
Mon Mar 23 23:36:34 EET 2015


revision-id: 6bd6d0a60745f802d0b5af38b67a602429acaeb4
parent(s): 7a6cad5221b19ed5d54eaca83c16655089734a0e
committer: Nirbhay Choubey
branch nick: 5.5-galera-b7798
timestamp: 2015-03-23 17:36:33 -0400
message:

MDEV-7798: mysql.server init script can't stop mysqld when WSREP is turned off

wsrep threads should be always be checked for existence & stopped on
server shutdown.

---
 mysql-test/suite/wsrep/r/mdev_7798.result | 13 +++++++++++++
 mysql-test/suite/wsrep/t/mdev_7798.opt    |  1 +
 mysql-test/suite/wsrep/t/mdev_7798.test   | 17 +++++++++++++++++
 sql/mysqld.cc                             |  3 ++-
 4 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/mysql-test/suite/wsrep/r/mdev_7798.result b/mysql-test/suite/wsrep/r/mdev_7798.result
new file mode 100644
index 0000000..83a02f3
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mdev_7798.result
@@ -0,0 +1,13 @@
+#
+# MDEV-7798: mysql.server init script can't stop mysqld when WSREP is
+# turned off
+#
+SELECT @@GLOBAL.WSREP_ON;
+@@GLOBAL.WSREP_ON
+1
+SET GLOBAL WSREP_ON= 0;
+Restart the node.
+SELECT @@GLOBAL.WSREP_ON;
+@@GLOBAL.WSREP_ON
+1
+# End of test.
diff --git a/mysql-test/suite/wsrep/t/mdev_7798.opt b/mysql-test/suite/wsrep/t/mdev_7798.opt
new file mode 100644
index 0000000..459a970
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_7798.opt
@@ -0,0 +1 @@
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --wsrep_causal_reads=ON
diff --git a/mysql-test/suite/wsrep/t/mdev_7798.test b/mysql-test/suite/wsrep/t/mdev_7798.test
new file mode 100644
index 0000000..9dfff09
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_7798.test
@@ -0,0 +1,17 @@
+--source include/have_wsrep_provider.inc
+--source include/have_binlog_format_row.inc
+
+--echo #
+--echo # MDEV-7798: mysql.server init script can't stop mysqld when WSREP is
+--echo # turned off
+--echo #
+
+SELECT @@GLOBAL.WSREP_ON;
+SET GLOBAL WSREP_ON= 0;
+
+--echo Restart the node.
+--source include/restart_mysqld.inc
+
+SELECT @@GLOBAL.WSREP_ON;
+
+--echo # End of test.
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 857317a..6b960c6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1753,7 +1753,8 @@ static void __cdecl kill_server(int sig_ptr)
   }
 #endif
 #ifdef WITH_WSREP
-  if (WSREP_ON) wsrep_stop_replication(NULL);
+  /* Stop wsrep threads in case they are running. */
+  wsrep_stop_replication(NULL);
 #endif
 
   close_connections();


More information about the commits mailing list