[
https://issues.apache.org/jira/browse/HDFS-6262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13981258#comment-13981258
]
Suresh Srinivas commented on HDFS-6262:
---------------------------------------
bq. But: every other filesystem considers renaming a file that doesn't exist
to be an error.
I agree. However, some of our methods have two ways to indicate failure -
return false or thrown an exception and there lies the problem.
Given that applications must handle exception being thrown from these methods,
changing the behavior for HDFS should be okay. But we do not how all the apps
use this API and I suspect we will break some applications. Especially case 2
you pointed in your comments. One thing I was thinking of was to possibly have
a hidden configuration to revert back to old behavior in HDFS. But that is
pretty ugly.
Again, I feel we should leave the method as is in HDFS. But I am okay if you
want to go ahead and make this change. We should perhaps document it and hope
that not too many applications break.
> HDFS doesn't raise FileNotFoundException if the source of a rename() is
> missing
> -------------------------------------------------------------------------------
>
> Key: HDFS-6262
> URL: https://issues.apache.org/jira/browse/HDFS-6262
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Affects Versions: 2.4.0
> Reporter: Steve Loughran
> Assignee: Akira AJISAKA
> Attachments: HDFS-6262.2.patch, HDFS-6262.patch
>
>
> HDFS's {{rename(src, dest)}} returns false if src does not exist -all the
> other filesystems raise {{FileNotFoundException}}
> This behaviour is defined in {{FSDirectory.unprotectedRenameTo()}} -the
> attempt is logged, but the operation then just returns false.
> I propose changing the behaviour of {{DistributedFileSystem}} to be the same
> as that of the others -and of {{FileContext}}, which does reject renames with
> nonexistent sources
--
This message was sent by Atlassian JIRA
(v6.2#6252)