[ https://issues.apache.org/jira/browse/HDFS-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413346#comment-13413346
]
Aaron T. Myers commented on HDFS-3652:
--------------------------------------
+1, the patch looks good to me. Great find/fix, Todd.
> 1.x: FSEditLog failure removes the wrong edit stream when storage dirs have same name
> -------------------------------------------------------------------------------------
>
> Key: HDFS-3652
> URL: https://issues.apache.org/jira/browse/HDFS-3652
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 1.0.3, 1.1.0, 1.2.0
> Reporter: Todd Lipcon
> Assignee: Todd Lipcon
> Priority: Blocker
> Attachments: hdfs-3652.txt
>
>
> In {{FSEditLog.removeEditsForStorageDir}}, we iterate over the edits streams trying to
find the stream corresponding to a given dir. To check equality, we currently use the following
condition:
> {code}
> File parentDir = getStorageDirForStream(idx);
> if (parentDir.getName().equals(sd.getRoot().getName())) {
> {code}
> ... which is horribly incorrect. If two or more storage dirs happen to have the same
terminal path component (eg /data/1/nn and /data/2/nn) then it will pick the wrong stream(s)
to remove.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
|