Debian Codegraph @

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

raw
1 include/master-slave.inc
2 [connection master]
3 connection master;
4 call mtr.add_suppression("Timeout waiting for reply of binlog");
5 call mtr.add_suppression("Read semi-sync reply");
6 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
7 call mtr.add_suppression("mysqld: Got an error reading communication packets");
8 connection slave;
9 set sql_log_bin=0;
10 call mtr.add_suppression("Semi-sync slave .* reply");
11 call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
12 set sql_log_bin=1;
13 connection master;
14 #
15 # Uninstall semi-sync plugins on master and slave
16 #
17 connection slave;
18 include/stop_slave.inc
19 include/reset_slave.inc
20 set global rpl_semi_sync_master_enabled= 0;
21 set global rpl_semi_sync_slave_enabled= 0;
22 connection master;
23 reset master;
24 set global rpl_semi_sync_master_enabled= 0;
25 set global rpl_semi_sync_slave_enabled= 0;
26 #
27 # Main test of semi-sync replication start here
28 #
29 connection master;
30 set global rpl_semi_sync_master_timeout= 2000;
31 [ default state of semi-sync on master should be OFF ]
32 show variables like 'rpl_semi_sync_master_enabled';
33 Variable_name Value
34 rpl_semi_sync_master_enabled OFF
35 [ enable semi-sync on master ]
36 set global rpl_semi_sync_master_enabled = 1;
37 show variables like 'rpl_semi_sync_master_enabled';
38 Variable_name Value
39 rpl_semi_sync_master_enabled ON
40 [ status of semi-sync on master should be ON even without any semi-sync slaves ]
41 show status like 'Rpl_semi_sync_master_clients';
42 Variable_name Value
43 Rpl_semi_sync_master_clients 0
44 show status like 'Rpl_semi_sync_master_status';
45 Variable_name Value
46 Rpl_semi_sync_master_status ON
47 show status like 'Rpl_semi_sync_master_yes_tx';
48 Variable_name Value
49 Rpl_semi_sync_master_yes_tx 0
50 #
51 # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
52 # BUG#45673 Semisynch reports correct operation even if no slave is connected
53 #
54 [ status of semi-sync on master should be OFF ]
55 show status like 'Rpl_semi_sync_master_clients';
56 Variable_name Value
57 Rpl_semi_sync_master_clients 0
58 show status like 'Rpl_semi_sync_master_status';
59 Variable_name Value
60 Rpl_semi_sync_master_status OFF
61 show status like 'Rpl_semi_sync_master_yes_tx';
62 Variable_name Value
63 Rpl_semi_sync_master_yes_tx 0
64 reset master;
65 connection slave;
66 [ default state of semi-sync on slave should be OFF ]
67 show variables like 'rpl_semi_sync_slave_enabled';
68 Variable_name Value
69 rpl_semi_sync_slave_enabled OFF
70 [ enable semi-sync on slave ]
71 set global rpl_semi_sync_slave_enabled = 1;
72 show variables like 'rpl_semi_sync_slave_enabled';
73 Variable_name Value
74 rpl_semi_sync_slave_enabled ON
75 include/start_slave.inc
76 connection master;
77 [ initial master state after the semi-sync slave connected ]
78 show status like 'Rpl_semi_sync_master_clients';
79 Variable_name Value
80 Rpl_semi_sync_master_clients 1
81 show status like 'Rpl_semi_sync_master_status';
82 Variable_name Value
83 Rpl_semi_sync_master_status ON
84 show status like 'Rpl_semi_sync_master_no_tx';
85 Variable_name Value
86 Rpl_semi_sync_master_no_tx 0
87 show status like 'Rpl_semi_sync_master_yes_tx';
88 Variable_name Value
89 Rpl_semi_sync_master_yes_tx 0
90 create table t1(a int) engine = ENGINE_TYPE;
91 [ master state after CREATE TABLE statement ]
92 show status like 'Rpl_semi_sync_master_status';
93 Variable_name Value
94 Rpl_semi_sync_master_status ON
95 show status like 'Rpl_semi_sync_master_no_tx';
96 Variable_name Value
97 Rpl_semi_sync_master_no_tx 0
98 show status like 'Rpl_semi_sync_master_yes_tx';
99 Variable_name Value
100 Rpl_semi_sync_master_yes_tx 1
101 select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0';
102 Should be 0
103 0
104 [ insert records to table ]
105 insert t1 values (10);
106 insert t1 values (9);
107 insert t1 values (8);
108 insert t1 values (7);
109 insert t1 values (6);
110 insert t1 values (5);
111 insert t1 values (4);
112 insert t1 values (3);
113 insert t1 values (2);
114 insert t1 values (1);
115 [ master status after inserts ]
116 show status like 'Rpl_semi_sync_master_status';
117 Variable_name Value
118 Rpl_semi_sync_master_status ON
119 show status like 'Rpl_semi_sync_master_no_tx';
120 Variable_name Value
121 Rpl_semi_sync_master_no_tx 0
122 show status like 'Rpl_semi_sync_master_yes_tx';
123 Variable_name Value
124 Rpl_semi_sync_master_yes_tx 11
125 connection slave;
126 [ slave status after replicated inserts ]
127 show status like 'Rpl_semi_sync_slave_status';
128 Variable_name Value
129 Rpl_semi_sync_slave_status ON
130 select count(distinct a) from t1;
131 count(distinct a)
132 10
133 select min(a) from t1;
134 min(a)
135 1
136 select max(a) from t1;
137 max(a)
138 10
139
140 # BUG#50157
141 # semi-sync replication crashes when replicating a transaction which
142 # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
143 connection master;
144 SET SESSION AUTOCOMMIT= 0;
145 CREATE TABLE t2(c1 INT) ENGINE=innodb;
146 connection slave;
147 connection master;
148 BEGIN;
149
150 # Even though it is in a transaction, this statement is binlogged into binlog
151 # file immediately.
152 CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
153
154 # These statements will not be binlogged until the transaction is committed
155 INSERT INTO t2 VALUES(11);
156 INSERT INTO t2 VALUES(22);
157 COMMIT;
158 DROP TABLE t2, t3;
159 SET SESSION AUTOCOMMIT= 1;
160 connection slave;
161 #
162 # Test semi-sync master will switch OFF after one transaction
163 # timeout waiting for slave reply.
164 #
165 connection master;
166 show status like "Rpl_semi_sync_master_status";
167 Variable_name Value
168 Rpl_semi_sync_master_status ON
169 connection slave;
170 include/stop_slave.inc
171 connection master;
172 include/kill_binlog_dump_threads.inc
173 set global rpl_semi_sync_master_timeout= 2000;
174 [ master status should be ON ]
175 show status like 'Rpl_semi_sync_master_no_tx';
176 Variable_name Value
177 Rpl_semi_sync_master_no_tx 0
178 show status like 'Rpl_semi_sync_master_yes_tx';
179 Variable_name Value
180 Rpl_semi_sync_master_yes_tx 14
181 [ semi-sync replication of these transactions will fail ]
182 insert into t1 values (500);
183 [ master status should be OFF ]
184 show status like 'Rpl_semi_sync_master_status';
185 Variable_name Value
186 Rpl_semi_sync_master_status OFF
187 show status like 'Rpl_semi_sync_master_no_tx';
188 Variable_name Value
189 Rpl_semi_sync_master_no_tx 1
190 show status like 'Rpl_semi_sync_master_yes_tx';
191 Variable_name Value
192 Rpl_semi_sync_master_yes_tx 14
193 delete from t1 where a=10;
194 delete from t1 where a=9;
195 delete from t1 where a=8;
196 delete from t1 where a=7;
197 delete from t1 where a=6;
198 delete from t1 where a=5;
199 delete from t1 where a=4;
200 delete from t1 where a=3;
201 delete from t1 where a=2;
202 delete from t1 where a=1;
203 insert into t1 values (100);
204 [ master status should be OFF ]
205 show status like 'Rpl_semi_sync_master_status';
206 Variable_name Value
207 Rpl_semi_sync_master_status OFF
208 show status like 'Rpl_semi_sync_master_no_tx';
209 Variable_name Value
210 Rpl_semi_sync_master_no_tx 12
211 show status like 'Rpl_semi_sync_master_yes_tx';
212 Variable_name Value
213 Rpl_semi_sync_master_yes_tx 14
214 #
215 # Test semi-sync status on master will be ON again when slave catches up
216 #
217 connection slave;
218 [ slave status should be OFF ]
219 show status like 'Rpl_semi_sync_slave_status';
220 Variable_name Value
221 Rpl_semi_sync_slave_status OFF
222 include/start_slave.inc
223 [ slave status should be ON ]
224 show status like 'Rpl_semi_sync_slave_status';
225 Variable_name Value
226 Rpl_semi_sync_slave_status ON
227 select count(distinct a) from t1;
228 count(distinct a)
229 2
230 select min(a) from t1;
231 min(a)
232 100
233 select max(a) from t1;
234 max(a)
235 500
236 connection master;
237 [ master status should be ON again after slave catches up ]
238 show status like 'Rpl_semi_sync_master_no_tx';
239 Variable_name Value
240 Rpl_semi_sync_master_no_tx 12
241 show status like 'Rpl_semi_sync_master_yes_tx';
242 Variable_name Value
243 Rpl_semi_sync_master_yes_tx 14
244 show status like 'Rpl_semi_sync_master_clients';
245 Variable_name Value
246 Rpl_semi_sync_master_clients 1
247 #
248 # Test disable/enable master semi-sync on the fly.
249 #
250 drop table t1;
251 connection slave;
252 include/stop_slave.inc
253 #
254 # Flush status
255 #
256 connection master;
257 [ Semi-sync master status variables before FLUSH STATUS ]
258 SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
259 Variable_name Value
260 Rpl_semi_sync_master_no_tx 12
261 SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
262 Variable_name Value
263 Rpl_semi_sync_master_yes_tx 15
264 FLUSH NO_WRITE_TO_BINLOG GLOBAL STATUS;
265 [ Semi-sync master status variables after FLUSH STATUS ]
266 SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
267 Variable_name Value
268 Rpl_semi_sync_master_no_tx 0
269 SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
270 Variable_name Value
271 Rpl_semi_sync_master_yes_tx 0
272 connection master;
273 show master logs;
274 Log_name master-bin.000001
275 File_size #
276 show variables like 'rpl_semi_sync_master_enabled';
277 Variable_name Value
278 rpl_semi_sync_master_enabled ON
279 [ disable semi-sync on the fly ]
280 set global rpl_semi_sync_master_enabled=0;
281 show variables like 'rpl_semi_sync_master_enabled';
282 Variable_name Value
283 rpl_semi_sync_master_enabled OFF
284 show status like 'Rpl_semi_sync_master_status';
285 Variable_name Value
286 Rpl_semi_sync_master_status OFF
287 [ enable semi-sync on the fly ]
288 set global rpl_semi_sync_master_enabled=1;
289 show variables like 'rpl_semi_sync_master_enabled';
290 Variable_name Value
291 rpl_semi_sync_master_enabled ON
292 show status like 'Rpl_semi_sync_master_status';
293 Variable_name Value
294 Rpl_semi_sync_master_status ON
295 #
296 # Test RESET MASTER/SLAVE
297 #
298 connection slave;
299 include/start_slave.inc
300 connection master;
301 create table t1 (a int) engine = ENGINE_TYPE;
302 drop table t1;
303 connection slave;
304 [ test reset master ]
305 connection master;
306 reset master;
307 show status like 'Rpl_semi_sync_master_status';
308 Variable_name Value
309 Rpl_semi_sync_master_status ON
310 show status like 'Rpl_semi_sync_master_no_tx';
311 Variable_name Value
312 Rpl_semi_sync_master_no_tx 0
313 show status like 'Rpl_semi_sync_master_yes_tx';
314 Variable_name Value
315 Rpl_semi_sync_master_yes_tx 0
316 connection slave;
317 include/stop_slave.inc
318 include/reset_slave.inc
319 include/kill_binlog_dump_threads.inc
320 connection slave;
321 include/start_slave.inc
322 connection master;
323 connection slave;
324 connection master;
325 create table t1 (a int) engine = ENGINE_TYPE;
326 insert into t1 values (1);
327 insert into t1 values (2), (3);
328 connection slave;
329 select * from t1;
330 a
331 1
332 2
333 3
334 connection master;
335 [ master semi-sync status should be ON ]
336 show status like 'Rpl_semi_sync_master_status';
337 Variable_name Value
338 Rpl_semi_sync_master_status ON
339 show status like 'Rpl_semi_sync_master_no_tx';
340 Variable_name Value
341 Rpl_semi_sync_master_no_tx 0
342 show status like 'Rpl_semi_sync_master_yes_tx';
343 Variable_name Value
344 Rpl_semi_sync_master_yes_tx 3
345 #
346 # Start semi-sync replication without SUPER privilege
347 #
348 connection slave;
349 include/stop_slave.inc
350 include/reset_slave.inc
351 connection master;
352 reset master;
353 include/kill_binlog_dump_threads.inc
354 set sql_log_bin=0;
355 grant replication slave on *.* to [email protected] identified by 'rpl_password';
356 flush privileges;
357 set sql_log_bin=1;
358 connection slave;
359 grant replication slave on *.* to [email protected] identified by 'rpl_password';
360 flush privileges;
361 change master to master_user='rpl',master_password='rpl_password';
362 include/start_slave.inc
363 show status like 'Rpl_semi_sync_slave_status';
364 Variable_name Value
365 Rpl_semi_sync_slave_status ON
366 connection master;
367 connection slave;
368 connection master;
369 [ master semi-sync should be ON ]
370 show status like 'Rpl_semi_sync_master_clients';
371 Variable_name Value
372 Rpl_semi_sync_master_clients 1
373 show status like 'Rpl_semi_sync_master_status';
374 Variable_name Value
375 Rpl_semi_sync_master_status ON
376 show status like 'Rpl_semi_sync_master_no_tx';
377 Variable_name Value
378 Rpl_semi_sync_master_no_tx 0
379 show status like 'Rpl_semi_sync_master_yes_tx';
380 Variable_name Value
381 Rpl_semi_sync_master_yes_tx 0
382 insert into t1 values (4);
383 insert into t1 values (5);
384 [ master semi-sync should be ON ]
385 show status like 'Rpl_semi_sync_master_clients';
386 Variable_name Value
387 Rpl_semi_sync_master_clients 1
388 show status like 'Rpl_semi_sync_master_status';
389 Variable_name Value
390 Rpl_semi_sync_master_status ON
391 show status like 'Rpl_semi_sync_master_no_tx';
392 Variable_name Value
393 Rpl_semi_sync_master_no_tx 0
394 show status like 'Rpl_semi_sync_master_yes_tx';
395 Variable_name Value
396 Rpl_semi_sync_master_yes_tx 2
397 #
398 # Test semi-sync slave connect to non-semi-sync master
399 #
400 connection slave;
401 include/stop_slave.inc
402 SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
403 Variable_name Value
404 Rpl_semi_sync_slave_status OFF
405 connection master;
406 include/kill_binlog_dump_threads.inc
407 [ Semi-sync status on master should be ON ]
408 show status like 'Rpl_semi_sync_master_status';
409 Variable_name Value
410 Rpl_semi_sync_master_status ON
411 set global rpl_semi_sync_master_enabled= 0;
412 connection slave;
413 SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
414 Variable_name Value
415 rpl_semi_sync_slave_enabled ON
416 include/start_slave.inc
417 connection master;
418 insert into t1 values (8);
419 [ master semi-sync clients should be 1, status should be OFF ]
420 show status like 'Rpl_semi_sync_master_clients';
421 Variable_name Value
422 Rpl_semi_sync_master_clients 1
423 show status like 'Rpl_semi_sync_master_status';
424 Variable_name Value
425 Rpl_semi_sync_master_status OFF
426 connection slave;
427 show status like 'Rpl_semi_sync_slave_status';
428 Variable_name Value
429 Rpl_semi_sync_slave_status ON
430 connection slave;
431 include/stop_slave.inc
432 connection master;
433 set global rpl_semi_sync_master_enabled= 0;
434 connection slave;
435 SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
436 Variable_name Value
437 rpl_semi_sync_slave_enabled ON
438 include/start_slave.inc
439 connection master;
440 insert into t1 values (10);
441 connection slave;
442 #
443 # Test non-semi-sync slave connect to semi-sync master
444 #
445 connection master;
446 set global rpl_semi_sync_master_timeout= 5000;
447 set global rpl_semi_sync_master_enabled= 1;
448 connection slave;
449 include/stop_slave.inc
450 SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
451 Variable_name Value
452 Rpl_semi_sync_slave_status OFF
453 [ uninstall semi-sync slave plugin ]
454 set global rpl_semi_sync_slave_enabled= 0;
455 [ reinstall semi-sync slave plugin and disable semi-sync ]
456 SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
457 Variable_name Value
458 rpl_semi_sync_slave_enabled OFF
459 SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
460 Variable_name Value
461 Rpl_semi_sync_slave_status OFF
462 include/start_slave.inc
463 SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
464 Variable_name Value
465 Rpl_semi_sync_slave_status OFF
466 #
467 # Clean up
468 #
469 connection slave;
470 include/stop_slave.inc
471 set global rpl_semi_sync_slave_enabled= 0;
472 connection master;
473 set global rpl_semi_sync_master_enabled= 0;
474 connection slave;
475 change master to master_user='root',master_password='';
476 include/start_slave.inc
477 connection master;
478 drop table t1;
479 connection slave;
480 connection master;
481 drop user [email protected];
482 flush privileges;
483 set global rpl_semi_sync_master_timeout= default;
484 include/rpl_end.inc