Debian Codegraph @

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

raw
1 --source include/galera_cluster.inc
2 --source include/have_sequence.inc
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 GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2';
12
13 --connection node_2
14 --let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
15 SET GLOBAL read_only=1;
16 SET SESSION wsrep_trx_fragment_size = 64;
17 set default_storage_engine=SEQUENCE;
18 SET AUTOCOMMIT = OFF;
19 --error 1005
20 CREATE TABLE t1(c1 NUMERIC NOT NULL);
21 CREATE TABLE t1 (id INT PRIMARY KEY) engine=innodb;
22 SET SESSION SQL_MODE='HIGH_NOT_PRECEDENCE';
23 INSERT INTO t1 VALUES (1),(2),(3);
24 SET GLOBAL SQL_MODE='NO_ENGINE_SUBSTITUTION';
25 --error 1051
26 DROP TABLE dummy;
27 INSERT INTO t1 VALUES('a');
28 --echo # In this point there should be one fragment
29 select count(*) AS EXPECT_1 from mysql.wsrep_streaming_log;
30 SET @@global.wsrep_cluster_address='gcomm://';
31 SET SESSION SQL_MODE='TRADITIONAL ';
32
33 #
34 # Kill the entire cluster and restart
35 #
36 --echo # Killing cluster because we have messed with wsrep_cluster_address
37 --connection node_2
38 SET SESSION wsrep_sync_wait = 0;
39 --source include/kill_galera.inc
40
41 --connection node_1
42 SET SESSION wsrep_sync_wait = 0;
43 --source include/kill_galera.inc
44
45 --remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
46 --let $start_mysqld_params =--wsrep-new-cluster
47 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
48 --source include/start_mysqld.inc
49 --source include/wait_until_ready.inc
50
51 --connection node_2
52 --remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
53 --let $start_mysqld_params =
54 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
55 --source include/start_mysqld.inc
56 --source include/wait_until_ready.inc
57
58 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
59 --source include/wait_condition.inc
60
61 call mtr.add_suppression("WSREP: BF applier thread");
62 call mtr.add_suppression("WSREP: Event");
63 call mtr.add_suppression("WSREP: SR trx recovery applying returned 1290");
64 call mtr.add_suppression("WSREP: Adopting a transaction");
65 call mtr.add_suppression("WSREP: Could not find applier context for");
66 call mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster");
67 call mtr.add_suppression("WSREP: Failed to vote on request for");
68
69 select count(*) AS EXPECT_0 from mysql.wsrep_streaming_log;
70
71 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
72 --source include/wait_condition.inc
73
74 SELECT * FROM t1;
75
76 --connection node_1
77 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
78 --source include/wait_condition.inc
79 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
80 --source include/wait_condition.inc
81 select count(*) AS EXPECT_0 from mysql.wsrep_streaming_log;
82 SELECT * FROM t1;
83 DROP TABLE t1;
84 SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false;pc.weight=1';
85
86 --connection node_2
87 --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
88 --source include/wait_condition.inc
89
90 --connection node_1
91 call mtr.add_suppression("WSREP: Event");
92 call mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on");
93 call mtr.add_suppression("WSREP: Failed to apply write set: gtid");
94 call mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster");
95 call mtr.add_suppression("WSREP: Could not find applier context for");
96 call mtr.add_suppression("WSREP: Failed to vote on request for");
97
98 # Restore original auto_increment_offset values.
99 --source include/auto_increment_offset_restore.inc
100
101 --source include/galera_end.inc