Skip to content

Commit 5609020

Browse files
philip-galeraNirbhay Choubey
authored andcommitted
Galera MTR Tests: fortify galera_parallel_simple.test against sporadic failures
1 parent 1cb01fe commit 5609020

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

mysql-test/suite/galera/r/galera_parallel_simple.result

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
22
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
33
SET GLOBAL wsrep_slave_threads = 2;
4+
LOCK TABLE t1 WRITE;
45
INSERT INTO t1 VALUES (1);
56
INSERT INTO t2 VALUES (1);
67
INSERT INTO t1 VALUES (1);
@@ -13,15 +14,15 @@ INSERT INTO t1 VALUES (1);
1314
INSERT INTO t2 VALUES (1);
1415
INSERT INTO t1 VALUES (1);
1516
INSERT INTO t2 VALUES (1);
17+
SET SESSION wsrep_sync_wait = 0;
18+
UNLOCK TABLES;
19+
SET SESSION wsrep_sync_wait = 7;
1620
SELECT COUNT(*) = 10 FROM t1;
1721
COUNT(*) = 10
1822
0
1923
SELECT COUNT(*) = 10 FROM t2;
2024
COUNT(*) = 10
2125
0
22-
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
23-
COUNT(*) = 2
24-
1
2526
SET GLOBAL wsrep_slave_threads = 1;;
2627
DROP TABLE t1;
2728
DROP TABLE t2;

mysql-test/suite/galera/t/galera_parallel_simple.test

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CREATE TABLE t2 (id INT) ENGINE=InnoDB;
1313

1414
--connection node_2
1515
SET GLOBAL wsrep_slave_threads = 2;
16+
LOCK TABLE t1 WRITE;
1617

1718
--connection node_1
1819
INSERT INTO t1 VALUES (1);
@@ -34,10 +35,20 @@ INSERT INTO t1 VALUES (1);
3435
INSERT INTO t2 VALUES (1);
3536

3637
--connection node_2
38+
SET SESSION wsrep_sync_wait = 0;
39+
40+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
41+
--source include/wait_condition.inc
42+
43+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'applied write set%';
44+
--source include/wait_condition.inc
45+
46+
UNLOCK TABLES;
47+
48+
SET SESSION wsrep_sync_wait = 7;
3749

3850
SELECT COUNT(*) = 10 FROM t1;
3951
SELECT COUNT(*) = 10 FROM t2;
40-
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
4152

4253
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
4354

0 commit comments

Comments
 (0)