| 1 |
# MDEV-14721 Big transaction events get lost on semisync master when |
| 2 |
# replicate_events_marked_for_skip=FILTER_ON_MASTER |
| 3 |
# |
| 4 |
# When events of a big transaction are binlogged offsetting over 2GB from |
| 5 |
# the beginning of the log the semisync master's dump thread |
| 6 |
# lost such events. |
| 7 |
# The test verifies the fixes' correctness simulating the 2GB offset. |
| 8 |
|
| 9 |
source include/not_embedded.inc; |
| 10 |
source include/have_innodb.inc; |
| 11 |
source include/have_debug.inc; |
| 12 |
source include/master-slave.inc; |
| 13 |
|
| 14 |
--connection master |
| 15 |
# Suppress warnings that might be generated during the test |
| 16 |
call mtr.add_suppression("Timeout waiting for reply of binlog"); |
| 17 |
|
| 18 |
--let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled` |
| 19 |
--let $sav_timeout_master=`SELECT @@GLOBAL.rpl_semi_sync_master_timeout` |
| 20 |
SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; |
| 21 |
SET @@GLOBAL.rpl_semi_sync_master_timeout=100; |
| 22 |
|
| 23 |
--connection slave |
| 24 |
--let $sav_skip_marked_slave=`SELECT @@GLOBAL.replicate_events_marked_for_skip` |
| 25 |
--let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled` |
| 26 |
source include/stop_slave.inc; |
| 27 |
SET @@GLOBAL.replicate_events_marked_for_skip=FILTER_ON_MASTER; |
| 28 |
SET @@GLOBAL.rpl_semi_sync_slave_enabled = 1; |
| 29 |
source include/start_slave.inc; |
| 30 |
|
| 31 |
--connection master |
| 32 |
CREATE TABLE t1 (a INT) ENGINE=innodb; |
| 33 |
|
| 34 |
# Make the following events as if they offset over 2GB from the beginning of binlog |
| 35 |
SET @saved_dbug = @@GLOBAL.debug_dbug; |
| 36 |
SET @@GLOBAL.debug_dbug="d,dbug_master_binlog_over_2GB"; |
| 37 |
SET @@SESSION.skip_replication=1; |
| 38 |
INSERT INTO t1 SET a=1; |
| 39 |
SET @@SESSION.skip_replication=0; |
| 40 |
INSERT INTO t1 SET a=0; |
| 41 |
SET @@GLOBAL.debug_dbug=""; |
| 42 |
|
| 43 |
# The current binlog is inconsistent so let's rotate it away |
| 44 |
# to clean up simulation results. |
| 45 |
FLUSH LOGS; |
| 46 |
|
| 47 |
--sync_slave_with_master |
| 48 |
|
| 49 |
# |
| 50 |
# Clean up |
| 51 |
# |
| 52 |
--connection master |
| 53 |
SET @@GLOBAL.debug_dbug = @saved_dbug; |
| 54 |
--eval SET @@GLOBAL.rpl_semi_sync_master_timeout = $sav_timeout_master |
| 55 |
--eval SET @@GLOBAL.rpl_semi_sync_master_enabled = $sav_enabled_master |
| 56 |
|
| 57 |
--connection master |
| 58 |
DROP TABLE t1; |
| 59 |
|
| 60 |
--sync_slave_with_master |
| 61 |
source include/stop_slave.inc; |
| 62 |
--eval SET @@GLOBAL.rpl_semi_sync_slave_enabled = $sav_enabled_slave |
| 63 |
--eval SET @@GLOBAL.replicate_events_marked_for_skip = $sav_skip_marked_slave |
| 64 |
|
| 65 |
source include/start_slave.inc; |
| 66 |
--source include/rpl_end.inc |