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

dhruba borthakur commented on HADOOP-5027:
------------------------------------------

>When I open a file for append the last block of the file is copied from the 
>main storage to a tmp directory to be tre

The block also gets a new generation stamp. 

> And the name-node should mark it as under-replicated triggering replication 
> process

Namenode does not trigger re-replication for blocks that belong to files that 
are being written (or appended to).

Let me try to explian this with an example. Suppose a file has one block 
blk_10_25. The generation stamp of this block is 25. Suppose this block is not 
full and is the only block in the file. Suppose a client wants to append a few 
bytes to this file. The client instructs the datanode to stamp this block with 
a generation stamp of 26. The block now becomes blk_10_26 and is moved from the 
real block directory to "blockBeingWritten" directory (see HADOOP-4663). The 
namenode metadat is also updated to record the block for this file to be 
blk_10_26. Block reports from this datanode will not have the block blk_10_25, 
but this is not a problem blk_25_10 is not a valid block anymore. These details 
are explained in th design doc for appends (HADOOP-1700).

> Block report processing should compare gneration stamp
> ------------------------------------------------------
>
>                 Key: HADOOP-5027
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5027
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>             Fix For: 0.19.1
>
>         Attachments: 5027_20090114.patch
>
>
> If a reported block has a different generation stamp then the one stored in 
> the NameNode, the reported block will be considered as invalid.  This is 
> incorrect since blocks with larger generation stamp are valid.

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