Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codership/galera#500 MTR test for proper Galera provider tear down
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
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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."); |