HDDS-11839. Accept SCM node id in ozone admin scm transfer - #11022
Open
rjgoyln wants to merge 3 commits into
Open
HDDS-11839. Accept SCM node id in ozone admin scm transfer#11022rjgoyln wants to merge 3 commits into
rjgoyln wants to merge 3 commits into
Conversation
`ozone admin scm transfer --new-leader-id` accepted only the SCM UUID, while the equivalent OM command accepts the node id from configuration. The asymmetry is not something an operator can predict from the two commands, and the node id is the identifier they already use throughout SCM HA configuration, so it is the one they reach for first.
sravani-revuri
left a comment
Contributor
There was a problem hiding this comment.
Thanks @rjgoyln for the patch. just a few minor comments below.
The nested stream in the node id lookup was hard to follow; plain loops match getPrimordialNode(), which this resolution already mirrors. The negative test only proved the command failed, not that it failed on the id it was given.
rjgoyln
marked this pull request as ready for review
August 14, 2026 17:29
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.
What changes were proposed in this pull request?
ozone admin scm transfer --new-leader-idcurrently accepts only an SCM UUID, whileozone admin om transferaccepts the node ID from configuration. This is inconsistent, and the node ID is the identifier operators already use in SCM HA configuration.SCM now accepts either the Raft peer ID or a configured node ID. When given a node ID, it resolves the corresponding peer through its Ratis address. An unrecognized ID is passed through unchanged, preserving the existing
Target ... not found in group [...]error.The resolution uses
SCMNodeDetails.getRatisHostPortStr()rather than comparing againstozone.scm.address.<service>.<node>. The latter contains only a host, while the Ratis peer address includes the port, so comparing them directly never matches. UsinggetRatisHostPortStr()also keeps the resolution consistent with the address used when a peer joins the Ratis group.Only SCMs already present in the leader's configuration can currently be resolved by node ID. An SCM added later through
ozone scm --bootstrapfalls back to the existing behavior until the leader restarts. Supporting dynamically added SCMs requires updatingSCMNodeDetailsfrom Ratis reconfiguration events, as discussed in the Jira.ozone admin om transferis unchanged because OM peer IDs are already node IDs.What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-11839
How was this patch tested?
TestTransferLeadershipShellnow covers both SCM identifier forms and verifies that an unrecognized ID is rejected without changing the leader.Locally on JDK 25, the test class passes 5/5 and checkstyle is clean for the touched modules. Spotbugs was not run because the pinned plugin does not support JDK 25; CI runs that check on JDK 8.
Generated-by: Claude Code (Opus 5)