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 12:20:05 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

adoroszlai commented on code in PR #3520:
URL: https://github.com/apache/ozone/pull/3520#discussion_r928813990


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -789,4 +791,31 @@ public static String getOMAddressListPrintString(List<OMNodeDetails> omList) {
     printString.append("]");
     return printString.toString();
   }
+
+  public static String format(List<ServiceInfo> nodes, int port,
+                              String leaderId) {
+    StringBuilder sb = new StringBuilder();
+    int count = 0;
+    for (ServiceInfo info : nodes) {

Review Comment:
   `nodes` may be in any order.  It would be nice if we could ensure ordering is consistent across all OMs.
   <img width="1499" alt="Screenshot 2022-07-25 at 14 12 59" src="https://user-images.githubusercontent.com/6454655/180775101-4ea59eeb-ef87-48cc-a120-7dfb2b464021.png">
   <img width="1503" alt="Screenshot 2022-07-25 at 14 13 06" src="https://user-images.githubusercontent.com/6454655/180775108-2a37f707-fc91-453f-9053-ab8a9484b0a6.png">
   



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -789,4 +791,31 @@ public static String getOMAddressListPrintString(List<OMNodeDetails> omList) {
     printString.append("]");
     return printString.toString();
   }
+
+  public static String format(List<ServiceInfo> nodes, int port,
+                              String leaderId) {
+    StringBuilder sb = new StringBuilder();
+    int count = 0;
+    for (ServiceInfo info : nodes) {
+      // Printing only the OM's running
+      String role = info.getHostname().equals(leaderId) ? "LEADER" : "FOLLOWER";

Review Comment:
   Shouldn't we compare `info.getOmRoleInfo().getNodeId()` to `leaderId`?  If hostname and node ID are different, currently we get FOLLOWER for all 3 OMs.
   <img width="1643" alt="Screenshot 2022-07-25 at 14 09 40" src="https://user-images.githubusercontent.com/6454655/180774549-265d5c53-c0b7-48e3-8d61-16673b880aeb.png">
   



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java:
##########
@@ -29,6 +29,8 @@ public interface OMMXBean extends ServiceRuntimeInfo {
 
   String getRpcPort();
 
+  String getOmRatisRoles();

Review Comment:
   Nit: since `OMMXBean` is specific to OM, could be simplified to `getRatisRoles()` (which is consistent with `getRatisLogDirectory()` below).



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,20 @@ public String getRpcPort() {
   }
 
   @Override
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    RaftPeer leaderId;
+    try {
+      leaderId = omRatisServer.getLeader();

Review Comment:
   Should it handle the case when Ratis is not enabled in OM?



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