Refactor join handler#7853
Merged
cjen1-msft merged 14 commits intomicrosoft:mainfrom May 1, 2026
Merged
Conversation
Refactor to pull up the various early-exit checks Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the /node/join handler in the node RPC frontend to consolidate early-exit checks and ensure consistent “already joined” behavior (ie, once a join succeeds for a node identity, subsequent joins return the same result rather than failing due to ordering of validation checks).
Changes:
- Moves the “node already exists” check earlier so it short-circuits other validation (including the startup seqno gate).
- Simplifies the join flow into: validate target/service → return existing-node response if present → redirect if non-primary → validate startup seqno → add node with status based on service state.
- Replaces the
is_taking_part_in_acking()usage with a directNodeStatus::TRUSTEDcheck.
achamayou
reviewed
May 1, 2026
achamayou
reviewed
May 1, 2026
achamayou
reviewed
May 1, 2026
achamayou
reviewed
May 1, 2026
achamayou
approved these changes
May 1, 2026
Co-authored-by: Copilot <copilot@github.com>
achamayou
approved these changes
May 1, 2026
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.
Refactor to pull up the various early-exit checks.
The primary effect is that this ensures that we have a single edge in the join process.
Specifically if a node is requesting to join, if it ever is successful, it will always be successful (see the
check_node_exists).Previously we had the seqno check above that, which would mean if you hit different nodes in the network you'd possibly get different responses.
The other nice effect is that it makes the function a simple series of
do we early exitand thenjoin.