Repository navigation
MDEV-36841 Warn when SET slave_net_timeout drops below master_heartbeat_period #4845
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
Merged
+139
−4
Merged
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --master-heartbeat-period=30 |
17 changes: 17 additions & 0 deletions
17
mysql-test/suite/multi_source/slave_net_timeout_heartbeat.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,17 @@ | ||
| connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3; | ||
| connection slave; | ||
| SET @restore_slave_net_timeout= @@global.slave_net_timeout; | ||
| SET @@global.slave_net_timeout= 60; | ||
| change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period=40; | ||
| change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period=50; | ||
| change master 'slave3' to master_port=MYPORT_1, master_host='localhost', master_user='root', master_ssl_verify_server_cert=0; | ||
| SET @@global.slave_net_timeout= 20; | ||
| SHOW WARNINGS; | ||
| Level Code Message | ||
| Warning 4276 This operation leaves replication connection 'slave1' with an invalid configuration: the heartbeat period (40.000 seconds) exceeds the requested slave_net_timeout (20 seconds); a sensible value for the period should be less than the timeout | ||
| Warning 4276 This operation leaves replication connection 'slave2' with an invalid configuration: the heartbeat period (50.000 seconds) exceeds the requested slave_net_timeout (20 seconds); a sensible value for the period should be less than the timeout | ||
| Warning 4276 This operation leaves replication connection 'slave3' with an invalid configuration: the heartbeat period (30.000 seconds) exceeds the requested slave_net_timeout (20 seconds); a sensible value for the period should be less than the timeout | ||
| SET @@global.slave_net_timeout= @restore_slave_net_timeout; | ||
| include/reset_master_slave.inc | ||
| disconnect slave; | ||
| connection default; |
48 changes: 48 additions & 0 deletions
48
mysql-test/suite/multi_source/slave_net_timeout_heartbeat.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,48 @@ | ||
| # | ||
| # MDEV-36841: Lowering @@global.slave_net_timeout below an explicitly | ||
| # configured master_heartbeat_period warns once per replication connection. | ||
| # | ||
| # With multi-source replication there can be more than one connection whose | ||
| # heartbeat period exceeds the new timeout, so the warning names each affected | ||
| # connection. This test configures two named connections, each with an | ||
| # explicit heartbeat period above the timeout we set next, and verifies that a | ||
| # separate warning is emitted for both. | ||
| # | ||
| # The server is started with --master-heartbeat-period=30, so a third | ||
| # connection left at the DEFAULT heartbeat period resolves to a fixed 30 | ||
| # seconds rather than slave_net_timeout/2, and must warn as well. | ||
| # | ||
| --source include/not_embedded.inc | ||
|
|
||
| --connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) | ||
|
|
||
| --connection slave | ||
| SET @restore_slave_net_timeout= @@global.slave_net_timeout; | ||
| SET @@global.slave_net_timeout= 60; | ||
|
|
||
| # Two sources, each with an explicit heartbeat period below the current | ||
| # timeout (60), so configuring them does not warn. | ||
| --replace_result $SERVER_MYPORT_1 MYPORT_1 | ||
| eval change master 'slave1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period=40; | ||
| --replace_result $SERVER_MYPORT_2 MYPORT_2 | ||
| eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period=50; | ||
| # DEFAULT heartbeat period, i.e. --master-heartbeat-period=30. The | ||
| # connection is never started; 'localhost' only avoids the host:port | ||
| # conflict with 'slave1'. | ||
| --replace_result $SERVER_MYPORT_1 MYPORT_1 | ||
| eval change master 'slave3' to master_port=$SERVER_MYPORT_1, master_host='localhost', master_user='root', master_ssl_verify_server_cert=0; | ||
|
|
||
| # Lowering the timeout below all three heartbeat periods must warn once per | ||
| # connection. Warnings are pushed in master_info hash order, which is not | ||
| # deterministic, so capture them with a sorted SHOW WARNINGS. | ||
| --disable_warnings | ||
| SET @@global.slave_net_timeout= 20; | ||
| --enable_warnings | ||
| --sorted_result | ||
| SHOW WARNINGS; | ||
|
|
||
| # Clean up | ||
| SET @@global.slave_net_timeout= @restore_slave_net_timeout; | ||
| --source include/reset_master_slave.inc | ||
| --disconnect slave | ||
| --connection default |
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
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
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.