Skip to content

Commit 27d66d6

Browse files
author
Jan Lindström
committed
MENT-411 : Implement wsrep_replicate_aria
Introduced two new wsrep_mode options * REPLICATE_MYISAM * REPLICATE_ARIA Depracated wsrep_replicate_myisam parameter and we use wsrep_mode = REPLICATE_MYISAM instead. This required small refactoring of wsrep_check_mode_after_open_table so that both MyISAM and Aria are handled on required DML cases. Similarly, added Aria to wsrep_should_replicate_ddl to handle DDL for Aria tables using TOI. Added test cases and improved MyISAM testing. Changed use of wsrep_replicate_myisam to wsrep_mode = REPLICATE_MYISAM
1 parent 74281fe commit 27d66d6

39 files changed

+1205
-374
lines changed

mysql-test/suite/galera/r/galera_admin.result

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DROP TABLE IF EXISTS x1, x2;
55
connection node_1;
66
CREATE TABLE t1 (f1 INTEGER);
77
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
8-
SET GLOBAL wsrep_replicate_myisam = TRUE;
8+
SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
99
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
1010
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
1111
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -57,4 +57,61 @@ COUNT(*) = 10
5757
connection node_1;
5858
DROP TABLE t1, t2;
5959
DROP TABLE x1, x2;
60-
SET GLOBAL wsrep_replicate_myisam = FALSE;
60+
#
61+
# ARIA
62+
#
63+
connection node_1;
64+
CREATE TABLE t1 (f1 INTEGER);
65+
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
66+
SET GLOBAL wsrep_mode = REPLICATE_ARIA;
67+
CREATE TABLE x1 (f1 INTEGER) ENGINE=ARIA;
68+
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=ARIA;
69+
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
70+
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
71+
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
72+
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
73+
connection node_2;
74+
# ANALYZE test
75+
connection node_2;
76+
connection node_1;
77+
ANALYZE TABLE t1, t2;
78+
Table Op Msg_type Msg_text
79+
test.t1 analyze status Engine-independent statistics collected
80+
test.t1 analyze status OK
81+
test.t2 analyze status Engine-independent statistics collected
82+
test.t2 analyze status OK
83+
connection node_2;
84+
# OPTIMIZE test
85+
connection node_2;
86+
connection node_1;
87+
OPTIMIZE TABLE t1, t2;
88+
Table Op Msg_type Msg_text
89+
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
90+
test.t1 optimize status OK
91+
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
92+
test.t2 optimize status OK
93+
connection node_2;
94+
# REPAIR test
95+
connection node_2;
96+
connection node_1;
97+
REPAIR TABLE x1, x2;
98+
Table Op Msg_type Msg_text
99+
test.x1 repair status OK
100+
test.x2 repair status OK
101+
connection node_2;
102+
connection node_2;
103+
SELECT COUNT(*) = 10 FROM t1;
104+
COUNT(*) = 10
105+
1
106+
SELECT COUNT(*) = 10 FROM x1;
107+
COUNT(*) = 10
108+
1
109+
SELECT COUNT(*) = 10000 FROM t2;
110+
COUNT(*) = 10000
111+
1
112+
SELECT COUNT(*) = 10 FROM x2;
113+
COUNT(*) = 10
114+
1
115+
connection node_1;
116+
DROP TABLE t1, t2;
117+
DROP TABLE x1, x2;

mysql-test/suite/galera/r/galera_alter_engine_myisam.result

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
connection node_2;
22
connection node_1;
3-
SET GLOBAL wsrep_replicate_myisam = TRUE;
3+
SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
44
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
55
INSERT INTO t1 VALUES (1);
66
ALTER TABLE t1 ENGINE=InnoDB;
@@ -11,5 +11,18 @@ ENGINE = 'InnoDB'
1111
SELECT COUNT(*) = 1 FROM t1;
1212
COUNT(*) = 1
1313
1
14+
DROP TABLE t1;
1415
connection node_1;
16+
SET GLOBAL wsrep_mode = REPLICATE_ARIA;
17+
CREATE TABLE t1 (f1 INTEGER) ENGINE=ARIA;
18+
INSERT INTO t1 VALUES (1);
19+
ALTER TABLE t1 ENGINE=InnoDB;
20+
connection node_2;
21+
SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
22+
ENGINE = 'InnoDB'
23+
1
24+
SELECT COUNT(*) = 1 FROM t1;
25+
COUNT(*) = 1
26+
1
1527
DROP TABLE t1;
28+
connection node_1;

mysql-test/suite/galera/r/galera_binlog_checksum.result

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ DROP TABLE t1;
1818
# enabled
1919
#
2020
connection node_1;
21-
SET @@global.wsrep_replicate_myisam=1;
22-
CREATE TABLE t1 (i INT) ENGINE=MYISAM;
21+
SET @@global.wsrep_mode = REPLICATE_MYISAM;
22+
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=MYISAM;
2323
INSERT INTO t1 VALUES(1);
2424
connection node_2;
2525
SELECT * FROM t1;
2626
i
2727
1
2828
connection node_1;
2929
DROP TABLE t1;
30-
SET @@global.wsrep_replicate_myisam=0;
3130
# End of tests.

mysql-test/suite/galera/r/galera_can_run_toi.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ SET SESSION default_storage_engine=MyISAM;
2525
SELECT @@default_storage_engine;
2626
@@default_storage_engine
2727
MyISAM
28-
SET GLOBAL wsrep_replicate_myisam=OFF;
2928
SET GLOBAL wsrep_mode=STRICT_REPLICATION;
3029
CREATE TABLE t3 (c1 VARCHAR(10)) ENGINE=InnoDB;
3130
ALTER TABLE t3 ENGINE=NonExistentEngine;

mysql-test/suite/galera/r/galera_defaults.result

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
connection node_2;
22
connection node_1;
33
# Correct Galera library found
4-
SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
5-
expect 49
6-
50
4+
SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
5+
expect 51
6+
51
77
SELECT VARIABLE_NAME, VARIABLE_VALUE
88
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
99
WHERE VARIABLE_NAME LIKE 'wsrep_%'
@@ -40,6 +40,7 @@ WSREP_LOAD_DATA_SPLITTING OFF
4040
WSREP_LOG_CONFLICTS OFF
4141
WSREP_MAX_WS_ROWS 0
4242
WSREP_MAX_WS_SIZE 2147483647
43+
WSREP_MODE
4344
WSREP_MYSQL_REPLICATION_BUNDLE 0
4445
WSREP_NOTIFY_CMD
4546
WSREP_ON ON

mysql-test/suite/galera/r/galera_flush_local.result

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ connection node_2;
22
connection node_1;
33
DROP TABLE IF EXISTS t1, t2, x1, x2;
44
connection node_1;
5+
SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
56
CREATE TABLE t1 (f1 INTEGER);
67
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
78
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
@@ -64,18 +65,18 @@ test.x2 repair status OK
6465
connection node_2;
6566
wsrep_last_committed_diff
6667
1
67-
SELECT COUNT(*) = 10 FROM t1;
68-
COUNT(*) = 10
69-
1
70-
SELECT COUNT(*) = 10 FROM x1;
71-
COUNT(*) = 10
72-
1
73-
SELECT COUNT(*) = 10000 FROM t2;
74-
COUNT(*) = 10000
75-
1
76-
SELECT COUNT(*) = 10 FROM x2;
77-
COUNT(*) = 10
78-
1
68+
SELECT COUNT(*) AS EXPECT_10 FROM t1;
69+
EXPECT_10
70+
10
71+
SELECT COUNT(*) AS EXPECT_10 FROM x1;
72+
EXPECT_10
73+
10
74+
SELECT COUNT(*) AS EXPECT_10000 FROM t2;
75+
EXPECT_10000
76+
10000
77+
SELECT COUNT(*) AS EXPECT_10 FROM x2;
78+
EXPECT_10
79+
10
7980
connection node_1;
8081
DROP TABLE t1, t2, x1, x2;
8182
CREATE TABLE t1 (f1 INTEGER);
@@ -143,18 +144,18 @@ wsrep_last_committed_diff
143144
1
144145
wsrep_last_committed_diff2
145146
1
146-
SELECT COUNT(*) = 10 FROM t1;
147-
COUNT(*) = 10
148-
1
149-
SELECT COUNT(*) = 10 FROM x1;
150-
COUNT(*) = 10
151-
1
152-
SELECT COUNT(*) = 10000 FROM t2;
153-
COUNT(*) = 10000
154-
1
155-
SELECT COUNT(*) = 10 FROM x2;
156-
COUNT(*) = 10
157-
1
147+
SELECT COUNT(*) AS EXPECT_10 FROM t1;
148+
EXPECT_10
149+
10
150+
SELECT COUNT(*) AS EXPECT_10 FROM x1;
151+
EXPECT_10
152+
10
153+
SELECT COUNT(*) AS EXPECT_10000 FROM t2;
154+
EXPECT_10000
155+
10000
156+
SELECT COUNT(*) AS EXPECT_10 FROM x2;
157+
EXPECT_10
158+
10
158159
connection node_1;
159160
set wsrep_on=1;
160161
DROP TABLE t1, t2, x1, x2;

mysql-test/suite/galera/r/galera_strict_require_innodb.result

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,83 +5,111 @@ CREATE TABLE t1(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=INNODB;
55
CREATE TABLE t2(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MYISAM;
66
CREATE TABLE t3(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=ARIA;
77
CREATE TABLE t4(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MEMORY;
8-
SET GLOBAL wsrep_replicate_myisam=ON;
98
SET GLOBAL log_warnings=2;
10-
SET GLOBAL wsrep_mode= STRICT_REPLICATION;
9+
SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_MYISAM,REPLICATE_ARIA";
1110
INSERT INTO t1 values (1,'innodb1');
1211
INSERT INTO t2 values (1,'myisam1');
1312
INSERT INTO t3 values (1,'aria1');
14-
Warnings:
15-
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
1613
INSERT INTO t4 values (1,'memory1');
1714
Warnings:
1815
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
19-
SET GLOBAL wsrep_replicate_myisam=OFF;
16+
SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_ARIA";
2017
INSERT INTO t2 values (2,'myisam2');
2118
Warnings:
2219
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
20+
SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_MYISAM";
21+
INSERT INTO t3 values (2,'aria2');
22+
Warnings:
23+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
2324
SET GLOBAL log_warnings=1;
24-
INSERT INTO t1 values (2,'innodb2');
25+
INSERT INTO t1 values (3,'innodb3');
2526
INSERT INTO t2 values (3,'myisam3');
26-
Warnings:
27-
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
28-
INSERT INTO t3 values (2,'aria2');
27+
INSERT INTO t3 values (3,'aria3');
2928
Warnings:
3029
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
31-
INSERT INTO t4 values (2,'memory2');
30+
INSERT INTO t4 values (3,'memory3');
3231
Warnings:
3332
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
3433
include/assert_grep.inc [WSREP: wsrep_mode = STRICT_REPLICATION enabled.]
3534
SET GLOBAL log_warnings=2;
3635
INSERT INTO t2 values (4,'myisam3');
37-
Warnings:
38-
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
3936
INSERT INTO t3 values (4,'aria2');
4037
Warnings:
4138
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
4239
INSERT INTO t4 values (4,'memory2');
4340
Warnings:
4441
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
4542
INSERT INTO t2 values (5,'myisam3');
46-
Warnings:
47-
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
4843
INSERT INTO t3 values (5,'aria2');
4944
Warnings:
5045
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
5146
INSERT INTO t4 values (5,'memory2');
5247
Warnings:
5348
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
5449
INSERT INTO t2 values (6,'myisam3');
55-
Warnings:
56-
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
5750
INSERT INTO t3 values (6,'aria2');
5851
Warnings:
5952
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
6053
INSERT INTO t4 values (6,'memory2');
6154
Warnings:
6255
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
56+
INSERT INTO t2 values (7,'myisam3');
57+
INSERT INTO t3 values (7,'aria2');
58+
Warnings:
59+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
60+
INSERT INTO t4 values (7,'memory2');
61+
Warnings:
62+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
63+
INSERT INTO t2 values (8,'myisam3');
64+
INSERT INTO t3 values (8,'aria2');
65+
Warnings:
66+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
67+
INSERT INTO t4 values (8,'memory2');
68+
Warnings:
69+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
70+
INSERT INTO t2 values (9,'myisam3');
71+
INSERT INTO t3 values (9,'aria2');
72+
Warnings:
73+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
74+
INSERT INTO t4 values (9,'memory2');
75+
Warnings:
76+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
77+
INSERT INTO t2 values (10,'myisam3');
78+
INSERT INTO t3 values (10,'aria2');
79+
Warnings:
80+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
81+
INSERT INTO t4 values (10,'memory2');
82+
Warnings:
83+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
84+
INSERT INTO t2 values (11,'myisam3');
85+
INSERT INTO t3 values (11,'aria2');
86+
Warnings:
87+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
88+
INSERT INTO t4 values (11,'memory2');
89+
Warnings:
90+
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
6391
SELECT COUNT(*) AS EXPECT_2 FROM t1;
6492
EXPECT_2
6593
2
66-
SELECT COUNT(*) AS EXPECT_6 FROM t2;
67-
EXPECT_6
68-
6
69-
SELECT COUNT(*) AS EXPECT_5 FROM t3;
70-
EXPECT_5
71-
5
72-
SELECT COUNT(*) AS EXPECT_5 FROM t4;
73-
EXPECT_5
74-
5
94+
SELECT COUNT(*) AS EXPECT_10 FROM t2;
95+
EXPECT_10
96+
11
97+
SELECT COUNT(*) AS EXPECT_10 FROM t3;
98+
EXPECT_10
99+
11
100+
SELECT COUNT(*) AS EXPECT_10 FROM t4;
101+
EXPECT_10
102+
10
75103
connection node_2;
76104
SELECT COUNT(*) AS EXPECT_2 FROM t1;
77105
EXPECT_2
78106
2
79-
SELECT COUNT(*) AS EXPECT_1 FROM t2;
107+
SELECT COUNT(*) AS EXPECT_10 FROM t2;
108+
EXPECT_10
109+
10
110+
SELECT COUNT(*) AS EXPECT_1 FROM t3;
80111
EXPECT_1
81112
1
82-
SELECT COUNT(*) AS EXPECT_0 FROM t3;
83-
EXPECT_0
84-
0
85113
SELECT COUNT(*) AS EXPECT_0 FROM t4;
86114
EXPECT_0
87115
0

0 commit comments

Comments
 (0)