File: rpl_lost_events_on_rotate.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (51 lines) | stat: -rw-r--r-- 1,490 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Whenever the mysql_binlog_send method (dump thread) reaches the
# end of file when reading events from the binlog, before checking
# if it should wait for more events, there was a test to check if
# the file being read was still active, i.e, it was the last known
# binlog. However, it was possible that something was written to
# the binary log and then a rotation would happen, after EOF was
# detected and before the check for active was performed. In this
# case, the end of the binary log would not be read by the dump
# thread, and this would cause the slave to lose updates.
#
# This test verifies that the problem has been fixed. It waits
# during this window while forcing a rotation in the binlog.
#
--source include/have_debug.inc
--source include/master-slave.inc

--connection master

SET @debug_saved= @@GLOBAL.DEBUG_DBUG;

CREATE TABLE t (i INT);

# When reaching the EOF the dump thread will wait before deciding if
# it should move to a new binlong file.
SET GLOBAL DEBUG_DBUG= "d,wait_after_binlog_EOF";

INSERT INTO t VALUES (1);

--sleep 1

# A insert and a rotate happens before the decision
INSERT INTO t VALUES (2);
FLUSH LOGS;

SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished';

--sync_slave_with_master

# All the rows should be sent to the slave.
--let $diff_tables=master:t,slave:t
--source include/diff_tables.inc

##Clean up
--connection master

SET @@GLOBAL.DEBUG_DBUG= @debug_saved;
SET DEBUG_SYNC= 'RESET';

DROP TABLE t;
--source include/rpl_end.inc