Skip to content

Commit

Permalink
codership/galera#500 MTR test for proper Galera provider tear down
Browse files Browse the repository at this point in the history
Added a test which verifies that if the gcomm background thread
is forced to quit via exception, the error is propagated all the
way up the stack and wsrep_ready becomes 0.
  • Loading branch information
temeo authored and Jan Lindström committed May 8, 2018
1 parent 7274bed commit f8ea96b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mysql-test/suite/galera/r/galera#500.result
@@ -0,0 +1,10 @@
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = default;
SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
SET SESSION wsrep_on=0;
CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");
37 changes: 37 additions & 0 deletions mysql-test/suite/galera/t/galera#500.test
@@ -0,0 +1,37 @@
#
# The purpose of this test is to verify that if an exception is
# thrown from gcomm background thread, the provider terminates properly
# and wsrep_ready becomes 0.
#

--source include/have_innodb.inc
--source include/galera_cluster.inc

# Force node_2 gcomm background thread to terminate via exception.
--connection node_2
--let $wsrep_cluster_address = `SELECT @@wsrep_cluster_address`
# Setting gmcast.isolate=2 will force gcomm background thread to
# throw exception.
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options="gmcast.isolate=2";

# Wait until wsrep_ready becomes 0.
--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_ready'
--source include/wait_condition.inc

# Wait until node_1 ends up in non-prim and rebootstrap the cluster.
--connection node_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
SHOW STATUS LIKE 'wsrep_cluster_status';
SET SESSION wsrep_sync_wait = default;
SET GLOBAL wsrep_provider_options="pc.bootstrap=1";

# Restart node_2
--connection node_2
SET SESSION wsrep_on=0;
--source include/restart_mysqld.inc

--connection node_2
CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");

0 comments on commit f8ea96b

Please sign in to comment.