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

Snapshot: fix the scenario where a directory is renamed under its prior descendant

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.1.0-beta, 3.0.0-alpha1
    • 2.1.0-beta
    • snapshots
    • Reviewed

    Description

      Suppose we have the following operations:
      1. rename /dir1/foo/bar to /dir2/bar2
      2. rename /dir1/foo to /dir2/bar2/foo2

      I.e., we rename a directory (foo) to a child of its prior descendant (bar). If we have taken snapshots on root before the above 2 rename operations, a circle can be generated consisting of nodes with the types INodeReference.WithName and INodeReference.DstReference:

      WithName (foo) --> WithCount (for foo) --> foo2 --> WithName (bar) --> WithCount (for bar) --> bar2 --> DstReference (foo) --> WithCount (for foo)

      When deleting a snapshot before the rename operations, the current code may hit an infinite loop when cleaning the snapshot data or updating the quota usage for the nodes in the above circle. This jira will fix the issue.

      Attachments

        1. HDFS-4877.001.patch
          52 kB
          Jing Zhao
        2. HDFS-4877.002.patch
          52 kB
          Jing Zhao

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: