[ 
https://issues.apache.org/jira/browse/HADOOP-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545663
 ] 

dhruba borthakur commented on HADOOP-2275:
------------------------------------------

If you call chooseTarget first, then you would need to acquire the FSnamesystem 
lock twice.... first time to get the replication factor of the file and then 
the second time to insert the block into the INode. This will happen for the 
normal code flow path.

On the other hand, the current patch needs to acquire the fsnamesystem global 
lock twice only in the case of error. The normal code flow path remains 
unaffected.

> Erroneous detection of corrupted file when namenode fails to allocate any 
> datanodes for newly allocated block
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-2275
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2275
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.15.0
>            Reporter: dhruba borthakur
>            Assignee: dhruba borthakur
>         Attachments: badBlocks1.patch, badBlocks1.patch
>
>
> It can so happen that the namenode allocated a block for a file and then 
> fails to allocate any datanode for this block. The namenode delivers an 
> exception to the client. The client retries. But the block remains associated 
> with the file (until lease expiration). This causes all client retries to 
> fail.
> An fsck (before the lease expires) reports this block as a missing block.

-- 
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