Debian Codegraph @

mysql-test/suite/galera/t/GAL-401.test

raw
1 # This tests proper desync counter cleanup when DONOR/DESYNC state is cleared.
2
3 --source include/galera_cluster.inc
4 --source include/have_innodb.inc
5
6 # Make node 1 tolerate split-brain
7 SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
8
9 # Desync and disconnect node 2 from the PC:
10 --connection node_2
11 SET @@global.wsrep_desync = 1;
12 SET SESSION wsrep_dirty_reads=1;
13 SET SESSION wsrep_sync_wait=0;
14 SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
15 --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
16 --source include/wait_condition.inc
17
18 # Wait until node 2 disappears from the PC:
19 --connection node_1
20 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
21 --source include/wait_condition.inc
22 --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
23 --source include/wait_condition.inc
24
25 # Modify app state to force node 2 into PRIMARY upon reconnection.
26 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
27
28 # Reconnect node 2 to the PC:
29 --connection node_2
30 SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
31 SET wsrep_dirty_reads=0;
32 --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
33 --source include/wait_condition.inc
34 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
35 --source include/wait_condition.inc
36 --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
37 --source include/wait_condition.inc
38
39 # Must return 0:
40 SHOW STATUS LIKE 'wsrep_desync_count';
41
42 # Resync node_2, should pass:
43 SET @@global.wsrep_desync = 0;
44
45 --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
46 --source include/wait_condition.inc
47
48 SET SESSION wsrep_sync_wait=15;
49 SHOW CREATE TABLE t1;
50 DROP TABLE t1;
51 CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
52
53 --connection node_1
54 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
55 --source include/wait_condition.inc
56 SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';