[ https://issues.apache.org/jira/browse/HDFS-4849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666791#comment-13666791 ]
Konstantin Shvachko commented on HDFS-4849: ------------------------------------------- # create() can be made idempotent because NN can recognize if the operation is a retry or a new call by checking Lease info. I was testing create() retries. Second call throws AlreadyBeingCreatedException even if the same client calls create. We can keep ABCE for different clients and just return success on the same client retry. # append() is essentially the same as create() as it goes through the same startFileInternal(). # delete() will require a slight change in semantics, because it returns true only if the existing file or directory was actually removed from the file system. Thus on retry the returned value depends on whether the previous attempt was actually executed on NN or not. I propose to relax the semantics of the delete return value: true would mean that operation succeeded, which is similar to mkdirs(). > Idempotent create, append and delete operations. > ------------------------------------------------ > > Key: HDFS-4849 > URL: https://issues.apache.org/jira/browse/HDFS-4849 > Project: Hadoop HDFS > Issue Type: Bug > Components: namenode > Affects Versions: 2.0.4-alpha > Reporter: Konstantin Shvachko > Assignee: Konstantin Shvachko > > create, append and delete operations can be made idempotent. This will reduce > chances for a job or other app failures when NN fails over. -- 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