[
https://issues.apache.org/jira/browse/HADOOP-13402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15388532#comment-15388532
]
Chris Nauroth commented on HADOOP-13402:
----------------------------------------
For example, assuming pre-existing directory structure /d1/d2/f1, a call to
rename("/d1/d2/f1", "/d1") results in moving f1 to absolute path /d1/f1. In
S3A, this call fails because of this logic in {{S3AFileSystem#rename}}:
{code}
if (dstStatus.isDirectory() && !dstStatus.isEmptyDirectory()) {
return false;
}
{code}
That logic was introduced in HADOOP-10714. It sought to improve on the logic
from the original HADOOP-10400 contribution by more closely matching old
behavior of S3 and S3N. However, we still have this difference from the
semantics of HDFS (and others).
Note that this difference in behavior only occurs when the destination is a
non-empty pre-existing directory. It works fine if the destination specifies
the full path. Taking my example above, rename("/d1/d2/f1", "/d1") has the
problem, but rename("/d1/d2/f1", "/d1/f1") works fine. Applications can use
that as a workaround until we patch this.
> S3A should allow renaming to a pre-existing destination directory to move the
> source path under that directory, similar to HDFS.
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: HADOOP-13402
> URL: https://issues.apache.org/jira/browse/HADOOP-13402
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Reporter: Chris Nauroth
> Priority: Minor
>
> In HDFS, a rename to a destination path that is a pre-existing directory is
> interpreted as moving the source path relative to that pre-existing
> directory. In S3A, this operation currently fails (does nothing and returns
> {{false}}), unless that destination directory is empty. This issue proposes
> to change S3A to allow this behavior, so that it more closely matches the
> semantics of HDFS and other file systems.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]