You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Aaron T. Myers (JIRA)" <ji...@apache.org> on 2012/11/07 02:00:33 UTC
[jira] [Created] (HDFS-4158) FSDirectory#hasSnapshot will NPE when
deleting an empty directory
Aaron T. Myers created HDFS-4158:
------------------------------------
Summary: FSDirectory#hasSnapshot will NPE when deleting an empty directory
Key: HDFS-4158
URL: https://issues.apache.org/jira/browse/HDFS-4158
Project: Hadoop HDFS
Issue Type: Sub-task
Components: name-node
Affects Versions: Snapshot (HDFS-2802)
Reporter: Aaron T. Myers
Assignee: Aaron T. Myers
The method attempts to iterate over the child list of the directory, but that list may be null and this isn't handled currently.
--
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
[jira] [Commented] (HDFS-4158) FSDirectory#hasSnapshot will NPE
when deleting an empty directory
Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492026#comment-13492026 ]
Aaron T. Myers commented on HDFS-4158:
--------------------------------------
Ah, so you did. It might be better to use INodeDirectory#getChildrenList instead of INodeDirectory#getChildren and then do a null check. Very minor issue though.
> FSDirectory#hasSnapshot will NPE when deleting an empty directory
> -----------------------------------------------------------------
>
> Key: HDFS-4158
> URL: https://issues.apache.org/jira/browse/HDFS-4158
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: name-node
> Affects Versions: Snapshot (HDFS-2802)
> Reporter: Aaron T. Myers
> Assignee: Aaron T. Myers
> Attachments: HDFS-4158.patch
>
>
> The method attempts to iterate over the child list of the directory, but that list may be null and this isn't handled currently.
--
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
[jira] [Resolved] (HDFS-4158) FSDirectory#hasSnapshot will NPE when
deleting an empty directory
Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aaron T. Myers resolved HDFS-4158.
----------------------------------
Resolution: Duplicate
Fix Version/s: Snapshot (HDFS-2802)
> FSDirectory#hasSnapshot will NPE when deleting an empty directory
> -----------------------------------------------------------------
>
> Key: HDFS-4158
> URL: https://issues.apache.org/jira/browse/HDFS-4158
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: name-node
> Affects Versions: Snapshot (HDFS-2802)
> Reporter: Aaron T. Myers
> Assignee: Aaron T. Myers
> Fix For: Snapshot (HDFS-2802)
>
> Attachments: HDFS-4158.patch
>
>
> The method attempts to iterate over the child list of the directory, but that list may be null and this isn't handled currently.
--
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
[jira] [Commented] (HDFS-4158) FSDirectory#hasSnapshot will NPE
when deleting an empty directory
Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492010#comment-13492010 ]
Aaron T. Myers commented on HDFS-4158:
--------------------------------------
Forgot to mention - the snapshots branch doesn't currently compile without HDFS-4150, so I tested this patch by applying the latest patch there first.
> FSDirectory#hasSnapshot will NPE when deleting an empty directory
> -----------------------------------------------------------------
>
> Key: HDFS-4158
> URL: https://issues.apache.org/jira/browse/HDFS-4158
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: name-node
> Affects Versions: Snapshot (HDFS-2802)
> Reporter: Aaron T. Myers
> Assignee: Aaron T. Myers
> Attachments: HDFS-4158.patch
>
>
> The method attempts to iterate over the child list of the directory, but that list may be null and this isn't handled currently.
--
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
[jira] [Updated] (HDFS-4158) FSDirectory#hasSnapshot will NPE when
deleting an empty directory
Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aaron T. Myers updated HDFS-4158:
---------------------------------
Attachment: HDFS-4158.patch
Here's a trivial patch which fixes the issue. No tests are included since this functionality (deleting an empty directory) is currently covered by several other tests.
> FSDirectory#hasSnapshot will NPE when deleting an empty directory
> -----------------------------------------------------------------
>
> Key: HDFS-4158
> URL: https://issues.apache.org/jira/browse/HDFS-4158
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: name-node
> Affects Versions: Snapshot (HDFS-2802)
> Reporter: Aaron T. Myers
> Assignee: Aaron T. Myers
> Attachments: HDFS-4158.patch
>
>
> The method attempts to iterate over the child list of the directory, but that list may be null and this isn't handled currently.
--
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
[jira] [Commented] (HDFS-4158) FSDirectory#hasSnapshot will NPE
when deleting an empty directory
Posted by "Jing Zhao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492022#comment-13492022 ]
Jing Zhao commented on HDFS-4158:
---------------------------------
Thanks for the fix Aaron! Actually I notice this problem too and I included a similar fix in HDFS-4147#HDFS-snapshot-check-rename.patch.
> FSDirectory#hasSnapshot will NPE when deleting an empty directory
> -----------------------------------------------------------------
>
> Key: HDFS-4158
> URL: https://issues.apache.org/jira/browse/HDFS-4158
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: name-node
> Affects Versions: Snapshot (HDFS-2802)
> Reporter: Aaron T. Myers
> Assignee: Aaron T. Myers
> Attachments: HDFS-4158.patch
>
>
> The method attempts to iterate over the child list of the directory, but that list may be null and this isn't handled currently.
--
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