[
https://issues.apache.org/jira/browse/HDFS-7903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14355641#comment-14355641
]
Konstantin Shvachko commented on HDFS-7903:
-------------------------------------------
The fix looks good.
# One nit to replace the while-loop with the for-loop to avoid double i++ and
save a couple of lines of code.
# In the test we should not truncate to a random newLength. You need to be in
the middle of a block, so let's do precisely that.
# Can you also put a check that the recovered block was deleted after the
recovery.
> 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
> Attachments: HDFS-7903.1.patch, HDFS-7903.patch,
> 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)