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

Uma Maheswara Rao G commented on HDFS-5257:
-------------------------------------------

Patch looks good to me as well and the change is straightforward I think.

tiny nit:
>From the code change, I have small suggestion on test assertions. Can we add 
>one assertion after restart NN,  locations became 0?
or  remove existing DNs and start new ones with same NN and compare the 
locations which should be same as new node as we will reset the newly chosen 
blocks. So that the change will be clearly understandable from test case itself.
{code}
assertTrue("Block locations should be present",
+        lb1.getLocations().length > 0);
+    cluster.restartNameNode();
---------------------
{code}

+1 from me on addressing above comment.


> addBlock() retry should return LocatedBlock with locations else client will 
> get AIOBE
> -------------------------------------------------------------------------------------
>
>                 Key: HDFS-5257
>                 URL: https://issues.apache.org/jira/browse/HDFS-5257
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client, namenode
>    Affects Versions: 2.1.1-beta
>            Reporter: Vinay
>            Assignee: Vinay
>            Priority: Critical
>         Attachments: HDFS-5257.patch
>
>
> {{addBlock()}} call retry should return the LocatedBlock with locations if 
> the block was created in previous call and failover/restart of namenode 
> happened.
> otherwise client will get {{ArrayIndexOutOfBoundsException}} while creating 
> the block and write will fail.
> {noformat}java.lang.ArrayIndexOutOfBoundsException: 0
>       at 
> org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.createBlockOutputStream(DFSOutputStream.java:1118)
>       at 
> org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1078)
>       at 
> org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:511){noformat}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to