-
-
Notifications
You must be signed in to change notification settings - Fork 2k
MDEV-38636 @@sql_slave_skip_counter resets to 1 when skipping events by @@gtid_ignore_duplicates
#4593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ParadoxV5
wants to merge
1
commit into
10.11
Choose a base branch
from
MDEV-38636
base: 10.11
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MDEV-38636 @@sql_slave_skip_counter resets to 1 when skipping events by @@gtid_ignore_duplicates
#4593
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
mysql-test/suite/multi_source/gtid_ignore_duplicates_skip_counter.cnf
This file contains hidden or 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,4 @@ | ||
| !include my.cnf | ||
|
|
||
| [mysqld.2] | ||
| log-slave-updates |
46 changes: 46 additions & 0 deletions
46
mysql-test/suite/multi_source/gtid_ignore_duplicates_skip_counter.result
This file contains hidden or 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,46 @@ | ||
| include/rpl_init.inc [topology=1->2, 1->3] | ||
| # Set up | ||
| CREATE TABLE t (a INT); | ||
| include/save_master_pos.inc | ||
| include/save_master_gtid.inc | ||
| connection server_2; | ||
| START SLAVE; | ||
| include/sync_with_master_gtid.inc | ||
| connection server_3; | ||
| SET @save_gtid_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates; | ||
| SET @@GLOBAL.gtid_ignore_duplicates= ON; | ||
| START SLAVE IO_THREAD; | ||
| include/sync_io_with_master.inc | ||
| CHANGE MASTER 'bridge' TO | ||
| master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root'; | ||
| SET @@SESSION.default_master_connection= 'bridge'; | ||
| include/start_slave.inc | ||
| include/sync_with_master_gtid.inc | ||
| include/stop_slave.inc | ||
| SET @@SESSION.default_master_connection= ''; | ||
| RESET SLAVE 'bridge' ALL; | ||
| # Test | ||
| SET @@GLOBAL.sql_slave_skip_counter= 100; | ||
| START SLAVE SQL_THREAD; | ||
| include/wait_for_slave_param.inc [Relay_Master_Log_File] | ||
| include/wait_for_slave_param.inc [Exec_Master_Log_Pos] | ||
| SELECT @@sql_slave_skip_counter; | ||
| @@sql_slave_skip_counter | ||
| 100 | ||
| Skip_Counter = '100' | ||
| connection server_1; | ||
| DROP TABLE t; | ||
| include/save_master_gtid.inc | ||
| connection server_2; | ||
| include/sync_with_master_gtid.inc | ||
| connection server_3; | ||
| include/sync_with_master_gtid.inc | ||
| SHOW TABLES; | ||
| Tables_in_test | ||
| t | ||
| # Tear down | ||
| include/stop_slave.inc | ||
| SET @@GLOBAL.sql_slave_skip_counter= 0; | ||
| SET @@GLOBAL.gtid_ignore_duplicates= @save_gtid_ignore_duplicates; | ||
| SET STATEMENT sql_log_bin=0 FOR DROP TABLE t; | ||
| include/rpl_end.inc |
70 changes: 70 additions & 0 deletions
70
mysql-test/suite/multi_source/gtid_ignore_duplicates_skip_counter.test
This file contains hidden or 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,70 @@ | ||
| # Test combining `@@gtid_ignore_duplicates` and `@@sql_slave_skip_counter` | ||
| # | ||
| # Reference: MDEV-38636 `@@sql_slave_skip_counter` | ||
| # resets to 1 when skipping events by `@@gtid_ignore_duplicates` | ||
|
|
||
| --let $rpl_topology= 1->2, 1->3 | ||
| --let $rpl_skip_start_slave= 1 | ||
| --source include/rpl_init.inc | ||
|
|
||
|
|
||
| --echo # Set up | ||
|
|
||
| # Create some events to trigger `@@gtid_ignore_duplicates` with | ||
| CREATE TABLE t (a INT); | ||
| --source include/save_master_pos.inc | ||
| --source include/save_master_gtid.inc | ||
|
|
||
| --connection server_2 | ||
| START SLAVE; | ||
| --source include/sync_with_master_gtid.inc | ||
|
|
||
| --connection server_3 | ||
| SET @save_gtid_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates; | ||
| SET @@GLOBAL.gtid_ignore_duplicates= ON; | ||
|
|
||
| # Queue the test events without processing (which increments `@@gtid_slave_pos`) | ||
| START SLAVE IO_THREAD; | ||
| --source include/sync_io_with_master.inc | ||
|
|
||
| # Queue and process second copies of the events through another connection | ||
| --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 | ||
| eval CHANGE MASTER 'bridge' TO | ||
| master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root'; | ||
| SET @@SESSION.default_master_connection= 'bridge'; | ||
| --source include/start_slave.inc | ||
| --source include/sync_with_master_gtid.inc | ||
| --source include/stop_slave.inc | ||
| SET @@SESSION.default_master_connection= ''; | ||
| RESET SLAVE 'bridge' ALL; | ||
|
|
||
|
|
||
| --echo # Test | ||
|
|
||
| SET @@GLOBAL.sql_slave_skip_counter= 100; | ||
| START SLAVE SQL_THREAD; | ||
| --source include/sync_with_master.inc | ||
|
|
||
| SELECT @@sql_slave_skip_counter; | ||
| --let $status_items= Skip_Counter | ||
| --source include/show_slave_status.inc | ||
|
|
||
| --connection server_1 | ||
| DROP TABLE t; | ||
| --source include/save_master_gtid.inc | ||
| --connection server_2 | ||
| --source include/sync_with_master_gtid.inc | ||
| --connection server_3 | ||
| --source include/sync_with_master_gtid.inc | ||
| SHOW TABLES; # The counter should continue to skip the DROP TABLE. | ||
|
|
||
|
|
||
| --echo # Tear down | ||
|
|
||
| --source include/stop_slave.inc | ||
| SET @@GLOBAL.sql_slave_skip_counter= 0; | ||
| SET @@GLOBAL.gtid_ignore_duplicates= @save_gtid_ignore_duplicates; | ||
| SET STATEMENT sql_log_bin=0 FOR DROP TABLE t; | ||
|
|
||
| --let $rpl_only_running_threads= 1 | ||
| --source include/rpl_end.inc |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is after the block where this driver SQL thread
dismissesqueues events to its workers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to remove the
@@gtid_ignore_duplicatescode on the Parallel side as well now, but I don’t dare, and so leave it to MDEV-30458 Consolidate Serial Replica to Parallel Replica with 1 Worker Thread.