这是indexloc提供的服务,不要输入任何密码
Skip to content

MDEV-36002: --master-retry-count=0 can still stop #4220

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
wants to merge 4 commits into
base: 10.11
Choose a base branch
from

Conversation

QWenQ
Copy link

@QWenQ QWenQ commented Jul 24, 2025

If master-retry-count equals 0, the slave io will try to reconnect to the master after sleeping master-connect-retry seconds. In this case, the instructions to update reconnection counter(err_count) won't be executed, thus avoiding the err_count overflow issuse.

  • The Jira issue number for this PR is: MDEV-36002

Description

the patch fix the bug that when --master-retry-count=0 the reconnection can still stop for an overflow issue.

Release Notes

No update, just as kb says "A value of 0 means the replica will not stop attempting to reconnect."

How can this PR be tested?

master_retry_count is set as 0 and master_connect_retry as 1 second. The master will be shutdown for 5 seconds, during this time the replica should attempt to reconnect to the master. After 5 seconds, the master will be restarted, and the reconnection from the replica should success, which means it's Slave_IO_Running should be Yes.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

If master-retry-count equals 0, the slave io will try to reconnect
to the master after sleeping master-connect-retry seconds.
In this case, the instructions to update reconnection counter(err_count)
won't be executed, thus avoiding the err_count overflow issuse.
@CLAassistant
Copy link

CLAassistant commented Jul 24, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@ParadoxV5 ParadoxV5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking this on!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrelkin gave an excellent idea on testing the overflow wraparound on the Zulip thread.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the default my.cnf file (in the rpl folder, IIRC) instead.
Then you’ll only need the master-retry-count line.

Actually, can you include a non-zero master-retry-count through a .combinations file instead?
In a .combinations file, sections specify different configs. Configs apply to all servers (both primary and replica), though the primary doesn’t care about this case.

In either case, test names should be descriptive, if available; i.e., rpl_master_retry_count.

Include a line break at the end of the last line (where GitHub labels ⛔); thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will do it and thx for your advice. This may take some time though, as i am still getting familiar with mariadb content.

@ParadoxV5 ParadoxV5 self-assigned this Jul 24, 2025
@ParadoxV5 ParadoxV5 added Replication Patches involved in replication External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. labels Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. Replication Patches involved in replication
Development

Successfully merging this pull request may close these issues.

3 participants