Skip to content
/ server Public

MDEV-15327 Reset Master_Server_Id to 0 on CHANGE MASTER#4666

Open
varundeepsaini wants to merge 1 commit intoMariaDB:mainfrom
varundeepsaini:MDEV-15327-master-server-id-fix
Open

MDEV-15327 Reset Master_Server_Id to 0 on CHANGE MASTER#4666
varundeepsaini wants to merge 1 commit intoMariaDB:mainfrom
varundeepsaini:MDEV-15327-master-server-id-fix

Conversation

@varundeepsaini
Copy link
Contributor

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

Description

Reset Master_Server_Id to 0 on CHANGE MASTER TO and RESET SLAVE. Previously the stale value from the previous master persisted in SHOW SLAVE STATUS until the slave reconnected.

Release Notes

CHANGE MASTER TO and RESET SLAVE now reset Master_Server_Id to 0, so SHOW SLAVE STATUS no longer reports a stale server ID from the previous master.

How can this PR be tested?

./mysql-test/mtr --suite=rpl rpl_change_master_server_id

Basing the PR against the correct MariaDB version

  • [] This is a new feature and the PR is based against the main branch.
  • This is a bug fix.

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.

@varundeepsaini varundeepsaini force-pushed the MDEV-15327-master-server-id-fix branch from 32a74f7 to 9c49da8 Compare February 18, 2026 18:29
@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 19, 2026
Copy link
Member

@gkodinov gkodinov 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 your contribution!
This is a preliminary review.

Please merge your changes into a single commit and have a commit message in it that follow CODING_STANDARDS.md.

I also have some cleanup suggestions below.

Master_Server_Id was not cleared after CHANGE MASTER or RESET SLAVE,
showing a stale value until the slave reconnected. Reset master_id
and prev_master_id to 0 in both code paths.
@varundeepsaini varundeepsaini force-pushed the MDEV-15327-master-server-id-fix branch from 9c49da8 to d88902b Compare February 19, 2026 12:13
Copy link
Member

@gkodinov gkodinov 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! Looks much better now. Please wait for the final review.

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.

Development

Successfully merging this pull request may close these issues.

2 participants

Comments