Hadoop Common
  1. Hadoop Common
  2. HADOOP-10902

Deletion of directories with snapshots will not output reason for trash move failure

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.6.0
    • Component/s: None
    • Labels:
      None

      Description

      When using trash-enabled FsShell to delete a directory that has snapshots, we se an error message saying "Failed to move to trash" but no explanation.

      [hdfs@schu-enc2 ~]$ hdfs dfs -rm -r snap
      2014-07-28 05:45:29,527 INFO  [main] fs.TrashPolicyDefault (TrashPolicyDefault.java:initialize(92)) - Namenode trash configuration: Deletion interval = 1440 minutes, Emptier interval = 0 minutes.
      rm: Failed to move to trash: hdfs://schu-enc2.vpc.com:8020/user/hdfs/snap. Consider using -skipTrash option
      

      If we use -skipTrash, then we'll get the explanation: "rm: The directory /user/hdfs/snap cannot be deleted since /user/hdfs/snap is snapshottable and already has snapshots"

      It'd be an improvement to make it clear that dirs with snapshots cannot be deleted when we're using the trash.

        Activity

        Hide
        Stephen Chu added a comment -

        Attaching a patch that appends the cause to the "Failed to move to trash" error message.

        Now when users fail to move to Trash through FsShell, they'll get an explanation.

        e.g.

        rm: Failed to move to trash: hdfs://schu-enc2.vpc.com:8020/user/hdfs/snap: The directory /user/hdfs/snap cannot be deleted since /user/hdfs/snap is snapshottable and already has snapshots
        

        HDFS-6767 is an example of where this improved error message is helpful.

        Show
        Stephen Chu added a comment - Attaching a patch that appends the cause to the "Failed to move to trash" error message. Now when users fail to move to Trash through FsShell, they'll get an explanation. e.g. rm: Failed to move to trash: hdfs: //schu-enc2.vpc.com:8020/user/hdfs/snap: The directory /user/hdfs/snap cannot be deleted since /user/hdfs/snap is snapshottable and already has snapshots HDFS-6767 is an example of where this improved error message is helpful.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12658594/HADOOP-10902.1.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. There were no new javadoc warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/4387//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/4387//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12658594/HADOOP-10902.1.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/4387//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/4387//console This message is automatically generated.
        Hide
        Stephen Chu added a comment -

        No unit tests added because the patch only changes an exception message.

        Show
        Stephen Chu added a comment - No unit tests added because the patch only changes an exception message.
        Hide
        Andrew Wang added a comment -

        +1 LGTM. I'll wait until tomorrow in case Alejandro Abdelnur has any comments, but this looks good even outside of encryption.

        Show
        Andrew Wang added a comment - +1 LGTM. I'll wait until tomorrow in case Alejandro Abdelnur has any comments, but this looks good even outside of encryption.
        Hide
        Andrew Wang added a comment -

        Merged to trunk and branch-2, thanks Stephen!

        Show
        Andrew Wang added a comment - Merged to trunk and branch-2, thanks Stephen!
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #5996 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5996/)
        HADOOP-10902. Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171)

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #5996 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5996/ ) HADOOP-10902 . Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #631 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/631/)
        HADOOP-10902. Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171)

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #631 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/631/ ) HADOOP-10902 . Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Hdfs-trunk #1825 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1825/)
        HADOOP-10902. Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171)

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #1825 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1825/ ) HADOOP-10902 . Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1850 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1850/)
        HADOOP-10902. Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171)

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1850 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1850/ ) HADOOP-10902 . Deletion of directories with snapshots will not output reason for trash move failure. Contributed by Stephen Chu. (wang: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1615171 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Delete.java
        Hide
        Andrew Wang added a comment -

        I accidentally committed this and HADOOP-10900 in the same commit to branch-2. Reverting this out and fixing it would be a bit annoying because things have landed in CredShell since then, so I'd like to leave it as is. My bad.

        Show
        Andrew Wang added a comment - I accidentally committed this and HADOOP-10900 in the same commit to branch-2. Reverting this out and fixing it would be a bit annoying because things have landed in CredShell since then, so I'd like to leave it as is. My bad.

          People

          • Assignee:
            Stephen Chu
            Reporter:
            Stephen Chu
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development