[ 
https://issues.apache.org/jira/browse/HDFS-17026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727167#comment-17727167
 ] 

ASF GitHub Bot commented on HDFS-17026:
---------------------------------------

goiri commented on code in PR #5691:
URL: https://github.com/apache/hadoop/pull/5691#discussion_r1209486359


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java:
##########
@@ -482,17 +502,35 @@ private void 
updateHAStatusParameters(NamenodeStatusReport report) {
     }
   }
 
+  /**
+   * Evaluates whether the JMX report should be refreshed by
+   * calling the Namenode, based on the following conditions:
+   * 1. JMX Updates must be enabled.
+   * 2. The last attempt to update JMX occurred before the
+   *    configured interval (if any).
+   */
+  private boolean shouldUpdateJmx() {
+    return this.updateJmxIntervalMs >= 0

Review Comment:
   Might be cleaner to read as:
   ```
   if (this.updateJmxIntervalMs == 0)
     return false;
   }
   return Time.monotonicNow() - this.lastJmxUpdateAttempt > 
this.updateJmxIntervalMs
   ```



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java:
##########
@@ -482,17 +502,35 @@ private void 
updateHAStatusParameters(NamenodeStatusReport report) {
     }
   }
 
+  /**
+   * Evaluates whether the JMX report should be refreshed by
+   * calling the Namenode, based on the following conditions:
+   * 1. JMX Updates must be enabled.
+   * 2. The last attempt to update JMX occurred before the
+   *    configured interval (if any).
+   */
+  private boolean shouldUpdateJmx() {
+    return this.updateJmxIntervalMs >= 0

Review Comment:
   Or < 0.





> RBF: NamenodeHeartbeatService should update JMX report with configurable 
> frequency
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-17026
>                 URL: https://issues.apache.org/jira/browse/HDFS-17026
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: rbf
>            Reporter: Hector Sandoval Chaverri
>            Priority: Major
>              Labels: pull-request-available
>
> TheĀ NamenodeHeartbeatService currently calls each of the Namenode's JMX 
> endpoint every time it wakes up (default value is every 5 seconds).
> In a cluster with 40 routers, we have observed service degradation on some of 
> theĀ  Namenodes, since the JMX request obtains Datanode status and blocks 
> other RPC requests. However, JMX report data doesn't seem to be used for 
> critical paths on the routers.
> We should configure the NamenodeHeartbeatService so it updates the JMX 
> reports on a slower frequency than the Namenode states or to disable the 
> reports completely.
> The class calls out the JMX request being optional even though there is no 
> implementation to turn it off:
> {noformat}
> // Read the stats from JMX (optional)
> updateJMXParameters(webAddress, report);{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to