-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Galera MTR Tests: tests for WAN restart, xtrabackup options and others.
- Loading branch information
1 parent
ef7b089
commit f9805e4
Showing
17 changed files
with
724 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
3 changes: 3 additions & 0 deletions
3
mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SELECT 1; | ||
1 | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 13 additions & 0 deletions
13
mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 95 additions & 0 deletions
95
mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.