You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2014/09/04 00:50:54 UTC

[jira] [Updated] (HADOOP-9507) LocalFileSystem rename() is broken in some cases when destination exists

     [ https://issues.apache.org/jira/browse/HADOOP-9507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Allen Wittenauer updated HADOOP-9507:
-------------------------------------
    Fix Version/s:     (was: 3.0.0)

> LocalFileSystem rename() is broken in some cases when destination exists
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-9507
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9507
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 3.0.0, 1-win, 2.1.0-beta, 1.3.0
>            Reporter: Mostafa Elhemali
>            Assignee: Chris Nauroth
>            Priority: Minor
>             Fix For: 1-win, 2.1.0-beta, 1.3.0
>
>         Attachments: HADOOP-9507-branch-1-win.1.patch, HADOOP-9507-branch-1-win.3.patch, HADOOP-9507-branch-1-win.4.patch, HADOOP-9507-branch-1-win.5.patch, HADOOP-9507-branch-1.1.patch, HADOOP-9507-branch-1.3.patch, HADOOP-9507-branch-1.4.patch, HADOOP-9507-branch-1.5.patch, HADOOP-9507-trunk.1.patch, HADOOP-9507-trunk.2.patch, HADOOP-9507-trunk.3.patch, HADOOP-9507-trunk.4.patch, HADOOP-9507-trunk.5.patch, HADOOP-9507.branch-1-win.patch
>
>
> The rename() method in RawLocalFileSystem uses FileUtil.copy() without realizing that FileUtil.copy() has a special behavior that if you're copying /foo to /bar and /bar exists and is a directory, it'll copy /foo inside /bar instead of overwriting it, which is not what rename() wants. So you end up with weird behaviors like in this repro:
> {code}
> c:
> cd \
> md Foo
> md Bar
> md Foo\X
> md Bar\X
> hadoop fs -mv file:///c:/Foo file:///c:/Bar
> {code}
> At the end of this, you would expect to find only Bar\X, but you instead find Bar\X\X.



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