Debian Codegraph @

mysql-test/suite/galera/t/MDEV-38201.test

raw
1 --source include/galera_cluster.inc
2
3 --source include/force_restart.inc
4
5 # Save original auto_increment_offset values.
6 --let $node_1=node_1
7 --let $node_2=node_2
8 --source include/auto_increment_offset_save.inc
9
10 --connection node_1
11 # Set higher weight for node_1 to keep it in primary
12 # while node_2 is inconsistent
13
14 SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2';
15
16 --connection node_2
17 CREATE TABLE t1 (f1 INT) ENGINE=InnoDB;
18 SET GLOBAL wsrep_IGNORE_apply_errors=1;
19 SET SESSION wsrep_dirty_reads=1;
20 SHOW CREATE TABLE t1;
21 FLUSH HOSTS;
22 --error ER_TABLE_EXISTS_ERROR
23 CREATE TABLE t1 (f1 INT) ENGINE=InnoDB;
24 # This will cause inconsistency
25 --error ER_GALERA_REPLICATION_NOT_SUPPORTED
26 FLUSH HOSTS;
27 SHOW WARNINGS;
28
29 --connection node_1
30 --echo # Wait until inconsistent node_2 leaves from cluster
31 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
32 --source include/wait_condition.inc
33
34 --connection node_2
35 --echo # Restart node_2
36 --source include/restart_mysqld.inc
37
38 call mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on");
39
40 --connection node_1
41 --echo # Wait until node_2 is back in the cluster
42 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
43 --source include/wait_condition.inc
44
45 SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false;pc.weight=1';
46
47 DROP TABLE t1;
48 --source include/auto_increment_offset_restore.inc
49 --source include/galera_end.inc