rjgoyln opened a new pull request, #11022:
URL: https://github.com/apache/ozone/pull/11022

   ## What changes were proposed in this pull request?
   
   `ozone admin scm transfer --new-leader-id` accepts only the SCM UUID, while 
`ozone admin om transfer` accepts the node id from configuration. Nothing about 
the two commands predicts that difference, and the node id is what operators 
already use throughout SCM HA configuration.
   
   SCM now tries the argument as a Raft peer id first and, failing that, 
resolves it against the configured node ids through their Ratis address. An id 
matching neither is passed through untouched, so the existing `Target ... not 
found in group [...]` error is unchanged.
   
   Resolution goes through `SCMNodeDetails.getRatisHostPortStr()` rather than 
reading `ozone.scm.address.<service>.<node>` directly. That config value 
carries no port, so comparing it against a `host:ratisPort` peer address never 
matches — the failure reported on the Jira in February 2025. A peer derives its 
own address with the same method when it joins the group, so both sides come 
from one source.
   
   Only SCMs present in the leader's configuration resolve by node id; one that 
joined through `ozone scm --bootstrap` after the leader started falls back to 
the previous behaviour until the leader restarts. Covering that case needs 
`SCMNodeDetails` driven by Ratis reconfiguration events, as discussed on the 
Jira. `ozone admin om transfer` is unchanged, since OM peer ids are already the 
node ids.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-11839
   
   ## How was this patch tested?
   
   `TestTransferLeadershipShell` is extended in place: the SCM transfer case is 
parametrized over both identifier forms, and a new case asserts an unrecognised 
id is rejected with the leader left in place. The node id case fails without 
this change.
   
   Locally on JDK 25 the class passes 5/5 and checkstyle is clean on the 
touched modules. Spotbugs was not run — the pinned plugin does not work under 
JDK 25, and CI pins that check to JDK 8.
   
   Generated-by: Claude Code (Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to