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

Tsz Wo (Nicholas), SZE commented on HDFS-4863:
----------------------------------------------

How about we remove the first if-statement and combine the non-root case to the 
second if-statement?  I.e.
{code}
      if (numSnapshots >= 0) {
        final INodeDirectorySnapshottable snapshottableParent
            = INodeDirectorySnapshottable.valueOf(parent, 
parent.getLocalName());
        // load snapshots and snapshotQuota
        SnapshotFSImageFormat.loadSnapshotList(snapshottableParent,
            numSnapshots, in, this);
        if (snapshottableParent.getSnapshotQuota() > 0) {
          this.namesystem.getSnapshotManager().addSnapshottable(
              snapshottableParent);
        }
      }
{code}

                
> The root directory should be added to the snapshottable directory list while 
> loading fsimage 
> ---------------------------------------------------------------------------------------------
>
>                 Key: HDFS-4863
>                 URL: https://issues.apache.org/jira/browse/HDFS-4863
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: snapshots
>    Affects Versions: 3.0.0
>            Reporter: Jing Zhao
>            Assignee: Jing Zhao
>              Labels: snapshots
>         Attachments: HDFS-4863.001.patch
>
>
> When the root directory is set as snapshottable, its snapshot quota is 
> changed from 0 to a positive number. While loading fsimage we should check 
> the root's snapshot quota and add it to snapshottable directory list in 
> SnapshotManager if necessary.

--
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

Reply via email to