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

Konstantin Shvachko commented on HDFS-7886:
-------------------------------------------

Thanks for clarifying Yi, I see it now: even though {{triggerBlockReports()}} 
causes second block report it also waits until it actually happens.

Looking through other tests I think we should do the following:
# {{stopDataNode()}}
# On the NameNode mark the DN as dead, by calling 
{{DatanodeDescriptor.setLastUpdate(0)}} directly or using 
{{BlockManagerTestUtil.noticeDeadDatanode()}}
# {{startDataNode()}}
# Verify that DN reported via {{DatanodeDescriptor.getLastUpdate() > 0}}

This will ensure the DN actually restarted and reported the blocks, before the 
recovery is triggered. Also NN will know that DN is dead and will not schedule 
the recovery on it while it is down. Will that work?
Potentially we can incorporate those checks into 
{{MiniDFSCluster.restartDataNode()}}.

> TestFileTruncate#testTruncateWithDataNodesRestart runs timeout sometimes
> ------------------------------------------------------------------------
>
>                 Key: HDFS-7886
>                 URL: https://issues.apache.org/jira/browse/HDFS-7886
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.7.0
>            Reporter: Yi Liu
>            Assignee: Plamen Jeliazkov
>            Priority: Minor
>         Attachments: HDFS-7886.patch
>
>
> https://builds.apache.org/job/PreCommit-HDFS-Build/9730//testReport/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to