Debian Codegraph @

mysql-test/suite/galera/t/galera_strict_require_innodb.test

raw
1 #
2 # Write a warning to error log if Galera replicates table with storage engine
3 # not supported by Galera
4 #
5 # For MyISAM
6 # * push warning to client if wsrep_mode == STRICT_REPLICATION,REPLICATE_MYISAM
7 # * push warning to error log if log_warnings > 1
8 # For Aria
9 # * push warning to client if wsrep_mode == STRICT_REPLICATION,REPLICATE_ARIA
10 # * push warning to error log if log_warnings > 1
11 # For Memory
12 # * push warning to client if wsrep_mode == STRICT_REPLICATION
13 # * push warning to error log if log_warnings > 1
14 #
15 # In both cases apply flood control if >= 10 same warning
16 #
17 --source include/galera_cluster.inc
18 --source include/have_innodb.inc
19 --source include/have_aria.inc
20 --source include/force_restart.inc
21
22 call mtr.add_suppression("WSREP: wsrep_mode = STRICT_REPLICATION enabled");
23
24 CREATE TABLE t1(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=INNODB;
25 CREATE TABLE t2(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MYISAM;
26 CREATE TABLE t3(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=ARIA;
27 CREATE TABLE t4(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MEMORY;
28
29 SET GLOBAL log_warnings=2;
30 SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_MYISAM,REPLICATE_ARIA";
31
32 INSERT INTO t1 values (1,'innodb1');
33 INSERT INTO t2 values (1,'myisam1');
34 INSERT INTO t3 values (1,'aria1');
35 INSERT INTO t4 values (1,'memory1');
36
37 # these should not replicate
38 SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_ARIA";
39 INSERT INTO t2 values (2,'myisam2');
40 SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_MYISAM";
41 INSERT INTO t3 values (2,'aria2');
42
43 # no warning to error log
44 SET GLOBAL log_warnings=1;
45 INSERT INTO t1 values (3,'innodb3');
46 INSERT INTO t2 values (3,'myisam3');
47 INSERT INTO t3 values (3,'aria3');
48 INSERT INTO t4 values (3,'memory3');
49
50 # test warnings
51 --let $assert_count = 5
52 --let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
53 --let $assert_text = WSREP: wsrep_mode = STRICT_REPLICATION enabled.
54 --let $assert_select = WSREP: wsrep_mode = STRICT_REPLICATION enabled.
55 --source include/assert_grep.inc
56
57 # force flood
58 SET GLOBAL log_warnings=2;
59 INSERT INTO t2 values (4,'myisam3');
60 INSERT INTO t3 values (4,'aria2');
61 INSERT INTO t4 values (4,'memory2');
62 INSERT INTO t2 values (5,'myisam3');
63 INSERT INTO t3 values (5,'aria2');
64 INSERT INTO t4 values (5,'memory2');
65 INSERT INTO t2 values (6,'myisam3');
66 INSERT INTO t3 values (6,'aria2');
67 INSERT INTO t4 values (6,'memory2');
68 INSERT INTO t2 values (7,'myisam3');
69 INSERT INTO t3 values (7,'aria2');
70 INSERT INTO t4 values (7,'memory2');
71 INSERT INTO t2 values (8,'myisam3');
72 INSERT INTO t3 values (8,'aria2');
73 INSERT INTO t4 values (8,'memory2');
74 INSERT INTO t2 values (9,'myisam3');
75 INSERT INTO t3 values (9,'aria2');
76 INSERT INTO t4 values (9,'memory2');
77 INSERT INTO t2 values (10,'myisam3');
78 INSERT INTO t3 values (10,'aria2');
79 INSERT INTO t4 values (10,'memory2');
80 INSERT INTO t2 values (11,'myisam3');
81 INSERT INTO t3 values (11,'aria2');
82 INSERT INTO t4 values (11,'memory2');
83
84 SELECT COUNT(*) AS EXPECT_2 FROM t1;
85 SELECT COUNT(*) AS EXPECT_10 FROM t2;
86 SELECT COUNT(*) AS EXPECT_10 FROM t3;
87 SELECT COUNT(*) AS EXPECT_10 FROM t4;
88
89 --connection node_2
90 SELECT COUNT(*) AS EXPECT_2 FROM t1;
91 SELECT COUNT(*) AS EXPECT_10 FROM t2;
92 SELECT COUNT(*) AS EXPECT_1 FROM t3;
93 SELECT COUNT(*) AS EXPECT_0 FROM t4;
94
95 --connection node_1
96 SET GLOBAL wsrep_mode= DEFAULT;
97 DROP TABLE t1,t2,t3,t4;
98
99 #
100 # Verify no flood
101 #
102 --let $assert_count =
103 --let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
104 --let $assert_text = WSREP: wsrep_mode = STRICT_REPLICATION enabled.
105 --let $assert_select = WSREP: wsrep_mode = STRICT_REPLICATION enabled.
106 --let $assert_match = WSREP: wsrep_mode = STRICT_REPLICATION enabled.
107 --source include/assert_grep.inc
108 --let $assert_count = 1
109 --let $assert_text = WSREP: Suppressing warnings of type 'WSREP_REQUIRE_INNODB' for up to 300 seconds because of flooding
110 --let $assert_select = WSREP: Suppressing warnings of type 'WSREP_REQUIRE_INNODB' for up to 300 seconds because of flooding
111 --let $assert_match =
112 --source include/assert_grep.inc
113
114 # reset env
115 --disable_query_log
116 SET GLOBAL log_warnings=DEFAULT;
117 SET GLOBAL wsrep_mode=DEFAULT;
118 --disable_query_log