From 7ff44b1a832b005264994cbdfc52f93f69b92cdc Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Mon, 27 Jun 2016 18:30:07 -0400 Subject: MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file Since wsrep_sync_wait & wsrep_causal_reads variables are related, they are always kept in sync whenever one of them changes. Same is tried on server start, where wsrep_sync_wait get updated based on wsrep_causal_reads' value. But, since wsrep_causal_reads is OFF by default, wsrep_sync_wait's value gets modified and loses its WSREP_SYNC_WAIT_BEFORE_READ bit. Fixed by syncing wsrep_sync_wait & wsrep_causal_reads values individually on server start in mysqld_get_one_option() based on command line arguments used. --- mysql-test/suite/galera/galera_2nodes.cnf | 1 - mysql-test/suite/galera/r/galera_var_sync_wait.result | 9 +++++++++ mysql-test/suite/galera/t/galera_var_sync_wait.test | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index 1dbaad4f699..b8c61bc814d 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -9,7 +9,6 @@ default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 # enforce read-committed characteristics across the cluster -wsrep-causal-reads=ON wsrep-sync-wait=7 [mysqld.1] diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result index f6136a4ddc4..df9cdfbd159 100644 --- a/mysql-test/suite/galera/r/galera_var_sync_wait.result +++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result @@ -1,3 +1,12 @@ +# +# MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file +# +SELECT @@global.wsrep_sync_wait; +@@global.wsrep_sync_wait +7 +SELECT @@global.wsrep_causal_reads; +@@global.wsrep_causal_reads +1 CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; SET GLOBAL wsrep_sync_wait = 1; SHOW TABLES LIKE '%t1'; diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test index 935c271a4d6..288ad62226f 100644 --- a/mysql-test/suite/galera/t/galera_var_sync_wait.test +++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test @@ -5,6 +5,13 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--echo # +--echo # MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file +--echo # +# galera_2nodes.cnf sets wsrep_sync_wait to 7 +SELECT @@global.wsrep_sync_wait; +SELECT @@global.wsrep_causal_reads; + --let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait` --connection node_1 -- cgit v1.2.1