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/06/15 13:13:03 UTC

[GitHub] [ozone] ArafatKhan2198 opened a new pull request, #3520: HDDS-6863 Add Group-Id & Ratis-Roles Information for OM UI

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

   ## What changes were proposed in this pull request?
   
   Add Group-Id, Host-Address & Ratis-Ring information for OM UI.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-6863?filter=-1
   
   ## How was this patch tested?
   
   The changes are reflected to the OM-UI
   
   <img width="1724" alt="image" src="https://user-images.githubusercontent.com/98023601/173835355-59d04b9c-d1d4-4a8c-9452-75a3b02a14d7.png">
   
   


-- 
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] jojochuang commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      LOG.error("IO-Exception Occurred");

Review Comment:
   better to log the exception
   ```suggestion
         LOG.error("IO-Exception Occurred", e);
   ```



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      LOG.error("IO-Exception Occurred");
+      return "Null values found";

Review Comment:
   This is fine but won't be easy to understand. Imagine the web UI would display "OM Roles (HA)     Null values found".
   How about displaying the exception message instead?
   ```suggestion
         return "Exception: " + e.toString();
   ```



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
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:
   I have added a check for Ratis!! 
   thanks for the suggestion !!



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";

Review Comment:
   Sure will do 
   Thanks !!
   



-- 
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 #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   Thanks @ArafatKhan2198 for updating the patch.  The order of nodes is still "random", the rest looks good.


-- 
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] ArafatKhan2198 commented on pull request #3520: HDDS-6863 Add Group-Id & Ratis-Roles Information for OM UI

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

   @sadanand48 @jojochuang @adoroszlai can you please review this patch !!


-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";
+    }
+    for (ServiceInfo info : serviceList) {
+      if (info.getOmRoleInfo() != null) {
+        sb.append(
+            String.format(
+                "{ HostName: %s, Ratis Port: %s, Node-Id: %s, Role: %s } ",
+                info.getHostname(),
+                info.getPort(ServicePort.Type.RATIS),
+                info.getOmRoleInfo().getNodeId(),
+                info.getOmRoleInfo().getServerRole()
+            ));
+      }
+    }
+    return sb.toString();
+  }
+
+  @Override
+  public String getCurrentHost() {

Review Comment:
   Sure Ill remove it 
   Thanks !



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";
+    }
+    for (ServiceInfo info : serviceList) {
+      if (info.getOmRoleInfo() != null) {
+        sb.append(
+            String.format(
+                "{ HostName: %s, Ratis Port: %s, Node-Id: %s, Role: %s } ",
+                info.getHostname(),
+                info.getPort(ServicePort.Type.RATIS),
+                info.getOmRoleInfo().getNodeId(),
+                info.getOmRoleInfo().getServerRole()
+            ));
+      }
+    }
+    return sb.toString();
+  }
+
+  @Override
+  public String getCurrentHost() {

Review Comment:
   Sure I'll remove it 
   Thanks !



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
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:
   Changed, thanks for the suggestion !!



-- 
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] ArafatKhan2198 commented on pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   @adoroszlai the OM's are now printed in order


-- 
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 #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   Thanks @ArafatKhan2198 for the patch, @jojochuang, @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] sadanand48 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,36 @@
         require: {
             overview: "^overview"
         },
+        controller: function ($http) {
+            var ctrl = this;
+            $http.get("jmx?qry=Ratis:service=RaftServer,group=*,id=*")
+                .then(function (result) {
+                    ctrl.role = result.data.beans[0];
+                });
+
+            $http.get("jmx?qry=ratis:name=ratis.leader_election.*electionCount")
+                .then(function (result) {
+                    ctrl.electionCount = result.data.beans[0];
+                });
+
+            $http.get("jmx?qry=ratis:name=ratis.leader_election.*lastLeaderElectionElapsedTime")
+                .then(function (result) {
+                    ctrl.elapsedTime = result.data.beans[0];
+                    ctrl.elapsedTime.Value = convertMsToTime(ctrl.elapsedTime.Value);
+                });
+        }
     });
+        function convertMsToTime(ms) {
+          if(ms == -1){

Review Comment:
   Is this a valid case? ms==-1 or should we remove it?



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,12 @@
         require: {
             overview: "^overview"
         },
+        controller: function ($http) {
+            var ctrl = this;
+            $http.get("http://localhost:9874/jmx?qry=Ratis:service=RaftServer,group=*,id=*")

Review Comment:
   Removed it, thanks !!
   



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -789,4 +796,28 @@ public static String getOMAddressListPrintString(List<OMNodeDetails> omList) {
     printString.append("]");
     return printString.toString();
   }
+
+  public static String format(List<ServiceInfo> nodes, int port) {

Review Comment:
   Thanks, I have added the role-info to the ratis ring !!



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -267,6 +269,11 @@ public static boolean isReadOnly(
     case ListTenant:
     case TenantGetUserInfo:
     case TenantListUser:
+    case RangerBGSync:
+      // RangerBGSync is a read operation in the sense that it doesn't directly

Review Comment:
   I have removed it 
   thanks !!



-- 
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 #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

Posted by GitBox <gi...@apache.org>.
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


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

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -22,6 +22,22 @@ <h2>Status</h2>
         <td>Rpc port</td>
         <td>{{$ctrl.overview.jmx.RpcPort}}</td>
     </tr>
+    <tr ng-hide="!$ctrl.overview.jmx.RatisLeader">
+        <td>Leader-Id</td>

Review Comment:
   Sorry missed out on that 
   Thanks!



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      LOG.error("IO-Exception Occurred");

Review Comment:
   Will do, thanks for the suggestion !!



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      LOG.error("IO-Exception Occurred");
+      return "Null values found";

Review Comment:
   Will do, thanks for the suggestion !!



-- 
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] sadanand48 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,12 @@
         require: {
             overview: "^overview"
         },
+        controller: function ($http) {
+            var ctrl = this;
+            $http.get("http://localhost:9874/jmx?qry=Ratis:service=RaftServer,group=*,id=*")

Review Comment:
   Don't need localhost here



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";
+    }
+    for (ServiceInfo info : serviceList) {
+      if (info.getOmRoleInfo() != null) {
+        sb.append(
+            String.format(

Review Comment:
   Add the formatting part to a utility method maybe?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";

Review Comment:
   Please print a meaningful error LOG message here instead of returning an empty string



##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -22,6 +22,18 @@ <h2>Status</h2>
         <td>Rpc port</td>
         <td>{{$ctrl.overview.jmx.RpcPort}}</td>
     </tr>
+    <tr>
+        <td>OM Roles (HA)	</td>
+        <td>{{$ctrl.overview.jmx.OmRatisRoles}}</td>
+    </tr>
+    <tr>
+        <td>Current-Host</td>

Review Comment:
   Can  remove current host field



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";
+    }
+    for (ServiceInfo info : serviceList) {
+      if (info.getOmRoleInfo() != null) {
+        sb.append(
+            String.format(
+                "{ HostName: %s, Ratis Port: %s, Node-Id: %s, Role: %s } ",
+                info.getHostname(),
+                info.getPort(ServicePort.Type.RATIS),
+                info.getOmRoleInfo().getNodeId(),
+                info.getOmRoleInfo().getServerRole()
+            ));
+      }
+    }
+    return sb.toString();
+  }
+
+  @Override
+  public String getCurrentHost() {

Review Comment:
   I don’t think we need to add the hostname, Without knowing the hostname you wouldn’t be able to access UI itself.



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -22,6 +22,18 @@ <h2>Status</h2>
         <td>Rpc port</td>
         <td>{{$ctrl.overview.jmx.RpcPort}}</td>
     </tr>
+    <tr>
+        <td>OM Roles (HA)	</td>
+        <td>{{$ctrl.overview.jmx.OmRatisRoles}}</td>
+    </tr>
+    <tr>
+        <td>Current-Host</td>

Review Comment:
   I have removed it and replaced it with current role 
   Thanks !!



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,36 @@
         require: {
             overview: "^overview"
         },
+        controller: function ($http) {
+            var ctrl = this;
+            $http.get("jmx?qry=Ratis:service=RaftServer,group=*,id=*")
+                .then(function (result) {
+                    ctrl.role = result.data.beans[0];
+                });
+
+            $http.get("jmx?qry=ratis:name=ratis.leader_election.*electionCount")
+                .then(function (result) {
+                    ctrl.electionCount = result.data.beans[0];
+                });
+
+            $http.get("jmx?qry=ratis:name=ratis.leader_election.*lastLeaderElectionElapsedTime")
+                .then(function (result) {
+                    ctrl.elapsedTime = result.data.beans[0];
+                    ctrl.elapsedTime.Value = convertMsToTime(ctrl.elapsedTime.Value);
+                });
+        }
     });
+        function convertMsToTime(ms) {
+          if(ms == -1){

Review Comment:
   Yes I have addressed the issue!
   thanks !!



-- 
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] ArafatKhan2198 commented on pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   > ensure CI run in one's own fork succeeds, before opening a PR
   
   Thanks I was not aware of that !!
   I will do that next time :)


-- 
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 #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   @ArafatKhan2198 I think it is good practice to [ensure CI run in one's own fork succeeds, before opening a PR](https://lists.apache.org/thread/24szm50ybx7ww8zklfzls77p4h9q77yy).


-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    StringBuilder sb = new StringBuilder();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {
+      return "";
+    }
+    for (ServiceInfo info : serviceList) {
+      if (info.getOmRoleInfo() != null) {
+        sb.append(
+            String.format(

Review Comment:
   Good Idea I'll add the formatting method to `OmUtils.java` class !!



-- 
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] sadanand48 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -22,6 +22,22 @@ <h2>Status</h2>
         <td>Rpc port</td>
         <td>{{$ctrl.overview.jmx.RpcPort}}</td>
     </tr>
+    <tr ng-hide="!$ctrl.overview.jmx.RatisLeader">
+        <td>Leader-Id</td>

Review Comment:
   Leader Id field not required now



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

Review Comment:
   new line delete unrelated



-- 
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] jojochuang commented on pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   For future reference, it was be nice to show current term and how long has pasted since the last election. (Useful to know if there was any recent election and whether or not the OMs were unstable)


-- 
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 #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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

   Note: Although we used to recommend pushing a new commit to re-trigger the tests, Github now allows committers to re-run only the failed jobs. This also prevents the case where previously passed checks fail in a new run.


-- 
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] sadanand48 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {

Review Comment:
   Check this out https://github.com/apache/ozone/pull/3401/files 



-- 
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] sadanand48 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {

Review Comment:
   Using getServiceList() won't work because according to it's [logic](https://github.com/apache/ozone/blob/e6b6a842a19e5c64e62e03b039aa05fbe218ddbf/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java#L3023) , the node that calls this method is the leader and since in the web UI case every OM node will make this call, it will show every node as leader
   
   



-- 
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] sadanand48 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -789,4 +796,28 @@ public static String getOMAddressListPrintString(List<OMNodeDetails> omList) {
     printString.append("]");
     return printString.toString();
   }
+
+  public static String format(List<ServiceInfo> nodes, int port) {

Review Comment:
   Instead of multiple fields like Current Role, leaderID , we can rather add this info in this output itself, just add a logic like 
   
   ```
   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.getOmRoleInfo().getNodeId().equals(leaderId)?"LEADER":"FOLLOWER";
         if (info.getNodeType() == HddsProtos.NodeType.OM) {
           sb.append(
               String.format(
                   " { HostName: %s | Node-Id: %s | Ratis-Port : %d | Role : %d } ",
                   info.getHostname(),
                   info.getOmRoleInfo().getNodeId(),
                   port,
                   role
               ));
   ```



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -267,6 +269,11 @@ public static boolean isReadOnly(
     case ListTenant:
     case TenantGetUserInfo:
     case TenantListUser:
+    case RangerBGSync:
+      // RangerBGSync is a read operation in the sense that it doesn't directly

Review Comment:
   Unrelated change



##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,12 @@
         require: {
             overview: "^overview"
         },
+        controller: function ($http) {
+            var ctrl = this;
+            $http.get("jmx?qry=Ratis:service=RaftServer,group=*,id=*")
+                .then(function (result) {

Review Comment:
   can remove this part if the above approach works



-- 
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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2966,19 @@ public String getRpcPort() {
   }
 
   @Override
+
+  public String getOmRatisRoles() {
+    List<ServiceInfo> serviceList = null;
+    int port = omNodeDetails.getRatisPort();
+    try {
+      serviceList = getServiceList();
+    } catch (IOException e) {

Review Comment:
   Thanks for the help @sadanand48, I have made changes to the patch do 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] ArafatKhan2198 commented on a diff in pull request #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,12 @@
         require: {
             overview: "^overview"
         },
+        controller: function ($http) {
+            var ctrl = this;
+            $http.get("jmx?qry=Ratis:service=RaftServer,group=*,id=*")
+                .then(function (result) {

Review Comment:
   We will be needing it to display the group ID and the current role !!



-- 
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 #3520: HDDS-6863. Add Group-Id & Ratis-Roles Information for OM UI.

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


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