mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
70 lines
2.2 KiB
Text
70 lines
2.2 KiB
Text
#
|
|
# 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;
|