Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-14721 Big transaction events get lost on semisync master when
replicate_events_marked_for_skip=FILTER_ON_MASTER [Note this is a cherry-pick from 10.2 branch.] 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 events were skipped by the Dump thread that found their skipping status erroneously. The current fixes make sure the skipping status is computed correctly. The test verifies them simulating the 2GB offset.
- Loading branch information
Showing
4 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| include/master-slave.inc | ||
| [connection master] | ||
| call mtr.add_suppression("Timeout waiting for reply of binlog"); | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; | ||
| SET @@GLOBAL.rpl_semi_sync_master_timeout=100; | ||
| include/stop_slave.inc | ||
| SET @@GLOBAL.replicate_events_marked_for_skip=FILTER_ON_MASTER; | ||
| SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1; | ||
| include/start_slave.inc | ||
| CREATE TABLE t1 (a INT) ENGINE=innodb; | ||
| 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=""; | ||
| SET @@GLOBAL. rpl_semi_sync_master_timeout = 10000; | ||
| SET @@GLOBAL. rpl_semi_sync_master_enabled = 0; | ||
| DROP TABLE t1; | ||
| include/stop_slave.inc | ||
| SET @@GLOBAL. rpl_semi_sync_slave_enabled = 0; | ||
| SET @@GLOBAL.replicate_events_marked_for_skip = REPLICATE; | ||
| include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # 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/have_semisync.inc; | ||
| 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 | ||
| source include/stop_slave.inc; | ||
| --let $sav_skip_marked_slave=`SELECT @@GLOBAL.replicate_events_marked_for_skip ` | ||
| SET @@GLOBAL.replicate_events_marked_for_skip=FILTER_ON_MASTER; | ||
| --let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled ` | ||
| 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 @@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; | ||
|
|
||
| --sync_slave_with_master | ||
|
|
||
| # | ||
| # Clean up | ||
| # | ||
| --connection master | ||
| SET @@GLOBAL.debug_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 | ||
|
|
||
| --let $rpl_only_running_threads= 1 | ||
| --source include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters