1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
# WL#3584 GTID.
#
# Testing failover scenarios.
--source include/have_binlog_format_mixed.inc
#
# Set up 3 server replication chain: M1 -> S2 -> S3.
# Remove S2 and show M1 -> S3 works.
#
--let $rpl_topology= 1->2->3
--source include/rpl_init.inc
--echo
--connection server_1
create table t1 (a int not null auto_increment, b int not null, primary key(a)) engine=innodb;
--source include/rpl_sync.inc
--connection server_3
--source include/stop_slave.inc
#--let $rpl_topology= 1->2, 1->3
#--source include/rpl_change_topology.inc
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
--eval CHANGE REPLICATION SOURCE to SOURCE_PORT=$SERVER_MYPORT_1;
--source include/start_slave.inc
--connection server_1
insert into t1 values (NULL, 1);
--let $sync_slave_connection= server_2
--source include/sync_slave_sql_with_master.inc
--connection server_1
--let $sync_slave_connection= server_3
--source include/sync_slave_sql_with_master.inc
--let $diff_tables= server_1:test.t1, server_2:test.t1, server_3:test.t1
--source include/diff_tables.inc
#
# remove master, and set up S2 -> S3 link
# S3 proves to fail over S2 the new master.
# --let $rpl_topology= 2->3
#
--connection server_3
--source include/stop_slave.inc
--connection server_1
insert into t1 values (NULL, 2); # won't be seen by S3 until it connects to S2
--let $sync_slave_connection= server_2
--source include/sync_slave_sql_with_master.inc
--source include/stop_slave.inc
--connection server_3
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
--eval CHANGE REPLICATION SOURCE to SOURCE_PORT=$SERVER_MYPORT_2
--source include/start_slave.inc
--connection server_2
--let $sync_slave_connection= server_3
--source include/sync_slave_sql_with_master.inc
--let $diff_tables= server_1:test.t1, server_2:test.t1, server_3:test.t1
--source include/diff_tables.inc
# Restore M1 -> S2 -> S3
--connection server_2
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
--eval CHANGE REPLICATION SOURCE to SOURCE_PORT=$SERVER_MYPORT_1
--source include/start_slave.inc
#
# Clean up
#
--echo *** Clean up ***
--connection server_1
DROP TABLE t1;
--source include/rpl_sync.inc
--source include/rpl_end.inc
|