| 1 |
# |
| 2 |
# Test that GRA_* files are generated on applier failure and are readable. |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_innodb.inc |
| 7 |
|
| 8 |
# Save original auto_increment_offset values. |
| 9 |
--let $node_1=node_1 |
| 10 |
--let $node_2=node_2 |
| 11 |
--source include/auto_increment_offset_save.inc |
| 12 |
|
| 13 |
--connection node_2 |
| 14 |
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log |
| 15 |
let $restore_wsrep_ignore_apply_errors = `SELECT @@GLOBAL.wsrep_ignore_apply_errors`; |
| 16 |
SET GLOBAL wsrep_ignore_apply_errors=0; |
| 17 |
|
| 18 |
# Create applier failure |
| 19 |
SET SESSION wsrep_on=OFF; |
| 20 |
CREATE TABLE t1 (f1 INTEGER); |
| 21 |
|
| 22 |
--connection node_1 |
| 23 |
CREATE TABLE t1 (f1 INTEGER); |
| 24 |
|
| 25 |
# node 2 should detect an error and leave the cluster |
| 26 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 27 |
--source include/wait_condition.inc |
| 28 |
|
| 29 |
--connection node_2 |
| 30 |
--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 31 |
--source include/wait_condition.inc |
| 32 |
|
| 33 |
# Make sure the GRA file produced is readable and contains the failure |
| 34 |
|
| 35 |
--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/ |
| 36 |
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log |
| 37 |
|
| 38 |
# restart and reconnect node_2 |
| 39 |
--source include/kill_galera.inc |
| 40 |
--source include/wait_until_disconnected.inc |
| 41 |
--source include/start_mysqld.inc |
| 42 |
|
| 43 |
--eval SET GLOBAL wsrep_ignore_apply_errors = $restore_wsrep_ignore_apply_errors |
| 44 |
DROP TABLE t1; |
| 45 |
|
| 46 |
CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on "); |
| 47 |
|
| 48 |
# Restore original auto_increment_offset values. |
| 49 |
--source include/auto_increment_offset_restore.inc |