-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-32947 Async conflicts with semi-sync in multi-source #5615
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
3
commits into
10.11
Choose a base branch
from
MDEV-32947
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,72 @@ | ||
| # Test replicating from an additional connection of semi-sync mode `$mode2` | ||
| # does not interfere with the active connection of mode `$mode1`. | ||
| # | ||
| # Pre-Conditions: | ||
| # * On connection `slave`. | ||
| # * CHANGE MASTER `master1` and `master2` set up to | ||
| # replicate from the connection with the same name. | ||
| # * None of the replication threads are running. | ||
| # * User variables `$mode1` and `$mode2` contain | ||
| # corresponding `@@rpl_semi_sync_slave_enabled` values. | ||
| # | ||
| # Post-Conditions: | ||
| # * On connection `slave`. | ||
| # * None of the replication threads are running. | ||
| # * @@default_master_connection = 'master1', | ||
| # @@rpl_semi_sync_slave_enabled = $mode2 | ||
|
|
||
| --let $status_var= Rpl_semi_sync_master_clients | ||
| --let $status_var_value= 1 | ||
|
|
||
|
|
||
| # Start `master1` | ||
| SET @@SESSION.default_master_connection= 'master1'; | ||
| --eval SET @@GLOBAL.rpl_semi_sync_slave_enabled= $mode1 | ||
| --source include/start_slave.inc | ||
|
|
||
| # Start `master2` | ||
| SET @@SESSION.default_master_connection= 'master2'; | ||
| --eval SET @@GLOBAL.rpl_semi_sync_slave_enabled= $mode2 | ||
| --source include/start_slave.inc | ||
|
|
||
|
|
||
| # Verify `master2` | ||
| --connection master2 | ||
| if ($mode2) | ||
| { | ||
| --source include/wait_for_status_var.inc | ||
| } | ||
| CREATE TABLE t2 (a INT); | ||
| DROP TABLE t2; | ||
| --save_master_pos | ||
| --connection slave | ||
| --sync_with_master 0, master2 | ||
|
|
||
| # Verify `master1` | ||
| --connection master1 | ||
| if ($mode1) | ||
| { | ||
| --source include/wait_for_status_var.inc | ||
| } | ||
| CREATE TABLE t1 (a INT); | ||
| --save_master_pos | ||
| --connection slave | ||
| --sync_with_master 0, master1 | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_slave_send_ack'; | ||
|
|
||
|
|
||
| # Stop `master2` | ||
| --source include/stop_slave.inc | ||
|
|
||
| # Verify `master1` | ||
| --connection master1 | ||
| DROP TABLE t1; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_master_clients'; | ||
| --save_master_pos | ||
| --connection slave | ||
| --sync_with_master 0, master1 | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_slave_send_ack'; | ||
|
|
||
| # Stop `master1` | ||
| SET @@SESSION.default_master_connection= 'master1'; | ||
| --source include/stop_slave.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Setup | ||
| connect master1, 127.0.0.1, root, , , $SERVER_MYPORT_1; | ||
| SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 0; | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 1; | ||
| SET @@SESSION.gtid_domain_id= 1; | ||
| RESET MASTER; | ||
| connect master2, 127.0.0.1, root, , , $SERVER_MYPORT_2; | ||
| SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 0; | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 1; | ||
| SET @@SESSION.gtid_domain_id= 2; | ||
| RESET MASTER; | ||
| connect slave, 127.0.0.1, root, , , $SERVER_MYPORT_3; | ||
| SET @@GLOBAL.gtid_slave_pos= ''; | ||
| CHANGE MASTER 'master1' TO | ||
| master_host='127.0.0.1', master_port=SERVER_MYPORT_1, | ||
| master_user='root', master_ssl_verify_server_cert=0; | ||
| CHANGE MASTER 'master2' TO | ||
| master_host='127.0.0.1', master_port=SERVER_MYPORT_2, | ||
| master_user='root', master_ssl_verify_server_cert=0; | ||
| # Test semi-sync replication during async replication | ||
| SET @@SESSION.default_master_connection= 'master1'; | ||
| SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; | ||
| include/start_slave.inc | ||
| SET @@SESSION.default_master_connection= 'master2'; | ||
| SET @@GLOBAL.rpl_semi_sync_slave_enabled= 1; | ||
| include/start_slave.inc | ||
| connection master2; | ||
| CREATE TABLE t2 (a INT); | ||
| DROP TABLE t2; | ||
| connection slave; | ||
| connection master1; | ||
| CREATE TABLE t1 (a INT); | ||
| connection slave; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_slave_send_ack'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_slave_send_ack 2 | ||
| include/stop_slave.inc | ||
| connection master1; | ||
| DROP TABLE t1; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_master_clients'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_clients 0 | ||
| connection slave; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_slave_send_ack'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_slave_send_ack 2 | ||
| SET @@SESSION.default_master_connection= 'master1'; | ||
| include/stop_slave.inc | ||
| # Test the other order | ||
| SET @@SESSION.default_master_connection= 'master1'; | ||
| SET @@GLOBAL.rpl_semi_sync_slave_enabled= 1; | ||
| include/start_slave.inc | ||
| SET @@SESSION.default_master_connection= 'master2'; | ||
| SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; | ||
| include/start_slave.inc | ||
| connection master2; | ||
| CREATE TABLE t2 (a INT); | ||
| DROP TABLE t2; | ||
| connection slave; | ||
| connection master1; | ||
| CREATE TABLE t1 (a INT); | ||
| connection slave; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_slave_send_ack'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_slave_send_ack 1 | ||
| include/stop_slave.inc | ||
| connection master1; | ||
| DROP TABLE t1; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_master_clients'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_clients 1 | ||
| connection slave; | ||
| SHOW STATUS LIKE 'Rpl_semi_sync_slave_send_ack'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_slave_send_ack 2 | ||
| SET @@SESSION.default_master_connection= 'master1'; | ||
| include/stop_slave.inc | ||
| # Cleanup | ||
| RESET SLAVE 'master1' ALL; | ||
| RESET SLAVE 'master2' ALL; | ||
| disconnect slave; | ||
| connection master1; | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 0; | ||
| SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 1; | ||
| disconnect master1; | ||
| connection master2; | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 0; | ||
| SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 1; | ||
| disconnect master2; |
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,65 @@ | ||
| # MDEV-32947 Async conflicts with semi-sync in multi-source | ||
| # | ||
| # With a async master and a semi-sync master, | ||
| # test replication does not mix async and semi-sync regardless of order | ||
|
|
||
| --source include/have_binlog_format_mixed.inc # format-agnostic | ||
| --let $orig_wait_no_slave= `SELECT @@GLOBAL.rpl_semi_sync_master_wait_no_slave` | ||
|
|
||
| --echo # Setup | ||
| # Enable semi-sync on both masters; | ||
| # the slave will disable semi-sync on one of its connections. | ||
|
|
||
| --connect (master1, 127.0.0.1, root, , , $SERVER_MYPORT_1) | ||
| SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 0; | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 1; | ||
| SET @@SESSION.gtid_domain_id= 1; | ||
| RESET MASTER; | ||
|
|
||
| --connect (master2, 127.0.0.1, root, , , $SERVER_MYPORT_2) | ||
| SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 0; | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 1; | ||
| SET @@SESSION.gtid_domain_id= 2; | ||
| RESET MASTER; | ||
|
|
||
| --connect (slave, 127.0.0.1, root, , , $SERVER_MYPORT_3) | ||
| --disable_warnings | ||
| SET @@GLOBAL.gtid_slave_pos= ''; | ||
| --enable_warnings | ||
|
|
||
| --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 | ||
| eval CHANGE MASTER 'master1' TO | ||
| master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, | ||
| master_user='root', master_ssl_verify_server_cert=0; | ||
| --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 | ||
| eval CHANGE MASTER 'master2' TO | ||
| master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, | ||
| master_user='root', master_ssl_verify_server_cert=0; | ||
|
|
||
|
|
||
| --echo # Test semi-sync replication during async replication | ||
| --let $mode1= 0 | ||
| --let $mode2= 1 | ||
| --source mix_semisync_async.inc | ||
|
|
||
| --echo # Test the other order | ||
| --let $mode1= 1 | ||
| --let $mode2= 0 | ||
| --source mix_semisync_async.inc | ||
|
|
||
|
|
||
| --echo # Cleanup | ||
|
|
||
| RESET SLAVE 'master1' ALL; | ||
| RESET SLAVE 'master2' ALL; | ||
| --disconnect slave | ||
|
|
||
| --connection master1 | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 0; | ||
| --eval SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= $orig_wait_no_slave | ||
| --disconnect master1 | ||
|
|
||
| --connection master2 | ||
| SET @@GLOBAL.rpl_semi_sync_master_enabled= 0; | ||
| --eval SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= $orig_wait_no_slave | ||
| --disconnect master2 |
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
Oops, something went wrong.
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.
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.
matches
Slave_running(show_slave_running()) 🤔¯\_(ツ)_/¯