Debian Codegraph @

mysql-test/suite/rpl/t/rpl_gtid_failover.test

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