Commit 5609020c authored by Philip Stoev's avatar Philip Stoev Committed by Nirbhay Choubey

Galera MTR Tests: fortify galera_parallel_simple.test against sporadic failures

parent 1cb01fe7
CREATE TABLE t1 (id INT) ENGINE=InnoDB; CREATE TABLE t1 (id INT) ENGINE=InnoDB;
CREATE TABLE t2 (id INT) ENGINE=InnoDB; CREATE TABLE t2 (id INT) ENGINE=InnoDB;
SET GLOBAL wsrep_slave_threads = 2; SET GLOBAL wsrep_slave_threads = 2;
LOCK TABLE t1 WRITE;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1); INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -13,15 +14,15 @@ INSERT INTO t1 VALUES (1); ...@@ -13,15 +14,15 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1); INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1); INSERT INTO t2 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1; SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10 COUNT(*) = 10
0 0
SELECT COUNT(*) = 10 FROM t2; SELECT COUNT(*) = 10 FROM t2;
COUNT(*) = 10 COUNT(*) = 10
0 0
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
COUNT(*) = 2
1
SET GLOBAL wsrep_slave_threads = 1;; SET GLOBAL wsrep_slave_threads = 1;;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
...@@ -13,6 +13,7 @@ CREATE TABLE t2 (id INT) ENGINE=InnoDB; ...@@ -13,6 +13,7 @@ CREATE TABLE t2 (id INT) ENGINE=InnoDB;
--connection node_2 --connection node_2
SET GLOBAL wsrep_slave_threads = 2; SET GLOBAL wsrep_slave_threads = 2;
LOCK TABLE t1 WRITE;
--connection node_1 --connection node_1
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -34,10 +35,20 @@ INSERT INTO t1 VALUES (1); ...@@ -34,10 +35,20 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1); INSERT INTO t2 VALUES (1);
--connection node_2 --connection node_2
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'applied write set%';
--source include/wait_condition.inc
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1; SELECT COUNT(*) = 10 FROM t1;
SELECT COUNT(*) = 10 FROM t2; SELECT COUNT(*) = 10 FROM t2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment