Skip to content

HDDS-11839. Accept SCM node id in ozone admin scm transfer - #11022

Open
rjgoyln wants to merge 3 commits into
apache:masterfrom
rjgoyln:HDDS-11839
Open

HDDS-11839. Accept SCM node id in ozone admin scm transfer#11022
rjgoyln wants to merge 3 commits into
apache:masterfrom
rjgoyln:HDDS-11839

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 14, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

ozone admin scm transfer --new-leader-id currently accepts only an SCM UUID, while ozone admin om transfer accepts 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 against ozone.scm.address.<service>.<node>. The latter contains only a host, while the Ratis peer address includes the port, so comparing them directly never matches. Using getRatisHostPortStr() 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 --bootstrap falls back to the existing behavior until the leader restarts. Supporting dynamically added SCMs requires updating SCMNodeDetails from Ratis reconfiguration events, as discussed in the Jira.

ozone admin om transfer is 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?

TestTransferLeadershipShell now 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)

`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.
Copilot AI lite review requested due to automatic review settings August 14, 2026 13:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sravani-revuri sravani-revuri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
rjgoyln marked this pull request as ready for review August 14, 2026 17:29
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