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

Vinayakumar B commented on HDFS-6955:
-------------------------------------

bq. 1. Reserved space is not released unless we call cleanupBlock(). Yes its 
good point to verify double release . I have updated the test case to assert 
this case. Please correct me if still you feel some other call is clearing 
space.
Thanks for pointing out that, {{bytesReserved}} is resetting to 0 in 
{{releaseAllBytesReserved}}, then double calls wont harm.

I think the following change need not required and this will not reset the 
value of bytesReserved in replicainfo. Instead, calling 
{{replicaInfo.releaseAllBytesReserved();}} will make sure everything reset. It 
would be better to unify this call everywhere.
{code}-      
+      FsVolumeImpl v = (FsVolumeImpl)replicaInfo.getVolume();
+      v.releaseReservedSpaceTmp(replicaInfo.getBytesReserved());
+ {code}

One more place {{replicaInfo.releaseAllBytesReserved();}} call required is the 
{{BlockReceiver}}'s constructor on exception. This will make sure reserved 
space is cleared even after some other exception during creation of block ( 
either rbw or tmp).

It would be better if more tests can be added to verify these corner cases.

> DN should reserve disk space for a full block when creating tmp files
> ---------------------------------------------------------------------
>
>                 Key: HDFS-6955
>                 URL: https://issues.apache.org/jira/browse/HDFS-6955
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 2.5.0
>            Reporter: Arpit Agarwal
>            Assignee: Kanaka Kumar Avvaru
>         Attachments: HDFS-6955-01.patch, HDFS-6955-02.patch, 
> HDFS-6955-03.patch, HDFS-6955-04.patch, HDFS-6955-05.patch
>
>
> HDFS-6898 is introducing disk space reservation for RBW files to avoid 
> running out of disk space midway through block creation.
> This Jira is to introduce similar reservation for tmp files.



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

Reply via email to