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

Todd Lipcon commented on HDFS-3755:
-----------------------------------

Comparing this code to branch-1, it seems like the difference is actually 
client-side, not in the NameNode handling of create:

In branch-1's DFSClient, we specifically set up a retry policy for {{create()}} 
when it throws {{AlreadyBeingCreatedException}}. The policy is to retry once 
every LEASE_SOFTLIMIT_PERIOD up to 5 times (i.e 5 minutes). Assumedly this is 
so that, if a writer fails, another writer can call {{append()}} and take over 
from it, even if it first makes this call before the old writer's soft limit 
has expired. This behavior goes way back to HADOOP-1263 circa 2007. We removed 
this when we moved around a lot of the retry functionality in DFSClient into 
the IPC layer during development of HA.

I think the right thing to do here is:
a) commit this patch, since, as described above, it doesn't make sense to have 
to recover the lease when you're going to delete the file anyway for overwrite.
b) think about whether the above transparent-retry behavior for create() is 
actually what we want to expose to developers. I personally would rather the 
caller be responsible for retrying if it expects to be taking over a lease from 
a prior writer - otherwise a call which should be fast could retry up to 5 
minutes. Since I can imagine there might be disagreement on this point, I'd 
propose take it to a separate JIRA.
                
> Creating an already-open-for-write file with overwrite=true fails
> -----------------------------------------------------------------
>
>                 Key: HDFS-3755
>                 URL: https://issues.apache.org/jira/browse/HDFS-3755
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 2.0.0-alpha
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>         Attachments: hdfs-3755.txt
>
>
> If a file is already open for write by one client, and another client calls 
> {{fs.create()}} with {{overwrite=true}}, the file should be deleted and the 
> new file successfully created. Instead, it is currently throwing 
> AlreadyBeingCreatedException.
> This is a regression since branch-1.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to