Skip to content

Commit

Permalink
MENT-411 : Implement wsrep_replicate_aria
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jan Lindström committed Feb 25, 2021
1 parent 74281fe commit 27d66d6
Show file tree
Hide file tree
Showing 39 changed files with 1,205 additions and 374 deletions.
61 changes: 59 additions & 2 deletions mysql-test/suite/galera/r/galera_admin.result
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS x1, x2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
SET GLOBAL wsrep_replicate_myisam = TRUE;
SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
Expand Down Expand Up @@ -57,4 +57,61 @@ COUNT(*) = 10
connection node_1;
DROP TABLE t1, t2;
DROP TABLE x1, x2;
SET GLOBAL wsrep_replicate_myisam = FALSE;
#
# ARIA
#
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
SET GLOBAL wsrep_mode = REPLICATE_ARIA;
CREATE TABLE x1 (f1 INTEGER) ENGINE=ARIA;
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=ARIA;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
connection node_2;
# ANALYZE test
connection node_2;
connection node_1;
ANALYZE TABLE t1, t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
connection node_2;
# OPTIMIZE test
connection node_2;
connection node_1;
OPTIMIZE TABLE t1, t2;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
test.t2 optimize status OK
connection node_2;
# REPAIR test
connection node_2;
connection node_1;
REPAIR TABLE x1, x2;
Table Op Msg_type Msg_text
test.x1 repair status OK
test.x2 repair status OK
connection node_2;
connection node_2;
SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10 FROM x1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10000 FROM t2;
COUNT(*) = 10000
1
SELECT COUNT(*) = 10 FROM x2;
COUNT(*) = 10
1
connection node_1;
DROP TABLE t1, t2;
DROP TABLE x1, x2;
15 changes: 14 additions & 1 deletion mysql-test/suite/galera/r/galera_alter_engine_myisam.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
connection node_2;
connection node_1;
SET GLOBAL wsrep_replicate_myisam = TRUE;
SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
ALTER TABLE t1 ENGINE=InnoDB;
Expand All @@ -11,5 +11,18 @@ ENGINE = 'InnoDB'
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
DROP TABLE t1;
connection node_1;
SET GLOBAL wsrep_mode = REPLICATE_ARIA;
CREATE TABLE t1 (f1 INTEGER) ENGINE=ARIA;
INSERT INTO t1 VALUES (1);
ALTER TABLE t1 ENGINE=InnoDB;
connection node_2;
SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
ENGINE = 'InnoDB'
1
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
DROP TABLE t1;
connection node_1;
5 changes: 2 additions & 3 deletions mysql-test/suite/galera/r/galera_binlog_checksum.result
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ DROP TABLE t1;
# enabled
#
connection node_1;
SET @@global.wsrep_replicate_myisam=1;
CREATE TABLE t1 (i INT) ENGINE=MYISAM;
SET @@global.wsrep_mode = REPLICATE_MYISAM;
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=MYISAM;
INSERT INTO t1 VALUES(1);
connection node_2;
SELECT * FROM t1;
i
1
connection node_1;
DROP TABLE t1;
SET @@global.wsrep_replicate_myisam=0;
# End of tests.
1 change: 0 additions & 1 deletion mysql-test/suite/galera/r/galera_can_run_toi.result
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ SET SESSION default_storage_engine=MyISAM;
SELECT @@default_storage_engine;
@@default_storage_engine
MyISAM
SET GLOBAL wsrep_replicate_myisam=OFF;
SET GLOBAL wsrep_mode=STRICT_REPLICATION;
CREATE TABLE t3 (c1 VARCHAR(10)) ENGINE=InnoDB;
ALTER TABLE t3 ENGINE=NonExistentEngine;
Expand Down
7 changes: 4 additions & 3 deletions mysql-test/suite/galera/r/galera_defaults.result
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
connection node_2;
connection node_1;
# Correct Galera library found
SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
expect 49
50
SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
expect 51
51
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME LIKE 'wsrep_%'
Expand Down Expand Up @@ -40,6 +40,7 @@ WSREP_LOAD_DATA_SPLITTING OFF
WSREP_LOG_CONFLICTS OFF
WSREP_MAX_WS_ROWS 0
WSREP_MAX_WS_SIZE 2147483647
WSREP_MODE
WSREP_MYSQL_REPLICATION_BUNDLE 0
WSREP_NOTIFY_CMD
WSREP_ON ON
Expand Down
49 changes: 25 additions & 24 deletions mysql-test/suite/galera/r/galera_flush_local.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ connection node_2;
connection node_1;
DROP TABLE IF EXISTS t1, t2, x1, x2;
connection node_1;
SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
Expand Down Expand Up @@ -64,18 +65,18 @@ test.x2 repair status OK
connection node_2;
wsrep_last_committed_diff
1
SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10 FROM x1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10000 FROM t2;
COUNT(*) = 10000
1
SELECT COUNT(*) = 10 FROM x2;
COUNT(*) = 10
1
SELECT COUNT(*) AS EXPECT_10 FROM t1;
EXPECT_10
10
SELECT COUNT(*) AS EXPECT_10 FROM x1;
EXPECT_10
10
SELECT COUNT(*) AS EXPECT_10000 FROM t2;
EXPECT_10000
10000
SELECT COUNT(*) AS EXPECT_10 FROM x2;
EXPECT_10
10
connection node_1;
DROP TABLE t1, t2, x1, x2;
CREATE TABLE t1 (f1 INTEGER);
Expand Down Expand Up @@ -143,18 +144,18 @@ wsrep_last_committed_diff
1
wsrep_last_committed_diff2
1
SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10 FROM x1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10000 FROM t2;
COUNT(*) = 10000
1
SELECT COUNT(*) = 10 FROM x2;
COUNT(*) = 10
1
SELECT COUNT(*) AS EXPECT_10 FROM t1;
EXPECT_10
10
SELECT COUNT(*) AS EXPECT_10 FROM x1;
EXPECT_10
10
SELECT COUNT(*) AS EXPECT_10000 FROM t2;
EXPECT_10000
10000
SELECT COUNT(*) AS EXPECT_10 FROM x2;
EXPECT_10
10
connection node_1;
set wsrep_on=1;
DROP TABLE t1, t2, x1, x2;
86 changes: 57 additions & 29 deletions mysql-test/suite/galera/r/galera_strict_require_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -5,83 +5,111 @@ CREATE TABLE t1(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=INNODB;
CREATE TABLE t2(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MYISAM;
CREATE TABLE t3(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=ARIA;
CREATE TABLE t4(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MEMORY;
SET GLOBAL wsrep_replicate_myisam=ON;
SET GLOBAL log_warnings=2;
SET GLOBAL wsrep_mode= STRICT_REPLICATION;
SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_MYISAM,REPLICATE_ARIA";
INSERT INTO t1 values (1,'innodb1');
INSERT INTO t2 values (1,'myisam1');
INSERT INTO t3 values (1,'aria1');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (1,'memory1');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
SET GLOBAL wsrep_replicate_myisam=OFF;
SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_ARIA";
INSERT INTO t2 values (2,'myisam2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
SET GLOBAL wsrep_mode = "STRICT_REPLICATION,REPLICATE_MYISAM";
INSERT INTO t3 values (2,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
SET GLOBAL log_warnings=1;
INSERT INTO t1 values (2,'innodb2');
INSERT INTO t1 values (3,'innodb3');
INSERT INTO t2 values (3,'myisam3');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
INSERT INTO t3 values (2,'aria2');
INSERT INTO t3 values (3,'aria3');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (2,'memory2');
INSERT INTO t4 values (3,'memory3');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
include/assert_grep.inc [WSREP: wsrep_mode = STRICT_REPLICATION enabled.]
SET GLOBAL log_warnings=2;
INSERT INTO t2 values (4,'myisam3');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
INSERT INTO t3 values (4,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (4,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (5,'myisam3');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
INSERT INTO t3 values (5,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (5,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (6,'myisam3');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
INSERT INTO t3 values (6,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (6,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (7,'myisam3');
INSERT INTO t3 values (7,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (7,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (8,'myisam3');
INSERT INTO t3 values (8,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (8,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (9,'myisam3');
INSERT INTO t3 values (9,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (9,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (10,'myisam3');
INSERT INTO t3 values (10,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (10,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
INSERT INTO t2 values (11,'myisam3');
INSERT INTO t3 values (11,'aria2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
INSERT INTO t4 values (11,'memory2');
Warnings:
Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
SELECT COUNT(*) AS EXPECT_2 FROM t1;
EXPECT_2
2
SELECT COUNT(*) AS EXPECT_6 FROM t2;
EXPECT_6
6
SELECT COUNT(*) AS EXPECT_5 FROM t3;
EXPECT_5
5
SELECT COUNT(*) AS EXPECT_5 FROM t4;
EXPECT_5
5
SELECT COUNT(*) AS EXPECT_10 FROM t2;
EXPECT_10
11
SELECT COUNT(*) AS EXPECT_10 FROM t3;
EXPECT_10
11
SELECT COUNT(*) AS EXPECT_10 FROM t4;
EXPECT_10
10
connection node_2;
SELECT COUNT(*) AS EXPECT_2 FROM t1;
EXPECT_2
2
SELECT COUNT(*) AS EXPECT_1 FROM t2;
SELECT COUNT(*) AS EXPECT_10 FROM t2;
EXPECT_10
10
SELECT COUNT(*) AS EXPECT_1 FROM t3;
EXPECT_1
1
SELECT COUNT(*) AS EXPECT_0 FROM t3;
EXPECT_0
0
SELECT COUNT(*) AS EXPECT_0 FROM t4;
EXPECT_0
0
Expand Down
Loading

0 comments on commit 27d66d6

Please sign in to comment.