[
https://issues.apache.org/jira/browse/HADOOP-9061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ivan Mitic updated HADOOP-9061:
-------------------------------
Attachment: HADOOP-9061.branch-1-win.symlinks.patch
Attaching the patch. The patch does the following:
- If on Java6, do file copy instead of symlink. We've seen many problems with
symlinks on files on Java6 and it is simply impossible to make all of them
work. Recent examples include apps (like Oozie) built on top of MR that
directly access symlinks using the Java File object (not thru RLFS), in which
case things just don’t work.
- If on Java7, symlinks work as expected. There is no need to provide Native
API we exposed previously to properly extract the symlink size, so I removed
this code.
The only remaining scenario I can think of that can have problems is
distributed cache symlinks for archives. In this case, we have symbolic links
on folders, what is fine as long no one is trying to do File#renameTo on the
symlink. To fix this, we cannot change FileUtil#symlink to copy the folder
content, since the content could be populated afterwards (so symlink would
completely lose its purpose). We would instead have to scope down the folder
copy to disc cache scenario only. We can fix this via a separate Jira if it
turns out to be a problem.
> Java6+Windows does not work well with symlinks
> ----------------------------------------------
>
> Key: HADOOP-9061
> URL: https://issues.apache.org/jira/browse/HADOOP-9061
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 1-win
> Reporter: Ivan Mitic
> Assignee: Ivan Mitic
> Attachments: HADOOP-9061.branch-1-win.symlinks.patch
>
>
> We’ve seen multiple problems with file operations on symbolic links on Java6
> on Windows. Specifically:
> - File#length returns zero on symbolic links
> - File#renameTo renames the target, not the symlink
> Problematic scenarios are mainly related to symlinks created for dist cache.
> Java7 does not have above problems.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira