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

Yiqun Lin commented on HDFS-11169:
----------------------------------

Some failed tests are related. Will post a new patch later to fix these in case 
there are further comments from others.

> GetBlockLocations returns a block when offset > filesize and file only has 1 
> block
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-11169
>                 URL: https://issues.apache.org/jira/browse/HDFS-11169
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.7.1
>         Environment: HDP 2.5, Ambari 2.4
>            Reporter: David Tucker
>            Assignee: Yiqun Lin
>            Priority: Minor
>         Attachments: HDFS-11169.001.patch
>
>
> Start with a fresh deployment of HDFS.
> 1. Create a file.
> 2. AddBlock the file with an offest larger than the file size.
> 3. Call GetBlockLocations.
> Expectation: 0 blocks are returned because the only added block is incomplete.
> Observation: 1 block is returned.
> This only seems to occur when 1 block is in play (i.e. if you write a block 
> and call AddBlock again, GetBlockLocations seems to behave as expected).
> This seems to be related to HDFS-513.
> I suspect the following line needs revision: 
> https://github.com/apache/hadoop/blob/4484b48498b2ab2a40a404c487c7a4e875df10dc/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java#L1062
> I believe it should be >= instead of >:
>     if (nrBlocks >= 0 && curBlk == nrBlocks)   // offset >= end of file



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to