Commit 5c954553 authored by Jan Lindström's avatar Jan Lindström

MDEV-21601 : Cleanup Galera disabled tests

* Remove those tests that will not be supported on that release.
* Make sure that correct tests are disabled and have MDEVs
* Sort test names

This should not be merged upwards.
parent f37a56de
......@@ -15,21 +15,14 @@ MW-328A : MDEV-21483 galera.MW-328A galera.MW-328B
MW-328B : MDEV-21483 galera.MW-328A galera.MW-328B
MW-329 : MDEV-19962 Galera test failure on MW-329
galera.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults
galera_account_management : MariaDB 10.0 does not support ALTER USER
galera_as_master_gtid : Requires MySQL GTID
galera_as_master_gtid_change_master : Requires MySQL GTID
galera_as_slave_gtid_myisam : MDEV-21421 galera.galera_as_slave_gtid_myisam
galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
galera_autoinc_sst_mariabackup : Known issue, may require porting MDEV-17458 from later versions
galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_flush : MariaDB does not have global.thread_statistics
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_ist_mariabackup : MDEV-18829 test leaves port open
galera_ist_progress : MDEV-15236 fails when trying to read transfer status
galera_load_data : MDEV-19968 galera.galera_load_data
galera_migrate : MariaDB does not support START SLAVE USER
galera_parallel_autoinc_largetrx : MDEV-20916 galera.galera_parallel_autoinc_largetrx
galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
......
connection node_1;
CREATE USER user1, user2 IDENTIFIED BY 'password';
connection node_2;
SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
COUNT(*) = 2
1
connection node_1;
ALTER USER user1 PASSWORD EXPIRE;
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
password_expired = 'Y'
1
connection node_2;
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
password_expired = 'Y'
1
connection node_1;
RENAME USER user2 TO user3;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
COUNT(*) = 1
1
connection node_1;
SET PASSWORD FOR user3 = PASSWORD('foo');
connection node_1;
SELECT password != '' FROM mysql.user WHERE user = 'user3';
password != ''
1
connection node_1;
DROP USER user1, user3;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
COUNT(*) = 0
1
connection node_1;
GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
connection node_2;
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
COUNT(*) = 1
1
SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
Select_priv = 'Y'
1
connection node_1;
CREATE USER user5;
GRANT PROXY ON user4 TO user5;
connection node_2;
SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
COUNT(*) = 1
1
connection node_1;
REVOKE ALL PRIVILEGES ON *.* FROM user4;
connection node_2;
SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
Select_priv = 'N'
1
connection node_1;
REVOKE PROXY ON user4 FROM user5;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
COUNT(*) = 0
1
DROP USER user4, user5;
START SLAVE USER='root';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
uuids_do_not_match
1
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000002 120 Previous_gtids 1 151
mysqld-bin.000002 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
mysqld-bin.000002 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000002 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
mysqld-bin.000002 375 Query 1 452 BEGIN
mysqld-bin.000002 452 Table_map 1 497 table_id: # (test.t1)
mysqld-bin.000002 497 Write_rows 1 537 table_id: # flags: STMT_END_F
mysqld-bin.000002 537 Xid 1 568 COMMIT /* xid=# */
INSERT INTO t1 VALUES(2);
uuids_do_not_match
1
uuids_match
1
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000003 120 Previous_gtids 2 151
mysqld-bin.000003 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
mysqld-bin.000003 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000003 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
mysqld-bin.000003 375 Query 1 443 BEGIN
mysqld-bin.000003 443 Table_map 1 488 table_id: # (test.t1)
mysqld-bin.000003 488 Write_rows 1 528 table_id: # flags: STMT_END_F
mysqld-bin.000003 528 Xid 1 559 COMMIT /* xid=# */
mysqld-bin.000003 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
mysqld-bin.000003 607 Query 2 684 BEGIN
mysqld-bin.000003 684 Table_map 2 729 table_id: # (test.t1)
mysqld-bin.000003 729 Write_rows 2 769 table_id: # flags: STMT_END_F
mysqld-bin.000003 769 Xid 2 800 COMMIT /* xid=# */
uuids_do_not_match
1
uuids_match
1
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000001 120 Previous_gtids 3 151
mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
mysqld-bin.000001 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000001 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
mysqld-bin.000001 375 Query 1 443 BEGIN
mysqld-bin.000001 443 Table_map 1 488 table_id: # (test.t1)
mysqld-bin.000001 488 Write_rows 1 528 table_id: # flags: STMT_END_F
mysqld-bin.000001 528 Xid 1 559 COMMIT /* xid=# */
mysqld-bin.000001 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
mysqld-bin.000001 607 Query 2 675 BEGIN
mysqld-bin.000001 675 Table_map 2 720 table_id: # (test.t1)
mysqld-bin.000001 720 Write_rows 2 760 table_id: # flags: STMT_END_F
mysqld-bin.000001 760 Xid 2 791 COMMIT /* xid=# */
DROP TABLE t1;
STOP SLAVE;
RESET SLAVE ALL;
START SLAVE USER='root';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
STOP SLAVE;
START SLAVE USER='root';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
INSERT INTO t1 VALUES(3);
INSERT INTO t1 VALUES(4);
DROP TABLE t1;
STOP SLAVE;
RESET SLAVE ALL;
START SLAVE USER='root';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
1
SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
COUNT(*) = 2 * 100 * 10 * 10
1
SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
1
DROP TABLE t1;
DROP TABLE ten;
STOP SLAVE;
RESET SLAVE ALL;
SET GLOBAL binlog_rows_query_log_events=TRUE;
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
SET GLOBAL binlog_rows_query_log_events = 0;
DROP TABLE t1;
DROP TABLE IF EXISTS t1, t2;
FLUSH DES_KEY_FILE;
wsrep_last_committed_diff
1
FLUSH HOSTS;
wsrep_last_committed_diff
1
SET GLOBAL wsrep_replicate_myisam = TRUE;
INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N','N','',0);
FLUSH PRIVILEGES;
DELETE FROM mysql.user WHERE user = 'user1';
SET GLOBAL wsrep_replicate_myisam = FALSE;
FLUSH PRIVILEGES;
FLUSH QUERY CACHE;
wsrep_last_committed_diff
1
FLUSH STATUS;
wsrep_last_committed_diff
1
FLUSH USER_RESOURCES;
wsrep_last_committed_diff
1
FLUSH TABLES;
wsrep_last_committed_diff
1
CREATE TABLE t2 (f1 INTEGER);
FLUSH TABLES t2;
wsrep_last_committed_diff
1
FLUSH ERROR LOGS;
wsrep_last_committed_diff
1
FLUSH SLOW LOGS;
wsrep_last_committed_diff
1
FLUSH GENERAL LOGS;
wsrep_last_committed_diff
1
FLUSH ENGINE LOGS;
wsrep_last_committed_diff
1
FLUSH RELAY LOGS;
wsrep_last_committed_diff
1
SET @userstat_old= @@userstat;
SET GLOBAL userstat=ON;
FLUSH CLIENT_STATISTICS;
FLUSH INDEX_STATISTICS;
FLUSH TABLE_STATISTICS;
FLUSH USER_STATISTICS;
wsrep_last_committed_diff
1
SET @old_thread_statistics= @@global.thread_statistics;
SET GLOBAL thread_statistics= ON;
FLUSH THREAD_STATISTICS;
wsrep_last_committed_diff
1
FLUSH CHANGED_PAGE_BITMAPS;
wsrep_last_committed_diff
1
CREATE TABLE t1 (f1 INTEGER);
FLUSH LOGS;
FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
FLUSH TABLES t1 WITH READ LOCK;
UNLOCK TABLES;
FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
wsrep_last_committed_diff
1
LOCK TABLES t1 WRITE;
FLUSH TABLES t1;
UNLOCK TABLES;
wsrep_last_committed_diff
1
LOCK TABLES t1 READ;
FLUSH TABLES t1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES;
wsrep_last_committed_diff
1
FLUSH TABLES t1;
wsrep_last_committed_diff
1
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL userstat= @userstat_old;
SET GLOBAL thread_statistics= @old_thread_statistics;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
START SLAVE USER='root';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
INSERT INTO t1 VALUES (2);
START SLAVE USER='root';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
SET GLOBAL wsrep_cluster_address='gcomm://';
INSERT INTO t1 VALUES (5);
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 1
1
INSERT INTO t1 VALUES (6);
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
STOP SLAVE;
RESET SLAVE ALL;
STOP SLAVE;
RESET SLAVE ALL;
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
SELECT COUNT(*) = 8 FROM t1;
COUNT(*) = 8
1
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
SELECT COUNT(*) = 8 FROM t1;
COUNT(*) = 8
1
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
DROP TABLE t1;
DROP TABLE t1;
SET GLOBAL wsrep_provider = 'none';
SET GLOBAL wsrep_sst_auth = '';
SET GLOBAL wsrep_provider_options = '';
DROP TABLE t1;
DROP USER sst;
SET GLOBAL wsrep_provider = 'none';
SET GLOBAL wsrep_sst_method = 'rsync';
SET GLOBAL wsrep_provider_options = '';
SET GLOBAL wsrep_sst_receive_address = 'AUTO';
DROP TABLE t1;
DROP USER sst;
CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
#
# Test the account management statements - GRANT, REVOKE, etc.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
#
# CREATE USER
#
--connection node_1
CREATE USER user1, user2 IDENTIFIED BY 'password';
--connection node_2
SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
#
# ALTER USER
#
--connection node_1
ALTER USER user1 PASSWORD EXPIRE;
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
--connection node_2
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
#
# RENAME USER
#
--connection node_1
RENAME USER user2 TO user3;
--connection node_2
SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
#
# SET PASSWORD
#
--connection node_1
SET PASSWORD FOR user3 = PASSWORD('foo');
--connection node_1
SELECT password != '' FROM mysql.user WHERE user = 'user3';
#
# DROP USER
#
--connection node_1
DROP USER user1, user3;
--connection node_2
SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
#
# GRANT
#
--connection node_1
GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
--connection node_2
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
#
# GRANT PROXY ON
#
--connection node_1
CREATE USER user5;
GRANT PROXY ON user4 TO user5;
--connection node_2
SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
#
# REVOKE
#
--connection node_1
REVOKE ALL PRIVILEGES ON *.* FROM user4;
--connection node_2
SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
#
# REVOKE PROXY
#
--connection node_1
REVOKE PROXY ON user4 FROM user5;
--connection node_2
SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
DROP USER user4, user5;
!include ../galera_2nodes_as_master.cnf
[mysqld]
gtid-mode=ON
log-bin=mysqld-bin
log-slave-updates
enforce-gtid-consistency
binlog-format=ROW
#
# Test Galera as a master to a MySQL slave with GTID
#
# The galera/galera_2node_master.cnf describes the setup of the nodes
#
# We check that all transactions originating from within Galera use a UUID that is
# different from the server_uuid of either node
#
#
--source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/galera_cluster.inc
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE USER='root';
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
--let $effective_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
--disable_query_log
--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
--enable_query_log
--replace_result $effective_uuid <effective_uuid>
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120;
--connection node_2
INSERT INTO t1 VALUES(2);
--disable_query_log
--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
--eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match;
--enable_query_log
--replace_result $effective_uuid <effective_uuid>
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120;
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc
--disable_query_log
--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
--eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match;
--enable_query_log
--replace_result $effective_uuid <effective_uuid>
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
--connection node_1
DROP TABLE t1;
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
STOP SLAVE;
RESET SLAVE ALL;
!include ../galera_2nodes_as_master.cnf
[mysqld]
gtid-mode=ON
log-bin=mysqld-bin
log-slave-updates
enforce-gtid-consistency
binlog-format=ROW
#
# Test that a MySQL slave can use CHANGE MASTER MASTER_AUTO_POSITION to begin replicating
# from another Galera node
#
# The galera/galera_2node_master.cnf describes the setup of the nodes
#
#
--source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/galera_cluster.inc
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE USER='root';
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
--connection node_2
INSERT INTO t1 VALUES(2);
--connection node_3
STOP SLAVE;
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_2, MASTER_AUTO_POSITION=1;
--enable_query_log
START SLAVE USER='root';
--connection node_1
INSERT INTO t1 VALUES(3);
--connection node_2
INSERT INTO t1 VALUES(4);
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc
--connection node_1
DROP TABLE t1;
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
STOP SLAVE;
RESET SLAVE ALL;
!include ../galera_2nodes_as_slave.cnf
[mysqld]
wsrep-preordered=TRUE
#
# Test Galera as a slave to a MySQL master with --wsrep-preordered=TRUE
#
# The galera/galera_2node_slave.cnf describes the setup of the nodes
#
--source include/have_innodb.inc
--source include/have_log_bin.inc
# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--source include/galera_cluster.inc
--connection node_2
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE USER='root';
#
# Issue many large-ish transaction on the async master
#
--connection node_1
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
--disable_query_log
--let $count = 100
while ($count)
{
--eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
--dec $count
}
--enable_query_log
#
# While the async transactions are being applied, issue another set of transactions
# on the Galera node.
#
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $count = 100
--disable_query_log
while ($count)
{
--eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
--dec $count
}
--enable_query_log
#
# Confirm that all transactions successfully committed
#
--let $wait_condition = SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
#
# Cleanup
#
--connection node_1
DROP TABLE t1;
DROP TABLE ten;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
STOP SLAVE;
RESET SLAVE ALL;
#
# Test that Galera continues to run even with binlog-rows-query-log-events=TRUE
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $binlog_rows_query_log_events_orig = `SELECT @@binlog_rows_query_log_events`
SET GLOBAL binlog_rows_query_log_events=TRUE;
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
SELECT COUNT(*) = 1 FROM t1;
--connection node_1
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
--connection node_2
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
--connection node_1
--eval SET GLOBAL binlog_rows_query_log_events = $binlog_rows_query_log_events_orig
DROP TABLE t1;
!include ../galera_2nodes.cnf
[mysqld.1]
query_cache_type=1
query_cache_size=1000000
[mysqld.2]
query_cache_type=1
query_cache_size=1000000
This diff is collapsed.
#
# This .cnf file starts 4 servers without enabling Galera.
# The galera_migrate.test will set wsrep_provider and the other settings as needed.
#
!include include/default_mysqld.cnf
[mysqld]
binlog-format=row
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
log-bin=mysqld-bin
wsrep_node_address=127.0.0.1
wsrep_causal_reads=ON
wsrep_sync_wait = 15
[mysqld.1]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
[mysqld.2]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
[mysqld.3]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
[mysqld.4]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_MYPORT_4= @mysqld.4.port
NODE_MYSOCK_4= @mysqld.4.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_GALERAPORT_4= @mysqld.4.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
NODE_SSTPORT_4= @mysqld.4.#sst_port
#
# Execute a migration from MariaDB replication to Galera replication.
# The test starts with 4 stand-alone servers defined by galera_migrate.cnf and then
# performs the following steps:
#
# 1. Begin with a single MySQL server
# 2. Establish traditional MySQL master-slave replication
# 3. Attach a new sever to serve as a MySQL replication slave
# 4. Enable Galera on the new slave and create a single-node Galera cluster
# 5. Attach a second Galera node
# 6. Turn off the traditional replication parts of the system
# 7. Continue replicating within Galera only
#
--source include/big_test.inc
--source include/have_innodb.inc
--source include/have_log_bin.inc
#
# Step #1 Begin with a single server
#
--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
#
# Step #2. Establish traditional MySQL replication
#
--connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1;
--enable_query_log
START SLAVE;
--connection node_1
INSERT INTO t1 VALUES (2);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc
#
# Step #3. Attach a second slave, later to be converted to Galera
#
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1;
--enable_query_log
START SLAVE USER='root';
--connection node_1
INSERT INTO t1 VALUES (3);
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
--source include/wait_condition.inc
#
# Step #4. Convert this MySQL slave into a Galera node
#
--connection node_1
INSERT INTO t1 VALUES (4);
--connection node_3
--disable_query_log
--eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER'
--eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_3'
--enable_query_log
SET GLOBAL wsrep_cluster_address='gcomm://';
--connection node_1
INSERT INTO t1 VALUES (5);
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
INSERT INTO t1 VALUES (6);
#
# Step #5. Attach a second Galera node using mysqldump SST
#
--connection node_3
# We need a user with a password for mysqldump SST
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
GRANT ALL PRIVILEGES ON *.* TO 'sst';
--disable_query_log
--eval SET GLOBAL wsrep_sst_method = 'mysqldump';
--eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER'
--eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_4'
--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_4';
--eval SET GLOBAL wsrep_cluster_address='gcomm://127.0.0.1:$NODE_GALERAPORT_3'
--enable_query_log
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 6 FROM t1;
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
#
# Step #6. Turn off traditional replication
#
--connection node_2
STOP SLAVE;
RESET SLAVE ALL;
--connection node_3
STOP SLAVE;
RESET SLAVE ALL;
#
# Step #7. Continue replicating within Galera only
#
# We need fresh connections due to galera#191
--connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3
INSERT INTO t1 VALUES (7);
--connect node_4a, 127.0.0.1, root, , test, $NODE_MYPORT_4
INSERT INTO t1 VALUES (8);
--connection node_4a
SELECT COUNT(*) = 8 FROM t1;
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_3a
SELECT COUNT(*) = 8 FROM t1;
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
#
# Teardown
#
--connection node_1
DROP TABLE t1;
--connection node_2
DROP TABLE t1;
--connection node_3
SET GLOBAL wsrep_provider = 'none';
SET GLOBAL wsrep_sst_auth = '';
SET GLOBAL wsrep_provider_options = '';
DROP TABLE t1;
DROP USER sst;
--connection node_4
SET GLOBAL wsrep_provider = 'none';
SET GLOBAL wsrep_sst_method = 'rsync';
SET GLOBAL wsrep_provider_options = '';
SET GLOBAL wsrep_sst_receive_address = 'AUTO';
DROP TABLE t1;
DROP USER sst;
CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment