Debian Codegraph @

mysql-test/suite/rpl/t/rpl_semi_sync_event.test

raw
1 source include/no_valgrind_without_big.inc;
2 source include/not_embedded.inc;
3 source include/have_innodb.inc;
4 source include/master-slave.inc;
5
6 let $engine_type= InnoDB;
7
8 # Suppress warnings that might be generated during the test
9 connection master;
10 call mtr.add_suppression("Timeout waiting for reply of binlog");
11 call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
12 call mtr.add_suppression("Read semi-sync reply");
13 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
14 call mtr.add_suppression("mysqld: Got an error reading communication packets");
15
16 connection slave;
17 call mtr.add_suppression("Semi-sync slave .* reply");
18 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");
19
20 connection master;
21 set global rpl_semi_sync_master_enabled = 1;
22
23 connection slave;
24 source include/stop_slave.inc;
25 set global rpl_semi_sync_slave_enabled = 1;
26
27 source include/start_slave.inc;
28
29 connection master;
30 SET GLOBAL event_scheduler = ON;
31
32 replace_result $engine_type ENGINE_TYPE;
33 eval CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=$engine_type;
34 INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
35 --disable_warnings
36 INSERT INTO t1 SELECT i+5, f FROM t1;
37 INSERT INTO t1 SELECT i+10, f FROM t1;
38 --enable_warnings
39 CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
40 DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
41 CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
42 DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
43
44 connection slave;
45 STOP SLAVE IO_THREAD;
46
47 connection master;
48 let $run = 20;
49 while ($run)
50 {
51 connect (m$run,localhost,root,,);
52 connection m$run;
53 send;
54 eval UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = $run;
55 connection master;
56 dec $run;
57 }
58
59 connection master;
60 SET GLOBAL event_scheduler = OFF;
61
62 let $run = 20;
63 while ($run)
64 {
65 connection m$run;
66 reap;
67 disconnect m$run;
68 dec $run;
69 }
70
71 #
72 # Clean up
73 #
74 connection slave;
75 source include/stop_slave.inc;
76 set global rpl_semi_sync_slave_enabled = 0;
77
78 connection master;
79 set global rpl_semi_sync_master_enabled = 0;
80
81 connection slave;
82 source include/start_slave.inc;
83
84 connection master;
85
86 DROP EVENT ev1;
87 DROP EVENT ev2;
88 DROP TABLE t1;
89 sync_slave_with_master;
90 --source include/rpl_end.inc