[ https://issues.apache.org/jira/browse/HDFS-8029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14389186#comment-14389186 ]
Xiaoyu Yao commented on HDFS-8029: ---------------------------------- [~kanaka], thanks for reporting the issue. I tried your steps as shown below but can't reproduce the issue. Do you miss any repro step in the original description? {code} $ hdfs dfs -ls / $ hdfs dfs -mkdir -p /test/sub1/sub2 $ hdfs dfs -copyFromLocal sh.tar /test/sub1/file1 $ hdfs dfs -copyFromLocal sh.tar /test/sub1/sub2/file1 $ hdfs dfsadmin -allowSnapshot /test/sub1 Allowing snaphot on /test/sub1 succeeded $ hdfs dfs -createSnapshot /test/sub1 "s1" Created snapshot /test/sub1/.snapshot/s1 $ hdfs dfs -rm -r /test/sub1/sub2 15/03/31 11:51:06 INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 0 minutes, Emptier interval = 0 minutes. Deleted /test/sub1/sub2 $ hdfs dfs -createSnapshot /test/sub1 "s2" Created snapshot /test/sub1/.snapshot/s2 $ hadoop fs -du /test/ 81920 81920 /test/sub1 {code} > NPE during disk usage calculation on snapshot directory, after a sub folder > is deleted > -------------------------------------------------------------------------------------- > > Key: HDFS-8029 > URL: https://issues.apache.org/jira/browse/HDFS-8029 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: kanaka kumar avvaru > Assignee: kanaka kumar avvaru > > ContentSummary computation is causing NullPointerException on snapshot > directory if some sub directory is deleted. > Following are the steps to reproduce the issue. > > 1. Create a root directory "/test" > 2. Create sub dir named as /test/sub1 > 3. Create sub dir in sub1 as /test/sub1/sub2 > 4. Create a file at /test/sub1/file1 > 5. Create a file at /test/sub1/sub2/file1 > 6. Enable shotshot on sub1 (hadoop dfsadmin -allowSnapshot test/sub1) > 7. Create snapshot1 on /test/sub1 > 8. Delete directory /test/sub1/sub2 (recursively) > 9. Create snapshot2 on /test/sub1 > 10. Execute du command on /test (hadoop fs -du /test/) > > > Gives NullPointerException in CLI. NameNode logs the exception as > ... java.lang.NullPointerException at > org.apache.hadoop.hdfs.server.namenode.ContentSummaryComputationContext.getBlockStoragePolicySuite(ContentSummaryComputationContext.java:122) > ... > -- This message was sent by Atlassian JIRA (v6.3.4#6332)