avijayanhwx commented on a change in pull request #2094:
URL: https://github.com/apache/ozone/pull/2094#discussion_r603651548



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -225,7 +225,7 @@ public void stop() throws IOException {
   @Override
   public List<String> getRatisRoles() {
     return division.getGroup().getPeers().stream()
-        .map(peer -> peer.getAddress() == null ? "" : peer.getAddress())
+        .map(peer -> peer.getAddress() == null ? "" : 
peer.getAddress().concat(peer.getAdminAddress() == null ? ":FOLLOWER" : 
":LEADER"))

Review comment:
       I am not sure if we should rely on the getAdminAddress() call to be null 
to determine if this node is LEADER or FOLLOWER. Can we do something similar to 
OM? The SCM that is returning the answer will be leader (since read calls go 
only to Leader), and the other nodes will be followers. 

##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -225,7 +225,7 @@ public void stop() throws IOException {
   @Override
   public List<String> getRatisRoles() {
     return division.getGroup().getPeers().stream()
-        .map(peer -> peer.getAddress() == null ? "" : peer.getAddress())
+        .map(peer -> peer.getAddress() == null ? "" : 
peer.getAddress().concat(peer.getAdminAddress() == null ? ":FOLLOWER" : 
":LEADER"))

Review comment:
       Also, can we use 
org.apache.ratis.proto.RaftProtos.RaftPeerRole#LEADER/FOLLOWER instead of 
hardcoded strings?




-- 
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.

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