mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Galera MTR Tests: tests for WAN restart, xtrabackup options and others.
This commit is contained in:
committed by
Nirbhay Choubey
parent
ef7b08978b
commit
f9805e4c98
@@ -0,0 +1,36 @@
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
CREATE PROCEDURE p1 ()
|
||||
BEGIN
|
||||
DECLARE x INT DEFAULT 1;
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||
WHILE 1 DO
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
COMMIT;
|
||||
END WHILE;
|
||||
END|
|
||||
CALL p1();;
|
||||
CALL p1();;
|
||||
Killing server ...
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
count_equal
|
||||
1
|
||||
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
|
||||
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE
|
||||
2
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE
|
||||
2
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
|
||||
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
|
||||
20
mysql-test/suite/galera/r/galera_drop_multi.result
Normal file
20
mysql-test/suite/galera/r/galera_drop_multi.result
Normal file
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
|
||||
CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
|
||||
CREATE TEMPORARY TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
|
||||
CREATE TABLE t5 (f1 INTEGER);
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
INSERT INTO t5 VALUES (1);
|
||||
COMMIT;
|
||||
SHOW CREATE TABLE t1;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
SHOW CREATE TABLE t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
SHOW CREATE TABLE t3;
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
SHOW CREATE TABLE t4;
|
||||
ERROR 42S02: Table 'test.t4' doesn't exist
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
|
||||
DROP TABLE t5;
|
||||
4
mysql-test/suite/galera/r/galera_kill_applier.result
Normal file
4
mysql-test/suite/galera/r/galera_kill_applier.result
Normal file
@@ -0,0 +1,4 @@
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
22
mysql-test/suite/galera/r/galera_ssl_compression.result
Normal file
22
mysql-test/suite/galera/r/galera_ssl_compression.result
Normal file
@@ -0,0 +1,22 @@
|
||||
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
|
||||
VARIABLE_VALUE = 'Synced'
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
|
||||
VARIABLE_VALUE = 'Synced'
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
SET GLOBAL wsrep_provider_options = "socket.ssl_compression=No";
|
||||
ERROR HY000: Incorrect arguments to SET
|
||||
CREATE TABLE t1 (f1 VARCHAR(333) PRIMARY KEY, f2 BLOB) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (REPEAT('a', 333), REPEAT('b', 65535));
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('a', 333) AND f2 = REPEAT('b', 65535);
|
||||
COUNT(*) = 1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("Unknown parameter 'socket\.ssl_compression'");
|
||||
CALL mtr.add_suppression("Set options returned 7");
|
||||
@@ -0,0 +1,3 @@
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
||||
53
mysql-test/suite/galera/r/galera_wan_restart_ist.result
Normal file
53
mysql-test/suite/galera/r/galera_wan_restart_ist.result
Normal file
@@ -0,0 +1,53 @@
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (3);
|
||||
INSERT INTO t1 VALUES (4);
|
||||
INSERT INTO t1 VALUES (13);
|
||||
Shutting down server ...
|
||||
INSERT INTO t1 VALUES (11);
|
||||
INSERT INTO t1 VALUES (12);
|
||||
INSERT INTO t1 VALUES (14);
|
||||
INSERT INTO t1 VALUES (131);
|
||||
INSERT INTO t1 VALUES (22);
|
||||
Shutting down server ...
|
||||
INSERT INTO t1 VALUES (21);
|
||||
INSERT INTO t1 VALUES (23);
|
||||
INSERT INTO t1 VALUES (24);
|
||||
INSERT INTO t1 VALUES (221);
|
||||
INSERT INTO t1 VALUES (34);
|
||||
Shutting down server ...
|
||||
INSERT INTO t1 VALUES (31);
|
||||
INSERT INTO t1 VALUES (32);
|
||||
INSERT INTO t1 VALUES (33);
|
||||
INSERT INTO t1 VALUES (341);
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
53
mysql-test/suite/galera/r/galera_wan_restart_sst.result
Normal file
53
mysql-test/suite/galera/r/galera_wan_restart_sst.result
Normal file
@@ -0,0 +1,53 @@
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (3);
|
||||
INSERT INTO t1 VALUES (4);
|
||||
INSERT INTO t1 VALUES (13);
|
||||
Killing server ...
|
||||
INSERT INTO t1 VALUES (11);
|
||||
INSERT INTO t1 VALUES (12);
|
||||
INSERT INTO t1 VALUES (14);
|
||||
INSERT INTO t1 VALUES (131);
|
||||
INSERT INTO t1 VALUES (22);
|
||||
Killing server ...
|
||||
INSERT INTO t1 VALUES (21);
|
||||
INSERT INTO t1 VALUES (23);
|
||||
INSERT INTO t1 VALUES (24);
|
||||
INSERT INTO t1 VALUES (221);
|
||||
INSERT INTO t1 VALUES (34);
|
||||
Killing server ...
|
||||
INSERT INTO t1 VALUES (31);
|
||||
INSERT INTO t1 VALUES (32);
|
||||
INSERT INTO t1 VALUES (33);
|
||||
INSERT INTO t1 VALUES (341);
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
COUNT(*) = 19
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
13
mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
Normal file
13
mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
Normal file
@@ -0,0 +1,13 @@
|
||||
!include ../galera_2nodes.cnf
|
||||
|
||||
[mysqld]
|
||||
#wsrep_sst_method=xtrabackup-v2
|
||||
#wsrep_sst_auth="root:"
|
||||
#wsrep_debug=ON
|
||||
|
||||
[mysqld.1]
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
|
||||
|
||||
[mysqld.2]
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
|
||||
|
||||
95
mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
Normal file
95
mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
Normal file
@@ -0,0 +1,95 @@
|
||||
#
|
||||
# Test that autoincrement works correctly while the cluster membership
|
||||
# is changing and IST takes place.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
--let $connection_id = `SELECT CONNECTION_ID()`
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
|
||||
# Issue an endless stream of autoincrement inserts
|
||||
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1 ()
|
||||
BEGIN
|
||||
DECLARE x INT DEFAULT 1;
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||
|
||||
WHILE 1 DO
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
COMMIT;
|
||||
END WHILE;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
--send CALL p1();
|
||||
--sleep 2
|
||||
|
||||
--connection node_2
|
||||
--send CALL p1();
|
||||
--sleep 2
|
||||
|
||||
# Kill and restart node #2
|
||||
|
||||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--connection node_2a
|
||||
--source include/kill_galera.inc
|
||||
|
||||
--sleep 10
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 25
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
|
||||
# Terminate the stored procedure
|
||||
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
--connection node_1a
|
||||
--disable_query_log
|
||||
--eval KILL CONNECTION $connection_id
|
||||
--enable_query_log
|
||||
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
|
||||
--connection node_1
|
||||
# CR_SERVER_LOST
|
||||
--error 2013,2006
|
||||
--reap
|
||||
|
||||
--connection node_2
|
||||
# CR_SERVER_LOST
|
||||
--error 2013,2006
|
||||
--reap
|
||||
|
||||
--sleep 10
|
||||
|
||||
# Confirm that the count is correct and that the cluster is intact
|
||||
|
||||
--connection node_1a
|
||||
--let $count = `SELECT COUNT(*) FROM t1`
|
||||
|
||||
--connection node_2a
|
||||
--disable_query_log
|
||||
--eval SELECT COUNT(*) = $count AS count_equal FROM t1
|
||||
--enable_query_log
|
||||
|
||||
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
|
||||
|
||||
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
|
||||
--connection node_1a
|
||||
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
|
||||
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
|
||||
41
mysql-test/suite/galera/t/galera_drop_multi.test
Normal file
41
mysql-test/suite/galera/t/galera_drop_multi.test
Normal file
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# Test that multi-table DROP TABLE statements are properly replicated
|
||||
# See http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
|
||||
CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
|
||||
CREATE TEMPORARY TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE t5 (f1 INTEGER);
|
||||
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
INSERT INTO t5 VALUES (1);
|
||||
|
||||
COMMIT;
|
||||
|
||||
--connection node_2
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t2;
|
||||
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t3;
|
||||
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t4;
|
||||
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
|
||||
|
||||
--connection node_1
|
||||
DROP TABLE t5;
|
||||
26
mysql-test/suite/galera/t/galera_kill_applier.test
Normal file
26
mysql-test/suite/galera/t/galera_kill_applier.test
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
|
||||
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1`
|
||||
|
||||
--disable_query_log
|
||||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
||||
--eval KILL $applier_thread
|
||||
|
||||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
||||
--eval KILL QUERY $applier_thread
|
||||
|
||||
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1`
|
||||
|
||||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
||||
--eval KILL $aborter_thread
|
||||
|
||||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
||||
--eval KILL QUERY $aborter_thread
|
||||
--enable_query_log
|
||||
@@ -0,0 +1,24 @@
|
||||
!include ../galera_2nodes.cnf
|
||||
|
||||
[mysqld]
|
||||
wsrep_sst_method=xtrabackup-v2
|
||||
wsrep_sst_auth="root:"
|
||||
wsrep_debug=ON
|
||||
|
||||
[xtrabackup]
|
||||
backup-locks
|
||||
close-files
|
||||
compact
|
||||
# compression requires qpress from the Percona repositories
|
||||
# compress
|
||||
# compress-threads=2
|
||||
encryption=AES256
|
||||
encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
|
||||
galera-info
|
||||
history=backup
|
||||
parallel=2
|
||||
|
||||
[SST]
|
||||
encrypt=1
|
||||
encrypt-algo=AES256
|
||||
encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
|
||||
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# This test checks that various options can be passed to xtrabackup via the my.cnf file
|
||||
# Initial SST happens via xtrabackup, so there is not much to do in the body of the test
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
SELECT 1;
|
||||
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
14
mysql-test/suite/galera/t/galera_wan_restart_ist.cnf
Normal file
14
mysql-test/suite/galera/t/galera_wan_restart_ist.cnf
Normal file
@@ -0,0 +1,14 @@
|
||||
!include ../galera_4nodes.cnf
|
||||
|
||||
[mysqld.1]
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1'
|
||||
|
||||
[mysqld.2]
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1'
|
||||
|
||||
[mysqld.3]
|
||||
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2'
|
||||
|
||||
[mysqld.4]
|
||||
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2'
|
||||
|
||||
148
mysql-test/suite/galera/t/galera_wan_restart_ist.test
Normal file
148
mysql-test/suite/galera/t/galera_wan_restart_ist.test
Normal file
@@ -0,0 +1,148 @@
|
||||
#
|
||||
# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
|
||||
#
|
||||
# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
|
||||
# to be down at the same time, so restarts are sequential.
|
||||
#
|
||||
# We can not test any of the actual WAN optimizations from inside MTR and no
|
||||
# status variables are provided. So we only check that simple replication works.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (3);
|
||||
|
||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (4);
|
||||
|
||||
#
|
||||
# Restart node #3
|
||||
#
|
||||
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (13);
|
||||
|
||||
--echo Shutting down server ...
|
||||
--source include/shutdown_mysqld.inc
|
||||
--sleep 5
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (11);
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (12);
|
||||
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (14);
|
||||
|
||||
--connection node_3
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 5
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (131);
|
||||
|
||||
#
|
||||
# Restart node #2
|
||||
#
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (22);
|
||||
|
||||
--echo Shutting down server ...
|
||||
--source include/shutdown_mysqld.inc
|
||||
--sleep 5
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (21);
|
||||
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (23);
|
||||
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (24);
|
||||
|
||||
--connection node_2
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 5
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (221);
|
||||
|
||||
#
|
||||
# Restart node #4
|
||||
#
|
||||
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (34);
|
||||
|
||||
--echo Shutting down server ...
|
||||
--source include/shutdown_mysqld.inc
|
||||
--sleep 5
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (31);
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (32);
|
||||
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (33);
|
||||
|
||||
--connection node_4
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 5
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (341);
|
||||
|
||||
|
||||
#
|
||||
# Check all nodes
|
||||
#
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_3
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_4
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
|
||||
--connection node_3
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
|
||||
--connection node_4
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
14
mysql-test/suite/galera/t/galera_wan_restart_sst.cnf
Normal file
14
mysql-test/suite/galera/t/galera_wan_restart_sst.cnf
Normal file
@@ -0,0 +1,14 @@
|
||||
!include ../galera_4nodes.cnf
|
||||
|
||||
[mysqld.1]
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1'
|
||||
|
||||
[mysqld.2]
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1'
|
||||
|
||||
[mysqld.3]
|
||||
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2'
|
||||
|
||||
[mysqld.4]
|
||||
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2'
|
||||
|
||||
145
mysql-test/suite/galera/t/galera_wan_restart_sst.test
Normal file
145
mysql-test/suite/galera/t/galera_wan_restart_sst.test
Normal file
@@ -0,0 +1,145 @@
|
||||
#
|
||||
# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
|
||||
#
|
||||
# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
|
||||
# to be down at the same time, so restarts are sequential.
|
||||
#
|
||||
# We can not test any of the actual WAN optimizations from inside MTR and no
|
||||
# status variables are provided. So we only check that simple replication works.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (3);
|
||||
|
||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (4);
|
||||
|
||||
#
|
||||
# Restart node #3
|
||||
#
|
||||
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (13);
|
||||
|
||||
--source include/kill_galera.inc
|
||||
--sleep 5
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (11);
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (12);
|
||||
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (14);
|
||||
|
||||
--connection node_3
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 5
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (131);
|
||||
|
||||
#
|
||||
# Restart node #2
|
||||
#
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (22);
|
||||
|
||||
--source include/kill_galera.inc
|
||||
--sleep 5
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (21);
|
||||
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (23);
|
||||
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (24);
|
||||
|
||||
--connection node_2
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 5
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (221);
|
||||
|
||||
#
|
||||
# Restart node #4
|
||||
#
|
||||
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (34);
|
||||
|
||||
--source include/kill_galera.inc
|
||||
--sleep 5
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (31);
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (32);
|
||||
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (33);
|
||||
|
||||
--connection node_4
|
||||
--source include/start_mysqld.inc
|
||||
--sleep 5
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
INSERT INTO t1 VALUES (341);
|
||||
|
||||
|
||||
#
|
||||
# Check all nodes
|
||||
#
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_3
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_4
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
SELECT COUNT(*) = 19 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
|
||||
--connection node_3
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
|
||||
--connection node_4
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
Reference in New Issue
Block a user