Skip to content

MDEV-36340: Reset Connects_Tried with Master_Retry_Count=X #3974

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
merged 1 commit into from
Apr 22, 2025

Conversation

ParadoxV5
Copy link
Contributor

@ParadoxV5 ParadoxV5 commented Apr 15, 2025

Description

CHANGE MASTER can set Master_Retry_Count to be lower than Connects_Tried, which’ll look strange to those unaware of that CHANGE.

Now, setting Master_Retry_Count also resets Connects_Tried to 0.

Release Notes

Amend MDEV-35304’s with:

  • STOP REPLICA does not reset Connects_Tried to 0, but RESET REPLICA does, and also does changing Master_Retry_Count with CHANGE MASTER.

How can this PR be tested?

This PR adds a test case to multi_source.connects_tried.

This PR also

  • swaps some other tests’ SELECTs so they’re all FROM status_before JOIN status_after USING(Connection_name); no function change
  • “simplifies” START/STOP SLAVE + wait_for_slave_to_start/stop.inc to start/stop_slave.inc

PR quality check

The bug is about a feature exclusive to the main branch. Or is this a new sub-feature?

  • 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.
  • 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.

@ParadoxV5 ParadoxV5 added MariaDB Corporation Replication Patches involved in replication labels Apr 15, 2025
WHERE status_reset.Connects_Tried <>
IF(LENGTH(Connection_name), status_restart.Connects_Tried, 0);
IF(Connection_name = '', 0, status_change.Connects_Tried);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This format to match #3897.
Conflict Resolution: this wins.

Copy link

@mariadb-SusilBehera mariadb-SusilBehera left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@bnestere bnestere left a comment

Choose a reason for hiding this comment

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

Hi @ParadoxV5 !

Thanks for a good patch and test - I just left one question.

mi->retry_count= lex_mi->retry_count;
mi->connects_tried= 0;
Copy link
Contributor

@bnestere bnestere Apr 15, 2025

Choose a reason for hiding this comment

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

Would it make sense to reset this for all CHANGE MASTER executions, rather than just when
MASTER_RETRY_COUNT is provided? That is, if we are changing the connection parameters (e.g. MASTER_HOST), it would make sense to me that we shouldn't report the old connects_tried for a new connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I say naw, because other parameters, including MASTER_HOST and co., don’t relate to Connects_Tried, and so have no reason to clear it when it’s intended to remain past STOP REPLICA.

Copy link
Contributor

@bnestere bnestere left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @ParadoxV5 !

@ParadoxV5 ParadoxV5 enabled auto-merge (rebase) April 15, 2025 16:26
@ParadoxV5
Copy link
Contributor Author

@bnestere says in JIRA that QA’s done. Now, (still) waiting for the main branch to switch to DST… 🫤

@ParadoxV5 ParadoxV5 self-assigned this Apr 22, 2025
auto-merge was automatically disabled April 22, 2025 06:17

Rebase failed

@ParadoxV5 ParadoxV5 enabled auto-merge (rebase) April 22, 2025 15:20
auto-merge was automatically disabled April 22, 2025 16:08

Rebase failed

@ParadoxV5
Copy link
Contributor Author

This branch cannot be rebased due to conflicts

manual update time

CHANGE MASTER can set `Master_Retry_Count` to be lower than
`Connects_Tried`, which’ll look strange to those unaware of that CHANGE.

Now, setting `Master_Retry_Count` also resets `Connects_Tried` to 0.

Reviewed-by: Susil Behera <susil.behera@mariadb.com>
Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
@ParadoxV5 ParadoxV5 enabled auto-merge (rebase) April 22, 2025 16:42
@ParadoxV5 ParadoxV5 merged commit f8bc40e into main Apr 22, 2025
12 of 13 checks passed
@ParadoxV5 ParadoxV5 deleted the mdev-36340 branch April 22, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MariaDB Corporation Replication Patches involved in replication
Development

Successfully merging this pull request may close these issues.

3 participants