Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_line_topology_block_receiver.test

raw
1 # ==== Purpose ====
2 # This test case verifies that receiver threads GTID sets do not rely on
3 # global SID anymore. Because of this, it is possible to have a receiver thread
4 # receiving GTIDs (and adding them to its retrieved GTID set) and having other
5 # servers replicating from it.
6 #
7 # The test uses debug instrumentation to pause the receiver thread while
8 # adding the received gtid to received_transaction_set, verifies that other
9 # servers can connect to it and replicate without problems.
10 #
11 # ==== Related Bugs and Worklogs ====
12 #
13 # WL#8599: Reduce contention in IO and SQL threads
14 #
15
16 --source include/have_debug.inc
17 --source include/have_debug_sync.inc
18
19 --let $rpl_gtid_utils=1
20 --let $rpl_skip_start_slave=1
21 --let $rpl_topology=1->2,2->3
22 --source include/rpl_init.inc
23
24 --let $rpl_connection_name= server_1
25 --source include/rpl_connection.inc
26 --let $master1_uuid=`SELECT @@global.server_uuid`
27 # Create one table, populate it, then drop it
28 CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
29 INSERT INTO t1 VALUES(1);
30
31 --let $rpl_connection_name= server_2
32 --source include/rpl_connection.inc
33 --source include/start_slave.inc
34
35 --let $rpl_connection_name= server_1
36 --source include/rpl_connection.inc
37 --let $sync_slave_connection= server_2
38 --source include/sync_slave_sql_with_master.inc
39
40 # Add debug instrumentation to hold the receiver thread
41 # while writing to the relay log.
42 --let $debug_point=updating_received_transaction_set
43 --source include/add_debug_point.inc
44
45 # Execute transaction on server1
46 --let $rpl_connection_name= server_1
47 --source include/rpl_connection.inc
48 INSERT INTO t1 VALUES(2);
49
50 # Wait until the receiver reached the debug point on server2
51 --let $rpl_connection_name= server_2
52 --source include/rpl_connection.inc
53 SET DEBUG_SYNC="now WAIT_FOR reached_updating_received_transaction_set";
54
55 # Insert on master2 and execution of SELECT @@GLOBAL.GTID_EXECUTED is successful
56 SET GTID_NEXT='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
57 INSERT INTO t1 VALUES(3);
58 SET GTID_NEXT= AUTOMATIC;
59
60 --let $wait_condition= SELECT COUNT(*) = 2 FROM t1
61 --source include/wait_condition_or_abort.inc
62
63 --let $assert_text= Insert on master2/slave1 is successful
64 --let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED,"$master1_uuid:1-2,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1")
65 --source include/assert.inc
66
67 --let $rpl_connection_name= server_3
68 --source include/rpl_connection.inc
69 --source include/start_slave.inc
70
71 --let $rpl_connection_name= server_2
72 --source include/rpl_connection.inc
73 --echo sync server_3 with server_2
74 --let $sync_slave_connection= server_3
75 --source include/sync_slave_sql_with_master.inc
76
77 --let $rpl_connection_name= server_2
78 --source include/rpl_connection.inc
79 --let $debug_point=updating_received_transaction_set
80 --source include/remove_debug_point.inc
81
82 # Let the receiver of server2 continue
83 SET DEBUG_SYNC="now SIGNAL continue_updating_received_transaction_set";
84
85 --echo sync server_3 with server_2
86 --let $sync_slave_connection= server_3
87 --source include/sync_slave_sql_with_master.inc
88
89 # Cleanup
90 --let $rpl_connection_name= server_1
91 --source include/rpl_connection.inc
92 DROP TABLE t1;
93
94 --let $use_gtids= 1
95 --source include/rpl_end.inc