summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
blob: 587e129018782caf16a336b298aae646a5d55cdd (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# MDEV-14721 Big transaction events get lost on semisync master when
# replicate_events_marked_for_skip=FILTER_ON_MASTER
#
# When events of a big transaction are binlogged offsetting over 2GB from
# the beginning of the log the semisync master's dump thread
# lost such events.
# The test verifies the fixes' correctness simulating the 2GB offset.

source include/not_embedded.inc;
source include/have_innodb.inc;
source include/have_debug.inc;
source include/master-slave.inc;

--connection master
# Suppress warnings that might be generated during the test
call mtr.add_suppression("Timeout waiting for reply of binlog");

--let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled`
--let $sav_timeout_master=`SELECT @@GLOBAL.rpl_semi_sync_master_timeout`
SET @@GLOBAL.rpl_semi_sync_master_enabled = 1;
SET @@GLOBAL.rpl_semi_sync_master_timeout=100;

--connection slave
--let $sav_skip_marked_slave=`SELECT @@GLOBAL.replicate_events_marked_for_skip`
--let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled`
source include/stop_slave.inc;
SET @@GLOBAL.replicate_events_marked_for_skip=FILTER_ON_MASTER;
SET @@GLOBAL.rpl_semi_sync_slave_enabled = 1;
source include/start_slave.inc;

--connection master
CREATE TABLE t1 (a INT) ENGINE=innodb;

# Make the following events as if they offset over 2GB from the beginning of binlog
SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="d,dbug_master_binlog_over_2GB";
SET @@SESSION.skip_replication=1;
INSERT INTO t1 SET a=1;
SET @@SESSION.skip_replication=0;
INSERT INTO t1 SET a=0;
SET @@GLOBAL.debug_dbug="";

# The current binlog is inconsistent so let's rotate it away
# to clean up simulation results.
FLUSH LOGS;

--sync_slave_with_master

#
# Clean up
#
--connection master
SET @@GLOBAL.debug_dbug = @saved_dbug;
--eval SET @@GLOBAL.rpl_semi_sync_master_timeout = $sav_timeout_master
--eval SET @@GLOBAL.rpl_semi_sync_master_enabled = $sav_enabled_master

--connection master
DROP TABLE t1;

--sync_slave_with_master
source include/stop_slave.inc;
--eval SET @@GLOBAL.rpl_semi_sync_slave_enabled = $sav_enabled_slave
--eval SET @@GLOBAL.replicate_events_marked_for_skip = $sav_skip_marked_slave

source include/start_slave.inc;
--source include/rpl_end.inc