rjgoyln commented on code in PR #11022:
URL: https://github.com/apache/ozone/pull/11022#discussion_r3785895797
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -1019,6 +1020,23 @@ public void transferLeadership(String newLeaderId)
SCMAction.TRANSFER_LEADERSHIP, auditMap));
}
+ /** Resolves the transfer target, which may be given as an SCM UUID or as a
configured SCM node id. */
+ private RaftPeerId resolveTargetPeerId(String newLeaderId, RaftGroup group) {
+ final RaftPeerId peerId = RaftPeerId.valueOf(newLeaderId);
+ if (group.getPeer(peerId) != null) {
+ return peerId;
+ }
+ // Raft peer ids are SCM UUIDs, so a node id only matches through its
configured Ratis address.
+ return scm.getSCMHANodeDetails().getAllNodeDetails().stream()
Review Comment:
Thanks for taking a look! I've replaced it with plain nested loops, and
pointing me at getPrimordialNode() was helpful.
--
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]