[ 
https://issues.apache.org/jira/browse/HDFS-16528?focusedWorklogId=761606&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-761606
 ]

ASF GitHub Bot logged work on HDFS-16528:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Apr/22 06:53
            Start Date: 25/Apr/22 06:53
    Worklog Time Spent: 10m 
      Work Description: virajjasani commented on code in PR #4186:
URL: https://github.com/apache/hadoop/pull/4186#discussion_r857307250


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -1856,15 +1875,16 @@ public DatanodeCommand[] 
handleHeartbeat(DatanodeRegistration nodeReg,
       nodeinfo.setBalancerBandwidth(0);
     }
 
-    if (slowPeerTracker != null) {
-      final Map<String, Double> slowPeersMap = slowPeers.getSlowPeers();
-      if (!slowPeersMap.isEmpty()) {
-        if (LOG.isDebugEnabled()) {
-          LOG.debug("DataNode " + nodeReg + " reported slow peers: " +
-              slowPeersMap);
-        }
-        for (String slowNodeId : slowPeersMap.keySet()) {
-          slowPeerTracker.addReport(slowNodeId, nodeReg.getIpcAddr(false));
+    synchronized (slowPeerTrackerLock) {

Review Comment:
   Will get back with adding new class `SlowPeerDisabledTracker` that extends 
`SlowPeerTracker` such that all extended methods in SlowPeerDisabledTracker are 
no-op, hence we never need to assign null to `slowPeerTracker` of 
DatanodeManager in the first place and hence never need to deal with NPEs. This 
will save us from using volatile or synchronization as well because both of 
them would add to the performance of heartbeat handling.
   
   Toggling b/ enabled and disabled mode of "slow peer tracking" would be much 
simplified this way. Let me get back with the changes tomorrow.
   
   Thanks @tomscut for the nice discussion!





Issue Time Tracking
-------------------

    Worklog Id:     (was: 761606)
    Time Spent: 3h 20m  (was: 3h 10m)

> Reconfigure slow peer enable for Namenode
> -----------------------------------------
>
>                 Key: HDFS-16528
>                 URL: https://issues.apache.org/jira/browse/HDFS-16528
>             Project: Hadoop HDFS
>          Issue Type: Task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> HDFS-16396 provides reconfig options for several configs associated with 
> slownodes in Datanode. Similarly, HDFS-16287 and HDFS-16327 have added some 
> slownodes related configs as the reconfig options in Namenode.
> The purpose of this Jira is to add DFS_DATANODE_PEER_STATS_ENABLED_KEY as 
> reconfigurable option for Namenode (similar to how HDFS-16396 has included it 
> for Datanode).



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to