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

Rename with OVERWRITE option may throw NPE when the target file/directory is a reference INode

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.5.0
    • namenode, snapshots
    • None
    • Reviewed

    Description

      The following steps can reproduce the NPE:
      1. create a snapshot on /
      2. move /foo/file1 to /bar/
      3. rename /foo/file2 to /bar/file1 with the OVERWRITE option

      After step 2, /bar/file1 is a DstReference inode. In step 3, FSDirectory#unprotectedRename first detaches the DstReference inode from the WithCount inode, then it still calls the cleanSubtree method of the corresponding INodeFile instance, which triggers the NPE. We should follow the same logic in FSDirectory#unprotectedDelete which skips the cleanSubtree call in this scenario.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jingzhao Jing Zhao Assign to me
            jingzhao Jing Zhao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment