Skip to content
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

[BUG] Slave can't re-sync with master again after changing password #513

Closed
ChrisZMF opened this issue Mar 6, 2022 · 2 comments · Fixed by #520
Closed

[BUG] Slave can't re-sync with master again after changing password #513

ChrisZMF opened this issue Mar 6, 2022 · 2 comments · Fixed by #520

Comments

@ChrisZMF
Copy link
Contributor

ChrisZMF commented Mar 6, 2022

Describe the bug
If the connection between master and slave is broken (reasons may be network error, restarting master... ) after changing the password of master, the slave can't resynchronize with master again automatically. The resynchronization will fail because slave can't auth master successfully though the masterauth of slave is set rightly. It can be resolved by restarting slave with new masterauth or execute slaveof no one to reset the master-slave relationship.
image

  • OS: all
  • Version: all

To Reproduce
Steps to reproduce the behavior:

  1. Sync server B(slave) with server A(master)
  2. Set or change requirepass of A and masterauth of B at the same time
  3. Restart master with new password, then slave can't resync with master.

Expected behavior
The B(slave) can re-sync with A(master) automatically.

Reason Analysis
When slave sync with master, a ReplicationThread object will be created and the password of master will be assigned to its member variable auth_. Although the value of masterauth is re-assigned, auth_ will still hold the old value because it can't be re-assigned dynamically.

@git-hulk
Copy link
Member

git-hulk commented Mar 6, 2022

cool, can you help to handle this issue? @ChrisZMF

@ChrisZMF
Copy link
Contributor Author

ChrisZMF commented Mar 6, 2022

OK, I will fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants