MDEV-36841 Warn when SET slave_net_timeout drops below master_heartbeat_period#4845
Open
tonychen2001 wants to merge 1 commit intoMariaDB:12.3from
Open
MDEV-36841 Warn when SET slave_net_timeout drops below master_heartbeat_period#4845tonychen2001 wants to merge 1 commit intoMariaDB:12.3from
tonychen2001 wants to merge 1 commit intoMariaDB:12.3from
Conversation
gkodinov
requested changes
Mar 24, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
LGTM, but please fix the test failures.
| my_hash_element(&master_info_index->master_info_hash, i); | ||
| if ((uint32_t) mi->master_heartbeat_period > timeout * 1000ULL) | ||
| { | ||
| push_warning(thd, Sql_condition::WARN_LEVEL_WARN, |
Member
There was a problem hiding this comment.
I'd put a connection name in the message.
Contributor
Author
There was a problem hiding this comment.
Thank you for the feedback. I agree that the current warning message is not very user friendly so I wanted to gather some thoughts on the warning we want to push.
Option 1 (consolidate all replication connection names into 1 warning message):
Warnings:
Warning 1704 The heartbeat period for replication connection(s) '', 'connection1', 'connection2' exceeds the requested value of `slave_net_timeout' seconds. A sensible value for heartbeat periods should be less than the timeout.
Option 2 (separate warning for each connection):
Warnings:
Warning 1704 The heartbeat period for replication connection '' exceeds the requested value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
Warning 1704 The heartbeat period for replication connection 'connection2' exceeds the requested value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
I assume we can re-use the 1704 error code here.
Please let me know your thoughts.
…at_period When CHANGE MASTER sets master_heartbeat_period to a value greater than @@GLOBAL.slave_net_timeout, a ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX warning is emitted. However, the reverse scenario, lowering slave_net_timeout below an existing master_heartbeat_period, produced no warning. Add an on_update callback for slave_net_timeout that iterates all Master_info entries and warns if any resolved heartbeat period exceeds the new timeout value. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
5a12245 to
84ea4fc
Compare
gkodinov
approved these changes
Mar 25, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Please stand by for the final review.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
When CHANGE MASTER sets master_heartbeat_period to a value greater than
@@GLOBAL.slave_net_timeout, aER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAXwarning is emitted. However, the reverse scenario, lowering
slave_net_timeoutbelow an existingmaster_heartbeat_period, producedno warning.
Add an on_update callback for
slave_net_timeoutthat iterates allMaster_info entries and warns if any resolved heartbeat period exceeds
the new timeout value.
Release Notes
N/A
How can this PR be tested?
The MTRs
rpl.rpl_heartbeat_basicandrpl.rpl_heartbeathave been updated.Basing the PR against the correct MariaDB version
Copyright
All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.