[
https://issues.apache.org/jira/browse/HADOOP-13082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15270580#comment-15270580
]
Steve Loughran commented on HADOOP-13082:
-----------------------------------------
good catch —and very good for finding the root cause, as it means that if it is
the problem, then its only in the not-yet-shipped 2.8+ code.
I think the fallback logic is there for cross volume rename; if I have two
volumes mounted on the FS, /mnt/v1 and /mnt/v2, then a
{{rename("/mnt/v1/file.txt", "/mnt/v2/")} can only work with copy. Should we
support that? I'm not sure now, after all, the raw OS doesn't do this, does it?
At the very least, the fallback code must do that directory existence check, as
you suggested.
> RawLocalFileSystem does not fail when moving file to a non-existing directory
> -----------------------------------------------------------------------------
>
> Key: HADOOP-13082
> URL: https://issues.apache.org/jira/browse/HADOOP-13082
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Andras Bokor
> Assignee: Andras Bokor
>
> FileSystemContractBaseTest#testRenameFileMoveToNonExistentDirectory: creates
> a file then move it to a non-existing directory. It should fail but it will
> not (with RawLocalFileSystem) because in RawLocalFileSystem#rename(Path,
> Path) method we have a fallback behavior that accomplishes the rename by a
> full copy. The full copy will create the new directory and copy the file
> there.
> I see two possible solutions here:
> # Remove the fallback full copy behavior
> # Before full cp we should check whether the parent directory exists or not.
> If not return false an do not do the full copy.
> The fallback logic was added by
> [HADOOP-9805|https://issues.apache.org/jira/browse/HADOOP-9805].
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]