[ 
https://issues.apache.org/jira/browse/HADOOP-5192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672374#action_12672374
 ] 

Hairong Kuang commented on HADOOP-5192:
---------------------------------------

> In order fix the locking, you could introduce 'unfinalizeBlockIfInvalid()' 
> that does the check and deletion under one lock.
I do not think this is necessary. When a block is in the unfinalized state 
under the tmp directory, no other thread can move the partial block to the 
finalized state. Adding the lock 'unfinalizeBlockIfInvalid() is just being 
super cautious. If we assume that there could be other threads working on the 
partial block concurrently, even with the lock, unfinalizeBlockIfInvalid is not 
safe at all because it may remove data that other threads are writing to.

> Block reciever should not remove a finalized block when block replication 
> fails
> -------------------------------------------------------------------------------
>
>                 Key: HADOOP-5192
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5192
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.3
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.18.4
>
>         Attachments: blockCleanup.patch, blockRemove.patch
>
>
> HADOOP-4702 makes block receivers to remove the received block in case of a 
> block replication failure. But the block should not be removed if the cause 
> of the failure is that the block to be received already exists. The key is 
> that a block receiver should allow to remove only partial blocks in case of 
> block replication failures. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to