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

Brandon Li commented on HDFS-4883:
----------------------------------

Thanks for the patch!
A few comments:
1. in ClientNamenodeProtocolServerSideTranslatorPB.java, req.getFileId() should 
be "req.hasFileId() ? req.getFileId() : INodeId.GRANDFATHER_INODE_ID" for 
backward compatibility. 

2. in ClientNamenodeProtocol.proto, instead of:
  required uint64 fileId = 3;
  optional ExtendedBlockProto last = 4;

it should be:
  optional ExtendedBlockProto last = 3;
  optional uint64 fileId = 4;

3. checkLease() throws exception when src and fileId don't match. It seems a 
better approach if fileId presents, the namenode API should use fileId instead 
of src to serve the request. I am OK if you think this is beyond this JIRA and 
doesn't have to be fixed here.

4. It would be nice to add simple unit test to validate the change.

                
> complete() should verify fileId
> -------------------------------
>
>                 Key: HDFS-4883
>                 URL: https://issues.apache.org/jira/browse/HDFS-4883
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.1.0-beta
>            Reporter: Konstantin Shvachko
>            Assignee: Tao Luo
>         Attachments: HDFS-4883.patch
>
>
> It seems inconsistent that complete() avoids verifying real fileId, while 
> addBlock() does it meticulously.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to