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

Aaron T. Myers commented on HDFS-4244:
--------------------------------------

The patch looks pretty good to me, though I'd really like Nicholas to review 
the {{Diff#combinePostDiff}} method.

A few little comments:

# I recommend you rename one of the deleteSnapshot methods in SnapshotManager. 
They do completely distinct things, and so are not really overloaded forms of 
each other. Perhaps name the one which does the recursive diff delete to 
deleteDiffsForSnapshot or something?
# I think there may be a bug in the {{SnapshotManager#deleteSnapshot}} method 
which does the recursive diff delete. Imagine the scenario where we have the 
directories "/a/b/c". We mark "a" as snapshottable and create a snapshot of it. 
Then, we create a file "d" under "c". This will cause "c" to become an 
INodeDirectoryWithSnapshot, but "b" will still just be a regular 
INodeDirectory. If we then delete the snapshot, the recursive traversal will 
never even examine "c" to see if it has a diff that should be deleted, since 
the traversal will terminate early once it discovers that "b" is not an 
INodeDirectoryWithSnapshot.
# I don't think we should be adding these snapshots API calls to FileSystem or 
the FsShell command. In the last design meetup, we discussed that there should 
be a separate command for snapshot-related operations or that they should be 
rolled into DFSAdmin. I believe we also discussed that for programmatic access 
we should be adding the API calls to the HdfsAdmin class, not FileSystem. I 
realize that in this JIRA you're just being consistent with the existing 
createSnapshot APIs, so perhaps we should file a separate JIRA for this?
# In the tests, I recommend you use 
{{GenericTestUtils#assertExceptionContains}} instead of 
{{assertTrue(e.getMessage().contains(...}}.
                
> Support deleting snapshots
> --------------------------
>
>                 Key: HDFS-4244
>                 URL: https://issues.apache.org/jira/browse/HDFS-4244
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, namenode
>            Reporter: Jing Zhao
>            Assignee: Jing Zhao
>         Attachments: HDFS-4244.001.patch, HDFS-4244.002.patch, 
> HDFS-4244.003.patch
>
>
> Provide functionality to delete a snapshot, given the name of the snapshot 
> and the path to the directory where the snapshot was taken.

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