Debian Codegraph @

mysql-test/suite/rpl/r/rpl_parallel_gco_wait_kill.result

raw
1 *** Test killing thread that is waiting to start transaction until previous transaction commits ***
2 include/master-slave.inc
3 [connection master]
4 connection server_2;
5 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
6 SET @old_parallel_mode= @@GLOBAL.slave_parallel_mode;
7 include/stop_slave.inc
8 SET sql_log_bin=0;
9 CALL mtr.add_suppression("Query execution was interrupted");
10 CALL mtr.add_suppression("Slave: Connection was killed");
11 CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
12 SET sql_log_bin=1;
13 SET GLOBAL slave_parallel_threads=10;
14 SET GLOBAL slave_parallel_mode= 'conservative';
15 CHANGE MASTER TO master_use_gtid=slave_pos;
16 include/start_slave.inc
17 connection server_1;
18 connect con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
19 connect con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
20 connect con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
21 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
22 CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
23 INSERT INTO t3 VALUES(100, 100);
24 connection server_2;
25 connection server_1;
26 SET sql_log_bin=0;
27 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
28 RETURNS INT DETERMINISTIC
29 BEGIN
30 RETURN x;
31 END
32 ||
33 SET sql_log_bin=1;
34 connection server_2;
35 SET sql_log_bin=0;
36 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
37 RETURNS INT DETERMINISTIC
38 BEGIN
39 IF d1 != '' THEN
40 SET debug_sync = d1;
41 END IF;
42 IF d2 != '' THEN
43 SET debug_sync = d2;
44 END IF;
45 RETURN x;
46 END
47 ||
48 SET sql_log_bin=1;
49 include/stop_slave.inc
50 SET GLOBAL slave_parallel_threads=0;
51 SET GLOBAL slave_parallel_threads=4;
52 include/start_slave.inc
53 connection server_1;
54 SET gtid_domain_id=2;
55 BEGIN;
56 INSERT INTO t3 VALUES (70, foo(70,
57 'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', ''));
58 INSERT INTO t3 VALUES (60, foo(60,
59 'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2',
60 'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont'));
61 COMMIT;
62 SET gtid_domain_id=0;
63 connection server_2;
64 SET debug_sync='now WAIT_FOR d2_query';
65 connection server_1;
66 SET gtid_domain_id=1;
67 BEGIN;
68 INSERT INTO t3 VALUES (61, foo(61,
69 'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting',
70 'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed'));
71 INSERT INTO t3 VALUES (62, foo(62,
72 'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2',
73 'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont'));
74 COMMIT;
75 SET gtid_domain_id=0;
76 connection server_2;
77 SET debug_sync='now WAIT_FOR d1_query';
78 connection server_1;
79 SET gtid_domain_id=0;
80 INSERT INTO t3 VALUES (63, foo(63,
81 'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2',
82 'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont'));
83 connection server_2;
84 SET debug_sync='now WAIT_FOR d0_query';
85 connection server_1;
86 SET gtid_domain_id=3;
87 BEGIN;
88 INSERT INTO t3 VALUES (68, foo(68,
89 'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', ''));
90 INSERT INTO t3 VALUES (69, foo(69,
91 'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2',
92 'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont'));
93 COMMIT;
94 SET gtid_domain_id=0;
95 connection server_2;
96 SET debug_sync='now WAIT_FOR d3_query';
97 SET debug_sync='now SIGNAL d2_cont2';
98 SET debug_sync='now WAIT_FOR d2_done';
99 SET debug_sync='now SIGNAL d1_cont2';
100 SET debug_sync='now WAIT_FOR d1_done';
101 SET debug_sync='now SIGNAL d0_cont2';
102 SET debug_sync='now WAIT_FOR d0_done';
103 SET debug_sync='now SIGNAL d3_cont2';
104 SET debug_sync='now WAIT_FOR d3_done';
105 connection con_temp3;
106 INSERT INTO t3 VALUES (64, foo(64,
107 'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', ''));
108 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2';
109 INSERT INTO t3 VALUES (65, foo(65, '', ''));
110 connection server_1;
111 SET debug_sync='now WAIT_FOR master_queued2';
112 connection con_temp4;
113 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
114 INSERT INTO t3 VALUES (66, foo(66, '', ''));
115 connection server_1;
116 SET debug_sync='now WAIT_FOR master_queued3';
117 connection con_temp5;
118 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4';
119 INSERT INTO t3 VALUES (67, foo(67, '', ''));
120 connection server_1;
121 SET debug_sync='now WAIT_FOR master_queued4';
122 SET debug_sync='now SIGNAL master_cont2';
123 connection con_temp3;
124 connection con_temp4;
125 connection con_temp5;
126 connection server_1;
127 SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
128 a b
129 60 60
130 61 61
131 62 62
132 63 63
133 64 64
134 65 65
135 66 66
136 67 67
137 68 68
138 69 69
139 70 70
140 100 100
141 SET debug_sync='RESET';
142 connection server_2;
143 SET debug_sync='now SIGNAL d0_cont';
144 SET debug_sync='now WAIT_FOR t1_waiting';
145 SET debug_sync='now SIGNAL d3_cont';
146 SET debug_sync='now WAIT_FOR t2_waiting';
147 SET debug_sync='now SIGNAL d1_cont';
148 SET debug_sync='now WAIT_FOR t3_waiting';
149 SET debug_sync='now SIGNAL d2_cont';
150 SET debug_sync='now WAIT_FOR t4_waiting';
151 KILL THD_ID;
152 SET debug_sync='now WAIT_FOR t3_killed';
153 SET debug_sync='now SIGNAL t1_cont';
154 include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
155 STOP SLAVE IO_THREAD;
156 SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a;
157 a b
158 60 60
159 61 61
160 62 62
161 63 63
162 64 64
163 68 68
164 69 69
165 70 70
166 100 100
167 SET debug_sync='RESET';
168 SET GLOBAL slave_parallel_threads=0;
169 SET GLOBAL slave_parallel_threads=10;
170 SET sql_log_bin=0;
171 DROP FUNCTION foo;
172 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
173 RETURNS INT DETERMINISTIC
174 BEGIN
175 RETURN x;
176 END
177 ||
178 SET sql_log_bin=1;
179 connection server_1;
180 UPDATE t3 SET b=b+1 WHERE a=60;
181 connection server_2;
182 include/start_slave.inc
183 SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
184 a b
185 60 61
186 61 61
187 62 62
188 63 63
189 64 64
190 65 65
191 66 66
192 67 67
193 68 68
194 69 69
195 70 70
196 100 100
197 SET sql_log_bin=0;
198 DROP FUNCTION foo;
199 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
200 RETURNS INT DETERMINISTIC
201 BEGIN
202 IF d1 != '' THEN
203 SET debug_sync = d1;
204 END IF;
205 IF d2 != '' THEN
206 SET debug_sync = d2;
207 END IF;
208 RETURN x;
209 END
210 ||
211 SET sql_log_bin=1;
212 connection server_2;
213 include/stop_slave.inc
214 SET GLOBAL slave_parallel_threads=0;
215 SET GLOBAL slave_parallel_threads=10;
216 include/start_slave.inc
217 *** 5. Test killing thread that is waiting for queue of max length to shorten ***
218 SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued;
219 SET GLOBAL slave_parallel_max_queued=9000;
220 connection server_1;
221 INSERT INTO t3 VALUES (80, foo(0,
222 'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', ''));
223 connection server_2;
224 SET debug_sync='now WAIT_FOR query_waiting';
225 SET @old_dbug= @@GLOBAL.debug_dbug;
226 SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max";
227 connection server_1;
228 SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
229 a b
230 80 0
231 81 10000
232 100 100
233 connection server_2;
234 SET debug_sync='now WAIT_FOR wait_queue_ready';
235 KILL THD_ID;
236 SET debug_sync='now WAIT_FOR wait_queue_killed';
237 SET debug_sync='now SIGNAL query_cont';
238 include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
239 STOP SLAVE IO_THREAD;
240 SET GLOBAL debug_dbug=@old_dbug;
241 SET GLOBAL slave_parallel_max_queued= @old_max_queued;
242 connection server_1;
243 INSERT INTO t3 VALUES (82,0);
244 connection server_2;
245 SET debug_sync='RESET';
246 include/start_slave.inc
247 SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
248 a b
249 80 0
250 81 10000
251 82 0
252 100 100
253 connection server_2;
254 include/stop_slave.inc
255 SET GLOBAL slave_parallel_mode=@old_parallel_mode;
256 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
257 include/start_slave.inc
258 SET DEBUG_SYNC= 'RESET';
259 connection server_1;
260 DROP function foo;
261 DROP TABLE t3;
262 SET DEBUG_SYNC= 'RESET';
263 include/rpl_end.inc