Debian Codegraph @

mysql-test/suite/rpl_nogtid/r/rpl_semi_sync_sender_observe_commit_only.result

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