Debian Codegraph @

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

raw
1 # ==== Purpose ====
2 #
3 # This test will make use of all replication include files for
4 # a new created channel and also for the default channel, always
5 # passing the channel name as a parameter.
6 #
7 # ==== Related Bugs and Worklogs ====
8 #
9 # BUG#21146550 MTR RPL INCLUDES DO NOT SUPPORT DEFAULT CHANNEL AS
10 # $RPL_CHANNEL_NAME
11 #
12
13 # This test case is binary log format agnostic
14 --source include/have_binlog_format_mixed.inc
15 # Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE
16 --source include/have_slave_repository_type_table.inc
17
18 --let $rpl_gtid_utils= 1
19 --source include/master-slave.inc
20
21 --source include/rpl_connection_slave.inc
22 # Suppression of error messages
23 CALL mtr.add_suppression('Duplicate entry .* for key');
24 CALL mtr.add_suppression('A replica with the same server_uuid/server_id as this replica has connected to the source');
25 CALL mtr.add_suppression('The replica coordinator and worker threads are stopped');
26
27
28 # Create a new channel on slave
29 --replace_result $MASTER_MYPORT MASTER_PORT
30 --eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='127.0.0.1', SOURCE_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1'
31
32 --echo #
33 --echo # Start and stop slave
34 --echo #
35
36 --let $rpl_channel_name= ''
37 --source include/stop_slave.inc
38 --let $rpl_channel_name= 'ch1'
39 --source include/start_slave.inc
40 --source include/check_slave_is_running.inc
41 --source include/check_slave_no_error.inc
42 --source include/stop_slave.inc
43 --let $rpl_channel_name= ''
44 --source include/start_slave.inc
45 --source include/check_slave_is_running.inc
46 --source include/check_slave_no_error.inc
47
48 --source include/stop_slave_io.inc
49 --source include/stop_slave_sql.inc
50 --let $rpl_channel_name= 'ch1'
51 --source include/start_slave_io.inc
52 --source include/start_slave_sql.inc
53 --source include/stop_slave_io.inc
54 --source include/stop_slave_sql.inc
55 --let $rpl_channel_name= ''
56 --source include/start_slave_io.inc
57 --source include/start_slave_sql.inc
58
59 --echo #
60 --echo # Sync slave
61 --echo #
62
63 --source include/rpl_connection_master.inc
64 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE=InnoDB;
65 --let $rpl_channel_name= ''
66 --source include/sync_slave_io_with_master.inc
67 --source include/sync_slave_sql_with_io.inc
68
69 --source include/rpl_connection_master.inc
70 INSERT INTO t1 VALUES (1);
71 --source include/sync_slave_sql_with_master.inc
72 --source include/stop_slave_io.inc
73
74 --let $rpl_channel_name= 'ch1'
75 --source include/start_slave.inc
76 --source include/rpl_connection_master.inc
77 INSERT INTO t1 VALUES (2);
78 --source include/sync_slave_io_with_master.inc
79 --source include/sync_slave_sql_with_io.inc
80
81 --source include/rpl_connection_master.inc
82 INSERT INTO t1 VALUES (3);
83 --source include/sync_slave_sql_with_master.inc
84 --source include/stop_slave.inc
85
86 --let $rpl_channel_name= ''
87 --source include/start_slave.inc
88
89 --echo #
90 --echo # Show relaylog events
91 --echo #
92
93 --let $rpl_channel_name= ''
94 --source include/show_relaylog_events.inc
95 --let $rpl_channel_name= 'ch1'
96 --let $binlog_limit= 3
97 --source include/show_relaylog_events.inc
98
99 --echo #
100 --echo # Wait for error and skip
101 --echo #
102
103 --let $rpl_channel_name= ''
104 INSERT INTO t1 VALUES (4);
105 --source include/rpl_connection_master.inc
106 INSERT INTO t1 VALUES (4);
107 --source include/rpl_connection_slave.inc
108 --let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
109 --source include/wait_for_slave_sql_error.inc
110
111 --let $rpl_channel_name= 'ch1'
112 --source include/start_slave_io.inc
113 --let $rpl_channel_name= ''
114 # The default channel will be disconnected from master by ch1
115 --let $slave_io_errno= convert_error(ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG)
116 --source include/wait_for_slave_io_error.inc
117 START SLAVE SQL_THREAD FOR CHANNEL 'ch1';
118 --let $rpl_channel_name= 'ch1'
119 --let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
120 --source include/wait_for_slave_sql_error.inc
121
122 --let $rpl_channel_name= ''
123 --source include/start_slave_io.inc
124 --let $rpl_channel_name= 'ch1'
125 # The ch1 channel will be disconnected from master by the default
126 --let $slave_io_errno= convert_error(ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG)
127 --source include/wait_for_slave_io_error.inc
128 DELETE FROM t1 WHERE c1 = 4;
129 --let $rpl_channel_name= ''
130 --source include/start_slave_sql.inc
131
132 --let $rpl_channel_name= 'ch1'
133 --source include/rpl_skip_to_end_of_relay_log.inc
134 --source include/stop_slave.inc
135
136 --echo #
137 --echo # Cleanup
138 --echo #
139
140 --let $rpl_channel_name=
141 --let $binlog_limit=
142 RESET SLAVE ALL FOR CHANNEL 'ch1';
143
144 --source include/rpl_connection_master.inc
145 DROP TABLE t1;
146
147 --source include/rpl_end.inc