KeeProMise commented on code in PR #6403:
URL: https://github.com/apache/hadoop/pull/6403#discussion_r1441264235
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java:
##########
@@ -1647,16 +1661,8 @@ public synchronized boolean seekToNewSource(long
targetPos)
if (currentNode == null) {
return seekToBlockSource(targetPos);
}
- boolean markedDead = dfsClient.isDeadNode(this, currentNode);
- addToLocalDeadNodes(currentNode);
Review Comment:
hi @hfutatzhanghb, In all places where getLocal DeadNodes is used, currently
only LocatedBlocksRefresher#refreshBlockLocations() is not synchronized.
However, this method ( refreshBlockLocations() )determines whether the local
deadnodes are empty. If not, the deadnodes will eventually be cleared.
Therefore, not adding the current node to local dead nodes will not affect
existing functions and is a safe operation. In addition, judging from the role
of the seekToNewSource method, this method is to obtain a new data node to
replace the current node. Therefore, the original method relies on local dead
nodes, but is highly coupled with the dead nodes detector. This is also the
reason why I proposed this PR.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]