Fix to bug accepting join request incorrectly#640
Merged
greensky00 merged 2 commits intoeBay:masterfrom Jan 15, 2026
Merged
Conversation
Contributor
greensky00
commented
Jan 15, 2026
- We should compare endpoint as well to avoid the case that two different clusters coincidentally have same server IDs.
* We should compare endpoint as well to avoid the case that two different clusters coincidentally have same server IDs.
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the join request validation logic to prevent accepting join requests from different clusters that happen to have the same server IDs. The fix adds endpoint comparison in addition to server ID comparison.
Changes:
- Enhanced cluster membership validation by comparing both server IDs and endpoints
- Changed data structures from
std::set<int32>tostd::map<int32, std::string>to store server ID-endpoint pairs - Added clarifying comments about the purpose of endpoint comparison
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/handle_join_leave.cxx
Outdated
|
|
||
| // Build a set of server IDs from the request's cluster config | ||
| // Build a set of server IDs from the request's cluster config, | ||
| // excludeing the server itself. |
There was a problem hiding this comment.
Corrected spelling of 'excludeing' to 'excluding'.
Suggested change
| // excludeing the server itself. | |
| // excluding the server itself. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.