Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1-win, 2.1.0-beta, 1.3.0, 3.0.0-alpha1
-
None
-
Reviewed
Description
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:
c:
cd \
md Foo
md Bar
md Foo\X
md Bar\X
hadoop fs -mv file:///c:/Foo file:///c:/Bar
At the end of this, you would expect to find only Bar\X, but you instead find Bar\X\X.
Attachments
Attachments
Issue Links
- is duplicated by
-
HADOOP-9767 RawLocalFileSystem#rename does not correctly enforce replacement of empty destination directory on all platforms
- Resolved
- is part of
-
HADOOP-8645 Stabilize branch-1-win
- Resolved
- is related to
-
HADOOP-9805 Refactor RawLocalFileSystem#rename for improved testability.
- Resolved