[
https://issues.apache.org/jira/browse/HDFS-7903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14353783#comment-14353783
]
Plamen Jeliazkov commented on HDFS-7903:
----------------------------------------
Hi Nicholas,
I ran your patch locally and saw that the block cannot be recovered.
What is happening is that the block performs recovery, but then is deleted from
the NameNode before the commitBlockSync comes in.
When commitBlockSync does arrive it fails to close the file because the block
no longer exists and so it throws an exception. This is why
checkBlockRecovery() times out.
Spoke with Konstantin offline, he says we should keep the old block around
rather than delete it the moment we delete the Snapshot. We can check if that
block is under recovery and if so, don't delete it.
> Cannot recover block after truncate and delete snapshot
> -------------------------------------------------------
>
> Key: HDFS-7903
> URL: https://issues.apache.org/jira/browse/HDFS-7903
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: datanode, namenode
> Reporter: Tsz Wo Nicholas Sze
> Assignee: Plamen Jeliazkov
> Fix For: 2.7.0
>
> Attachments: testMultipleTruncate.patch
>
>
> # Create a file.
> # Create a snapshot.
> # Truncate the file in the middle of a block.
> # Delete the snapshot.
> The block cannot be recovered.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)