Skip to content
Permalink
Browse files
Add wait conditions for cluster size.
  • Loading branch information
Jan Lindström committed Aug 4, 2020
1 parent 100f0c9 commit 14a5f73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
@@ -1,12 +1,15 @@
connection node_2;
connection node_1;
call mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\).*");
CREATE TABLE t1 (f1 INTEGER);
connection node_1;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
connection node_2;
SET SESSION wsrep_sync_wait=0;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
SET SESSION wsrep_sync_wait=0;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET SESSION wsrep_sync_wait = 0;
connection node_2;
@@ -6,20 +6,28 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc

call mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\).*");

CREATE TABLE t1 (f1 INTEGER);

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

--connection node_2
SET SESSION wsrep_sync_wait=0;
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc

SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';

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

--sleep 10
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';

# Node #2 should be non-primary
SET SESSION wsrep_sync_wait = 0;
@@ -44,7 +52,7 @@ INSERT INTO t1 VALUES (1);
# Reconnect all nodes
--connection node_2
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
--sleep 10

--source include/wait_until_connected_again.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
@@ -67,7 +75,7 @@ SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';

--connection node_3
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
--sleep 10

--source include/wait_until_connected_again.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc

0 comments on commit 14a5f73

Please sign in to comment.