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 missing to set the cluster node id when loading #1384

Merged
merged 2 commits into from
Apr 14, 2023
Merged

Fix missing to set the cluster node id when loading #1384

merged 2 commits into from
Apr 14, 2023

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Apr 13, 2023

we supported loading the cluster nodes from the local file, but we just ignored the cluster node id after parsing. So it can't match the cluster node since the local node id is empty, and it will fall back to check if the listening IP and port are matched.

For example, we create a cluster with a single node and listen on 0.0.0.0, then we would get the below output after restarting:

$ 127.0.0.1:6666> cluster nodes
3dQzcqeiTpSqPstxtD1utGuU52fPkGnoIHPO8KgL 127.0.0.1:6666@16666 master - 1681396166414 1681396166415 0 connected 0-16383

it missed a myself field because didn't use the node id from the local file, then it will fall back to IP/Port, but the listening IP 0.0.0.0 is unmatched with 127.0.0.1, this issue was submitted in #1381.

After this PR, we can get the correct result:

$ 127.0.0.1:6666> cluster nodes
3dQzcqeiTpSqPstxtD1utGuU52fPkGnoIHPO8KgL 127.0.0.1:6666@16666 myself,master - 1681396232426 1681396232427 0 connected 0-16383

torwig
torwig previously approved these changes Apr 13, 2023
Copy link
Contributor

@torwig torwig left a comment

Choose a reason for hiding this comment

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

LGTM

PragmaTwice
PragmaTwice previously approved these changes Apr 13, 2023
We supported loading the cluster nodes from the local file,
but ignore the cluster node id after parsing. So it can't match the
cluster node since the local node id is empty, then it will fallback
to check if the listen IP and port is matched.
@git-hulk git-hulk dismissed stale reviews from PragmaTwice and torwig via 1f71603 April 14, 2023 01:09
@git-hulk git-hulk requested a review from torwig April 14, 2023 01:09
@git-hulk
Copy link
Member Author

Thanks all, merging...

@git-hulk git-hulk merged commit aa57a13 into apache:unstable Apr 14, 2023
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 this pull request may close these issues.

3 participants