Debian Codegraph @

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

raw
1 #
2 # Whenever the mysql_binlog_send method (dump thread) reaches the
3 # end of file when reading events from the binlog, before checking
4 # if it should wait for more events, there was a test to check if
5 # the file being read was still active, i.e, it was the last known
6 # binlog. However, it was possible that something was written to
7 # the binary log and then a rotation would happen, after EOF was
8 # detected and before the check for active was performed. In this
9 # case, the end of the binary log would not be read by the dump
10 # thread, and this would cause the slave to lose updates.
11 #
12 # This test verifies that the problem has been fixed. It waits
13 # during this window while forcing a rotation in the binlog.
14 #
15 --source include/not_group_replication_plugin.inc
16 --source include/have_debug.inc
17 --source include/master-slave.inc
18
19 --connection master
20
21 SET @debug_saved= @@GLOBAL.DEBUG;
22
23 CREATE TABLE t (i INT);
24
25 # When reaching the EOF the dump thread will wait before deciding if
26 # it should move to a new binlong file.
27 SET GLOBAL DEBUG= "+d,wait_after_binlog_EOF";
28
29 INSERT INTO t VALUES (1);
30
31 --sleep 1
32
33 # A insert and a rotate happens before the decision
34 INSERT INTO t VALUES (2);
35 FLUSH LOGS;
36
37 SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished';
38
39 --source include/sync_slave_sql_with_master.inc
40
41 # All the rows should be sent to the slave.
42 --let $diff_tables=master:t,slave:t
43 --source include/diff_tables.inc
44
45 ##Clean up
46 --connection master
47
48 SET @@GLOBAL.DEBUG= @debug_saved;
49 SET DEBUG_SYNC= 'RESET';
50
51 DROP TABLE t;
52 --source include/rpl_end.inc