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


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java:
##########
@@ -447,8 +462,13 @@ private void updateJMXParameters(
       String address, NamenodeStatusReport report) {
     try {
       // TODO part of this should be moved to its own utility
-      getFsNamesystemMetrics(address, report);
-      getNamenodeInfoMetrics(address, report);
+      if (shouldUpdateJmx()) {
+        lastJmxUpdateAttempt = Time.monotonicNow();
+        getFsNamesystemMetrics(address);
+        getNamenodeInfoMetrics(address);
+      }
+      populateFsNamesystemMetrics(fsNamesystemMetrics, report);
+      populateNamenodeInfoMetrics(namenodeInfoMetrics, report);

Review Comment:
   Sorry I missed that. If the metrics are disabled, the 
[AvailableSpaceResolver](https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/order/AvailableSpaceResolver.java#L154)
 won't use "space available" to determine the Naemenode to write to, and will 
choose one randomly, which can lead to some Namenodes being over-used.
   For the Router dashboard, the disabled metrics will show up as  0.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


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

Reply via email to