Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-2802 Support for RW/RO snapshots in HDFS
  3. HDFS-4842

Snapshot: identify the correct prior snapshot when deleting a snapshot under a renamed subtree



    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0-beta
    • Component/s: snapshots
    • Labels:
    • Hadoop Flags:


      In our long-term running tests for snapshot we find the following bug:

      1. initially we have directories /test, /test/dir1 and /test/dir2/foo.
      2. first take snapshot s0 and s1 on /test.
      3. modify some descendant of foo (e.g., delete foo/bar/file), to make sure some changes have been recorded to the snapshot diff associated with s1.
      4. take snapshot s2 on /test/dir2
      5. move foo from dir2 to dir1, i.e., rename /test/dir2/foo to /test/dir1/foo
      6. delete snapshot s1

      After step 6, the snapshot copy of foo/bar/file should have been merged from s1 to s0 (i.e., s0 should be identified as the prior snapshot of s1). However, the current code failed to identify the correct prior snapshot in the source tree of the rename operation and wrongly used s2 as the prior snapshot.

      The bug only exists when nested snapshottable directories are enabled. To fix the bug, we need to go upwards in the source tree of the rename operation (i.e., dir2) to identify the correct prior snapshot in the above scenario. This jira will fix the bug and add several corresponding unit tests.


        1. HDFS-4842.000.patch
          16 kB
          Jing Zhao
        2. HDFS-4842.001.patch
          6 kB
          Jing Zhao
        3. HDFS-4842.002.patch
          9 kB
          Jing Zhao

          Issue Links



              • Assignee:
                jingzhao Jing Zhao
                jingzhao Jing Zhao
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created: