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

Yi Liu commented on HDFS-7926:
------------------------------

Thanks [~szetszwo] for the fix. Actually I agree that {{idempotent}} is good as 
you said. 
But the trouble issue is lease check/recovery for truncate, we just want to 
make sure the truncate retries get the same result. I have found one case that 
currently fix can't cover:
# Client invokes truncate, but it's on block boundary, so we will not add lease 
and there is no block recovery. And the result should be *true*.
# Meanwhile network issue for the client, and retry happens after few time. 
# Before retry happen or before it arrives NN, some other client invokes append 
on this file.
# Then NN receives the retry, so there is lease failure.
# Actually the truncate is successful, but client sees failure.


> NameNode implementation of ClientProtocol.truncate(..) is not idempotent
> ------------------------------------------------------------------------
>
>                 Key: HDFS-7926
>                 URL: https://issues.apache.org/jira/browse/HDFS-7926
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>             Fix For: 2.7.0
>
>         Attachments: h7926_20150313.patch, h7926_20150313b.patch
>
>
> If dfsclient drops the first response of a truncate RPC call, the retry by 
> retry cache will fail with "DFSClient ... is already the current lease 
> holder".  The truncate RPC is annotated as @Idempotent in ClientProtocol but 
> the NameNode implementation is not.



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

Reply via email to