[
https://issues.apache.org/jira/browse/HDFS-7118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146784#comment-14146784
]
Chris Nauroth commented on HDFS-7118:
-------------------------------------
Hi, [~jayunit100]. In this case, it's an HDFS-specific issue. HDFS currently
calls {{java.io.File#renameTo}} in a few places, which doesn't propagate full
error details. We already implemented {{NativeIO#renameTo}} in hadoop-common a
while back to address similar issues. I don't anticipate any hadoop-common
changes as part of this. I think we'll just change HDFS code to call what
already exists in Common.
> Improve diagnostics on storage directory rename operations by using
> NativeIO#renameTo in Storage#rename.
> --------------------------------------------------------------------------------------------------------
>
> Key: HDFS-7118
> URL: https://issues.apache.org/jira/browse/HDFS-7118
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: journal-node, namenode
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
>
> If a file rename fails, {{NativeIO#renameTo}} includes more information about
> the root cause than a plain {{java.io.File#renameTo}}. The native code can
> throw an exception with a detailed error message and the {{errno}} on *nix or
> the value of {{GetLastError}} on Windows. This issue proposes to use
> {{NativeIO#renameTo}} inside or in place of {{Storage#rename}} to help
> improve diagnostics. The method falls back to {{java.io.File#renameTo}} if
> native code is not loaded, so this change would not introduce a compatibility
> problem for deployments running without native code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)