[ 
https://issues.apache.org/jira/browse/HDFS-9063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14791678#comment-14791678
 ] 

Yi Liu commented on HDFS-9063:
------------------------------

Thanks [~jingzhao] for working on this.  Jenkins' report has issue, 
{{TestGetContentSummaryWithSnapshot}} can pass locally.

I also found similar issue (not the same, but also problem of getContentSummary 
if there is snapshot) when writing tests for large directory in HDFS-9053, it 
also exists in current trunk.  I apply your patch, the issue I saw is still 
there.
I think you can fix the issue too and write test of following steps to 
reproduce the issue I found (Of course if you don't want to fix it, I can do it 
separately :)):
# Suppose we have a directory named 'dir', create 16 files in the dir
# remove the last 1 file  -- now total 15 files in dir
# create a snapshot 's1' of dir
# add 1 file in dir -- now total 16 files in dir
# remove the first 1 file in dir -- now total 15 files in the dir
# call getContentSummary(dir), and then {{getFileCount}}.  -- the expected 
result is 15, but the return is 16.

> Correctly handle snapshot path for getContentSummary
> ----------------------------------------------------
>
>                 Key: HDFS-9063
>                 URL: https://issues.apache.org/jira/browse/HDFS-9063
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Jing Zhao
>            Assignee: Jing Zhao
>         Attachments: HDFS-9063.000.patch
>
>
> The current getContentSummary implementation does not take into account the 
> snapshot path, thus if we have the following ops:
> 1. create dirs /foo/bar
> 2. take snapshot s1 on /foo
> 3. create a 1 byte file /foo/bar/baz
> then "du /foo" and "du /foo/.snapshot/s1" can report same results for "bar", 
> which is incorrect since the 1 byte file is not included in snapshot s1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to