You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/07/31 14:37:15 UTC

[GitHub] [hadoop] mukul1987 commented on a change in pull request #2181: HDFS-15498. Show snapshots deletion status in snapList cmd.

mukul1987 commented on a change in pull request #2181:
URL: https://github.com/apache/hadoop/pull/2181#discussion_r463432977



##########
File path: hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/SnapshotStatus.java
##########
@@ -207,6 +215,10 @@ public String getOwner() {
     public String getGroup() {
       return group;
     }
+
+    public boolean isDELETED () {

Review comment:
       DELETED, should be in camelcase

##########
File path: hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/SnapshotStatus.java
##########
@@ -207,6 +215,10 @@ public String getOwner() {
     public String getGroup() {
       return group;
     }
+
+    public boolean isDELETED () {

Review comment:
       This function can be removed, as this has no callers and is causing recuriosn.

##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestListSnapshot.java
##########
@@ -128,7 +132,15 @@ public void testListSnapshot() throws Exception {
         snapshotStatuses[2].getFullPath());
     hdfs.deleteSnapshot(dir1, "s2");
     snapshotStatuses = hdfs.getSnapshotListing(dir1);
-    // There are now 2 snapshots for dir1
+    // There are now 2 active snapshots for dir1 and one is marked deleted
+    assertEquals(3, snapshotStatuses.length);
+    assertTrue(snapshotStatuses[2].isDeleted());
+    assertFalse(snapshotStatuses[1].isDeleted());
+    assertFalse(snapshotStatuses[0].isDeleted());
+    // delete the 1st snapshot
+    hdfs.deleteSnapshot(dir1, "s0");
+    snapshotStatuses = hdfs.getSnapshotListing(dir1);
+    // There are now 2 snapshots now as the 1st one is deleted in order

Review comment:
       Let's add assert that S0 is marked as deleted here.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org