EVOLUTION-MANAGER
Edit File: galera_as_slave_preordered.test
# # 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;