Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2802 Support for RW/RO snapshots in HDFS
  3. HDFS-4759

snapshotDiff of two invalid snapshots but with same name returns success

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Snapshot (HDFS-2802)
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      snapshotDiff of two invalid snapshots which have the same names returns a success.

      $ hadoop dfs -ls /user/foo/hdfs-snapshots/.snapshot
      Found 1 items
      drwx------ - foo foo 0 2013-04-26 00:53 /user/foo/hdfs-snapshots/.snapshot/s1

      $ hadoop snapshotDiff /user/foo/hdfs-snapshots invalid invalid
      Difference between snapshot invalid and snapshot invalid under directory /user/foo/hdfs-snapshots:

      -bash-4.1$ echo $?
      0

        Activity

        Hide
        sathish added a comment -

        I already worked on this ,and i has prepared patch for this ,with that patch it will work in required manner,
        i am attaching that patch here..

        Show
        sathish added a comment - I already worked on this ,and i has prepared patch for this ,with that patch it will work in required manner, i am attaching that patch here..
        Hide
        sathish added a comment -

        After applying that patch also i am getting like this and i think the issue is not resolved
        $ hadoop dfs -ls /user/foo/hdfs-snapshots/.snapshot
        Found 1 items
        drwx------ - foo foo 0 2013-04-26 00:53 /user/foo/hdfs-snapshots/.snapshot/s1

        $ hadoop snapshotDiff /user/foo/hdfs-snapshots invalid invalid
        Difference between snapshot invalid and snapshot invalid under directory /user/foo/hdfs-snapshots:

        -bash-4.1$ echo $?
        0

        Show
        sathish added a comment - After applying that patch also i am getting like this and i think the issue is not resolved $ hadoop dfs -ls /user/foo/hdfs-snapshots/.snapshot Found 1 items drwx------ - foo foo 0 2013-04-26 00:53 /user/foo/hdfs-snapshots/.snapshot/s1 $ hadoop snapshotDiff /user/foo/hdfs-snapshots invalid invalid Difference between snapshot invalid and snapshot invalid under directory /user/foo/hdfs-snapshots: -bash-4.1$ echo $? 0
        Hide
        Brahma Reddy Battula added a comment -

        Even after defect fix return code will be Zero(for the mentioned scenario), since we are not returning the return code in following catch exception..

        Hence handling the as part of the https://issues.apache.org/jira/i#browse/HDFS-5315

        Show
        Brahma Reddy Battula added a comment - Even after defect fix return code will be Zero(for the mentioned scenario), since we are not returning the return code in following catch exception.. Hence handling the as part of the https://issues.apache.org/jira/i#browse/HDFS-5315
        Hide
        Tsz Wo Nicholas Sze added a comment -

        I have committed this. Thanks, Jing!

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed this. Thanks, Jing!
        Hide
        Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        Jing Zhao added a comment -

        Thanks for the catch Ramya! Upload the patch for the fix. Also update the unit test to cover this case.

        Show
        Jing Zhao added a comment - Thanks for the catch Ramya! Upload the patch for the fix. Also update the unit test to cover this case.

          People

          • Assignee:
            Jing Zhao
            Reporter:
            Ramya Sunil
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development