Repository navigation
MDEV-36841 Warn when SET slave_net_timeout drops below master_heartbeat_period - #4845
Merged
Merged
Conversation
gkodinov
requested changes
Mar 24, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
LGTM, but please fix the test failures.
tonychen2001
force-pushed
the
MDEV-36841
branch
from
March 24, 2026 18:24
5a12245 to
84ea4fc
Compare
gkodinov
approved these changes
Mar 25, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
LGTM. Please stand by for the final review.
bnestere
requested changes
Apr 21, 2026
bnestere
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution, @tonychen2001 !
I've left a couple notes.
tonychen2001
force-pushed
the
MDEV-36841
branch
3 times, most recently
from
June 12, 2026 00:36
8389993 to
1678744
Compare
bnestere
approved these changes
Oct 16, 2026
bnestere
left a comment
Contributor
There was a problem hiding this comment.
Thanks @tonychen2001 , this looks good.
Though please rebase to the main branch, rather than 12.3, as it adds a new warning.
Sorry for such a slow turn-around on the review :(
tonychen2001
force-pushed
the
MDEV-36841
branch
from
October 16, 2026 23:26
1678744 to
b354b77
Compare
Contributor
Author
|
Thank you @bnestere , I've updated the target to |
gkodinov
requested changes
Oct 20, 2026
Member
There was a problem hiding this comment.
There seems to be compilation failure (see below). Can you please attend to the buildbot failures?
/home/buildbot/aarch64-debian-11/build/sql/sys_vars.cc: In function ‘bool check_slave_net_timeout(sys_var*, THD*, set_var*)’:
/home/buildbot/aarch64-debian-11/build/sql/sys_vars.cc:6169:11: error: invalid cast from type ‘Master_info_file::Heartbeat_period_value’ to type ‘uint32_t’ {aka ‘unsigned int’}
6169 | (uint32_t) mi->master_heartbeat_period <= timeout * 1000ULL)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildbot/aarch64-debian-11/build/sql/sys_vars.cc:6178:28: error: invalid cast from type ‘Master_info_file::Heartbeat_period_value’ to type ‘uint32_t’ {aka ‘unsigned int’}
6178 | (double) (uint32_t) mi->master_heartbeat_period / 1000,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [sql/CMakeFiles/sql.dir/build.make:2166: sql/CMakeFiles/sql.dir/sys_vars.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:11692: sql/CMakeFiles/sql.dir/all] Error 2
make: *** [Makefile:182: all] Error 2
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_check callback for slave_net_timeout that iterates all Master_info entries and warns if any heartbeat period exceeds the requested timeout. Connections that are not configured are skipped. A DEFAULT heartbeat period is skipped unless --master-heartbeat-period was given at startup: without it the period follows slave_net_timeout/2 and can never exceed the timeout, but with it the period is a fixed value and is checked like an explicit one. The warning is reported with a new, generalized error ER_OPERATION_INVALIDATES_CONFIGURED_SLAVE, which names the affected replication connection and carries a parameterized description of the misconfiguration. Naming the connection matters for multi-source: when several connections exceed the new timeout, the user can see exactly which ones are problematic. One warning is emitted per affected connection. Add a multi_source test, run with --master-heartbeat-period=30, that configures two named connections with explicit heartbeat periods above the timeout and a third left at DEFAULT, and verifies a distinct warning is emitted for each. 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.
tonychen2001
force-pushed
the
MDEV-36841
branch
from
October 20, 2026 16:43
b354b77 to
a33f966
Compare
gkodinov
approved these changes
Oct 21, 2026
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.