[ https://issues.apache.org/jira/browse/HDFS-17320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17802378#comment-17802378 ]
ASF GitHub Bot commented on HDFS-17320: --------------------------------------- KeeProMise commented on code in PR #6403: URL: https://github.com/apache/hadoop/pull/6403#discussion_r1441243319 ########## 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: Thanks for your review, seekToNewSource is a synchronous method, so the method is atomic; and the method turns out to just add the current node to the local deadnodes; so I think it will not affect the dead node detector. > seekToNewSource uses ignoredNodes to get a new node other than the current > node. > -------------------------------------------------------------------------------- > > Key: HDFS-17320 > URL: https://issues.apache.org/jira/browse/HDFS-17320 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Jian Zhang > Assignee: Jian Zhang > Priority: Minor > Labels: pull-request-available > Attachments: HDFS-17320.001.patch > > > Currently, when using the DFSInputStream#seekToNewSource() method to obtain a > new datanode, the current datanode will be marked as deadnode first, thus > preventing the new datanode from being equal to the current datanode. > If the current datanode is indeed a dead node, after obtaining the new > datanode, there is no need to mark the current datanode as a non-dead node; > but if the current node is not a dead node, after obtaining the new datanode, > the current node needs to be marked as Non-dead nodes (removed from the > deadnodes collection), the current implementation method has no problem with > its function, but it is very inelegant. > Currently, when selecting a new datanode > (DFSInputStream#getBestNodeDNAddrPair), you can filter out unnecessary > datanodes through the parameter ignoredNodes. Therefore, we only need to pass > the current datanode into ignoredNodes to elegantly implement the function of > the seekToNewSource method. -- 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