Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12981

renameSnapshot a Non-Existent snapshot to itself should throw error

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.10.0, 3.2.0, 3.1.1, 3.0.3
    • Component/s: hdfs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When trying to rename a non-existent HDFS snapshot to ITSELF, there are no errors and exits with a success code.

      The steps to reproduce this issue is:

      hdfs dfs -mkdir /tmp/dir1
      hdfs dfsadmin -allowSnapshot /tmp/dir1
      hdfs dfs -createSnapshot /tmp/dir1 snap1_dir

      Rename from non-existent to another_non-existent : errors and return code 1. This is correct.

      hdfs dfs -renameSnapshot /tmp/dir1 nonexist another_nonexist :
      echo $?

      renameSnapshot: The snapshot nonexist does not exist for directory /tmp/dir1

      Rename from non-existent to non-existent : no errors and return code 0 instead of Error and return code 1.
      hdfs dfs -renameSnapshot /tmp/dir1 nonexist nonexist ; echo $?

      Current behavior: No error and return code 0.

      Expected behavior: An error returned and return code 1.

        Attachments

        1. HDFS-12981.001.patch
          3 kB
          Kitti Nanasi
        2. HDFS-12981.002.patch
          4 kB
          Kitti Nanasi
        3. HDFS-12981.003.patch
          4 kB
          Kitti Nanasi
        4. HDFS-12981.004.patch
          4 kB
          Kitti Nanasi
        5. HDFS-12981-branch-2.6.0.001.patch
          4 kB
          Kitti Nanasi
        6. HDFS-12981-branch-2.6.0.002.patch
          4 kB
          Kitti Nanasi

          Activity

            People

            • Assignee:
              knanasi Kitti Nanasi
              Reporter:
              saileshpatel Sailesh Patel
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: