summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeemu Ollakka <teemu.ollakka@galeracluster.com>2015-09-13 18:57:20 +0300
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-22 12:58:02 -0500
commitd01328d73b65ec3c628646b1dd51a5d601ee74be (patch)
tree56923e07fecf17200fc37b536fb9f2406bedaf14
parent17b5cb617263060f583382093a2e32adb0d7235f (diff)
downloadmariadb-git-d01328d73b65ec3c628646b1dd51a5d601ee74be.tar.gz
Helpers to deal with galera dbug sync points.
-rw-r--r--mysql-test/include/galera_clear_sync_point.inc1
-rw-r--r--mysql-test/include/galera_set_sync_point.inc1
-rw-r--r--mysql-test/include/galera_signal_sync_point.inc1
-rw-r--r--mysql-test/include/galera_wait_sync_point.inc5
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl_drain.result2
-rw-r--r--mysql-test/suite/galera/r/galera_transaction_replay.result2
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl_drain.test11
-rw-r--r--mysql-test/suite/galera/t/galera_ist_restart_joiner.test4
-rw-r--r--mysql-test/suite/galera/t/galera_transaction_replay.test10
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result2
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test7
11 files changed, 31 insertions, 15 deletions
diff --git a/mysql-test/include/galera_clear_sync_point.inc b/mysql-test/include/galera_clear_sync_point.inc
new file mode 100644
index 00000000000..589522a55b0
--- /dev/null
+++ b/mysql-test/include/galera_clear_sync_point.inc
@@ -0,0 +1 @@
+SET GLOBAL wsrep_provider_options = 'dbug=';
diff --git a/mysql-test/include/galera_set_sync_point.inc b/mysql-test/include/galera_set_sync_point.inc
new file mode 100644
index 00000000000..5fe4e8c38c0
--- /dev/null
+++ b/mysql-test/include/galera_set_sync_point.inc
@@ -0,0 +1 @@
+--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point'
diff --git a/mysql-test/include/galera_signal_sync_point.inc b/mysql-test/include/galera_signal_sync_point.inc
new file mode 100644
index 00000000000..eaa5cdd43f5
--- /dev/null
+++ b/mysql-test/include/galera_signal_sync_point.inc
@@ -0,0 +1 @@
+--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point'
diff --git a/mysql-test/include/galera_wait_sync_point.inc b/mysql-test/include/galera_wait_sync_point.inc
new file mode 100644
index 00000000000..f7019ae3a19
--- /dev/null
+++ b/mysql-test/include/galera_wait_sync_point.inc
@@ -0,0 +1,5 @@
+let $wait_timeout = 10;
+SET SESSION wsrep_on = 0;
+--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
+--source include/wait_condition.inc
+SET SESSION wsrep_on = 1;
diff --git a/mysql-test/suite/galera/r/galera_ftwrl_drain.result b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
index a4879838d11..d704699925b 100644
--- a/mysql-test/suite/galera/r/galera_ftwrl_drain.result
+++ b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
@@ -2,6 +2,8 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
diff --git a/mysql-test/suite/galera/r/galera_transaction_replay.result b/mysql-test/suite/galera/r/galera_transaction_replay.result
index 54ea8db699d..bfafa506fe6 100644
--- a/mysql-test/suite/galera/r/galera_transaction_replay.result
+++ b/mysql-test/suite/galera/r/galera_transaction_replay.result
@@ -10,6 +10,8 @@ f1 f2
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
COMMIT;;
SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
diff --git a/mysql-test/suite/galera/t/galera_ftwrl_drain.test b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
index f022a9437c2..690e890cdea 100644
--- a/mysql-test/suite/galera/t/galera_ftwrl_drain.test
+++ b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
@@ -18,7 +18,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
--connection node_2
-SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_set_sync_point.inc
--connection node_1
INSERT INTO t1 VALUES (1);
@@ -27,8 +29,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
# Wait until applier has blocked
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_slave_enter_sync'
---source include/wait_condition.inc
+--source include/galera_wait_sync_point.inc
SELECT COUNT(*) = 0 FROM t1;
@@ -41,8 +42,8 @@ SELECT COUNT(*) = 0 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Init' AND INFO = 'FLUSH TABLES WITH READ LOCK'
--source include/wait_condition.inc
-SET GLOBAL wsrep_provider_options = 'dbug=';
-SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
--connection node_2a
--reap
diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
index 69446f0f86a..eae28bdbcd7 100644
--- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
@@ -27,7 +27,9 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
--connection node_2
# Make sure IST will block ...
-SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
+--let $galera_sync_point = recv_IST_after_apply_trx
+--source include/galera_set_sync_point.inc
+
SET SESSION wsrep_sync_wait = 0;
diff --git a/mysql-test/suite/galera/t/galera_transaction_replay.test b/mysql-test/suite/galera/t/galera_transaction_replay.test
index 632aa5cc0d5..bd5288a51c6 100644
--- a/mysql-test/suite/galera/t/galera_transaction_replay.test
+++ b/mysql-test/suite/galera/t/galera_transaction_replay.test
@@ -23,7 +23,8 @@ SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
# Block the commit
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
-SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
--connection node_1
--send COMMIT;
@@ -31,8 +32,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
# Wait until commit is blocked
--connection node_1a
SET SESSION wsrep_sync_wait = 0;
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'commit_monitor_enter_sync'
---source include/wait_condition.inc
+--source include/galera_wait_sync_point.inc
# Issue a conflicting update on node #2
--connection node_2
@@ -48,8 +48,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
# Unblock the commit
--connection node_1a
-SET GLOBAL wsrep_provider_options = 'dbug=';
-SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
# Commit succeeds
--connection node_1
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
index 1ecea5db5ab..6c66bf4a891 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
@@ -16,8 +16,8 @@ CREATE TABLE t2 (f1 LONGTEXT);
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
-SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
SELECT COUNT(*) = 30 FROM t1;
COUNT(*) = 30
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
index 0668c246624..7d8bbb39e35 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
@@ -38,7 +38,8 @@ INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
# Make sure IST will block ...
-SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers';
+--let $galera_sync_point = ist_sender_send_after_get_buffers
+--source include/galera_set_sync_point.inc
# ... and restart providers to force IST
--connection node_2
@@ -70,8 +71,8 @@ INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
# Unlock IST and wait for it to complete
-SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
-SET GLOBAL wsrep_provider_options = 'dbug=';
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);