You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/07/25 16:35:23 UTC

[GitHub] [ozone] symious opened a new pull request, #3401: HDDS-6728. Refactor getRatisRoles of SCM

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

   ## What changes were proposed in this pull request?
   
   The current logic to decide the LEADER of SCM is to check if the RaftPeer is local, https://github.com/apache/ozone/blob/master/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java#L268
   
   I assuem this is because the "scm roles" requests are forwarded to the LEADER SCM, so the invoker is always the leader, thus "isLocal" is used to decide which SCM is LEADER.
   
   But in SCM UI, the "SCM HA (roles)" information are retrived by invoking "getRatisRoles" by each SCM, not forwarded to the LEADER SCM, thus each SCM will consider itself as the LEADER in UI.
   
   This ticket is to fix this issue.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6728
   
   ## How was this patch tested?
   
   unit test.
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] symious commented on a diff in pull request #3401: HDDS-6728. SCM UI not showing correct HA roles

Posted by GitBox <gi...@apache.org>.
symious commented on code in PR #3401:
URL: https://github.com/apache/ozone/pull/3401#discussion_r929498221


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java:
##########
@@ -260,12 +259,8 @@ public List<String> getRatisRoles() throws IOException {
         LOG.error("SCM Ratis PeerInetAddress {} is unresolvable",
             peer.getAddress());
       }
-      boolean isLocal = false;
-      if (peerInetAddress != null) {
-        isLocal = NetUtils.isLocalAddress(peerInetAddress);
-      }
       ratisRoles.add((peer.getAddress() == null ? "" :
-              peer.getAddress().concat(isLocal ?
+          peer.getAddress().concat(peer == getLeader() ?

Review Comment:
   Updated, please have a check.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1125203740

   Thanks @symious for reporting the problem.  It looks like #3144 addresses the same issue with a bit simpler approach.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] symious commented on pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM

Posted by GitBox <gi...@apache.org>.
symious commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1125693871

   Sure, I'll mark this ticket as replicated.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a diff in pull request #3401: HDDS-6728. SCM UI not showing correct HA roles

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on code in PR #3401:
URL: https://github.com/apache/ozone/pull/3401#discussion_r929169643


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java:
##########
@@ -260,12 +259,8 @@ public List<String> getRatisRoles() throws IOException {
         LOG.error("SCM Ratis PeerInetAddress {} is unresolvable",
             peer.getAddress());
       }
-      boolean isLocal = false;
-      if (peerInetAddress != null) {
-        isLocal = NetUtils.isLocalAddress(peerInetAddress);
-      }
       ratisRoles.add((peer.getAddress() == null ? "" :
-              peer.getAddress().concat(isLocal ?
+          peer.getAddress().concat(peer == getLeader() ?

Review Comment:
   Also, I think we should use `equals()` instead of `==` for comparing peers.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3401: HDDS-6728. SCM UI not showing correct HA roles

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1195193494

   @sadanand48 would you like to take a look?


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3401: HDDS-6728. SCM UI not showing correct HA roles

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1195233180

   Thanks @symious for the fix, @sadanand48 for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] symious closed pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM

Posted by GitBox <gi...@apache.org>.
symious closed pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM
URL: https://github.com/apache/ozone/pull/3401


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1125693193

   > I think #3144 haven't fixed the root cause until @ChenSammi 's comment is fulfilled.
   
   Correct, that's why it's not merged yet. ;)


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a diff in pull request #3401: HDDS-6728. SCM UI not showing correct HA roles

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on code in PR #3401:
URL: https://github.com/apache/ozone/pull/3401#discussion_r929087620


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java:
##########
@@ -260,12 +259,8 @@ public List<String> getRatisRoles() throws IOException {
         LOG.error("SCM Ratis PeerInetAddress {} is unresolvable",
             peer.getAddress());
       }
-      boolean isLocal = false;
-      if (peerInetAddress != null) {
-        isLocal = NetUtils.isLocalAddress(peerInetAddress);
-      }
       ratisRoles.add((peer.getAddress() == null ? "" :
-              peer.getAddress().concat(isLocal ?
+          peer.getAddress().concat(peer == getLeader() ?

Review Comment:
   Can you please move the `getLeader()` call outside the loop?  I don't think it's necessary to get it for each peer.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] symious commented on pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM

Posted by GitBox <gi...@apache.org>.
symious commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1125629618

   @adoroszlai Thanks for the review.
   I think #3144 haven't fixed the root cause until @ChenSammi 's comment is fulfilled.
   
   Since with "isLocal" to check the leadership, Followers will still think they are the leader, only in UI we covered it by removing the 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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #3401: HDDS-6728. SCM UI not showing correct HA roles

Posted by GitBox <gi...@apache.org>.
adoroszlai merged PR #3401:
URL: https://github.com/apache/ozone/pull/3401


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] symious commented on pull request #3401: HDDS-6728. Refactor getRatisRoles of SCM

Posted by GitBox <gi...@apache.org>.
symious commented on PR #3401:
URL: https://github.com/apache/ozone/pull/3401#issuecomment-1123165969

   @adoroszlai @bharatviswa504 @ghuangups Could you help to review this PR?


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org