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

Fix the bug that consul is always in the leaving state #663

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yangjunmyfm192085
Copy link

Fix: #662
The function handleNodeJoin is used to set member.Status = StatusAlive, and the function handleNodeJoinIntent is used to set member.statusLTime = joinMsg.LTime.
Unfortunately, the two are not in sync. If set member.statusLTime directly in handleNodeJoinIntent, will get wrong results. As a result, the member state we see has always been leaving
e.g.
We have 3 members A B and C in our cluster, Both B and C join the cluster through A.

  • We do leave and start operations on node B
  • When node A updates member.statusLTime of B to the latest value in the function handleNodeJoinIntent, member.Status may still be left.
  • When A sends its member status to C through pushPullMsg, C recognizes that the status of B is leave and marks member .statusLTime is the received value + 1 incorrectly.
  • C refreshes the status of member B as leaving, and marks member.statusLTime as member.statusLTime as the received value +1
  • The state of B in C continues to be leaving eventually

@hashicorp-cla
Copy link

hashicorp-cla commented Sep 21, 2022

CLA assistant check
All committers have signed the CLA.

@chymy
Copy link

chymy commented Sep 21, 2022

/lgtm

@chymy
Copy link

chymy commented Sep 21, 2022

/assign @rboyer

Copy link
Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/cc @rboyer

@kemko
Copy link

kemko commented Feb 8, 2024

@rboyer ?...

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