summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/galera_gra_log.test
blob: aeadafad9697cbcb4eb83a1a669c7d803f775f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# Test that GRA_* files are generated on applier failure and are readable.
#

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

--connection node_2
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
let $restore_wsrep_ignore_apply_errors = `SELECT @@GLOBAL.wsrep_ignore_apply_errors`;
SET GLOBAL wsrep_ignore_apply_errors=0;

# Create applier failure
SET SESSION wsrep_on=OFF;
CREATE TABLE t1 (f1 INTEGER);

--connection node_1
CREATE TABLE t1 (f1 INTEGER);

# node 2 should detect an error and leave the cluster
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc

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

# Make sure the GRA file produced is readable and contains the failure

--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log

# restart and reconnect node_2
--source include/kill_galera.inc
--source include/wait_until_disconnected.inc
--source include/start_mysqld.inc

--eval SET GLOBAL wsrep_ignore_apply_errors = $restore_wsrep_ignore_apply_errors
DROP TABLE t1;

CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on");