Skip to content

Commit 14a5f73

Browse files
committed
Add wait conditions for cluster size.
1 parent 100f0c9 commit 14a5f73

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
connection node_2;
22
connection node_1;
3+
call mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\).*");
34
CREATE TABLE t1 (f1 INTEGER);
45
connection node_1;
56
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
67
connection node_2;
8+
SET SESSION wsrep_sync_wait=0;
79
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
810
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
911
connection node_3;
12+
SET SESSION wsrep_sync_wait=0;
1013
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
1114
SET SESSION wsrep_sync_wait = 0;
1215
connection node_2;

mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,28 @@
66
--source include/galera_cluster.inc
77
--source include/have_innodb.inc
88

9+
call mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\).*");
10+
911
CREATE TABLE t1 (f1 INTEGER);
1012

1113
# Force all nodes to become non-primary
1214
--connection node_1
1315
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
1416

1517
--connection node_2
18+
SET SESSION wsrep_sync_wait=0;
19+
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
20+
--source include/wait_condition.inc
21+
1622
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
1723

1824
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
1925
--connection node_3
20-
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
26+
SET SESSION wsrep_sync_wait=0;
27+
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
28+
--source include/wait_condition.inc
2129

22-
--sleep 10
30+
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
2331

2432
# Node #2 should be non-primary
2533
SET SESSION wsrep_sync_wait = 0;
@@ -44,7 +52,7 @@ INSERT INTO t1 VALUES (1);
4452
# Reconnect all nodes
4553
--connection node_2
4654
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
47-
--sleep 10
55+
4856
--source include/wait_until_connected_again.inc
4957
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
5058
--source include/wait_condition.inc
@@ -67,7 +75,7 @@ SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
6775

6876
--connection node_3
6977
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
70-
--sleep 10
78+
7179
--source include/wait_until_connected_again.inc
7280
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
7381
--source include/wait_condition.inc

0 commit comments

Comments
 (0)