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

Edit log corruption due to defered INode removal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.4.0
    • 2.5.0
    • None
    • None
    • Reviewed

    Description

      We have seen a SBN crashing with the following error:

      [Edit log tailer] ERROR namenode.FSEditLogLoader:
      Encountered exception on operation AddBlockOp
      [path=/xxx,
      penultimateBlock=NULL, lastBlock=blk_111_111, RpcClientId=,
      RpcCallId=-2]
      java.io.FileNotFoundException: File does not exist: /xxx

      This was caused by the deferred removal of deleted inodes from the inode map. Since getAdditionalBlock() acquires FSN read lock and then write lock, a deletion can happen in between. Because of deferred inode removal outside FSN write lock, getAdditionalBlock() can get the deleted inode from the inode map with FSN write lock held. This allow addition of a block to a deleted file.

      As a result, the edit log will contain OP_ADD, OP_DELETE, followed by
      OP_ADD_BLOCK. This cannot be replayed by NN, so NN doesn't start up or SBN crashes.

      Attachments

        1. HDFS-6527-addendum-test.patch
          6 kB
          Aaron Myers
        2. HDFS-6527.v5.patch
          7 kB
          Jing Zhao
        3. HDFS-6527.v4.patch
          6 kB
          Kihwal Lee
        4. HDFS-6527.v3.patch
          7 kB
          Kihwal Lee
        5. HDFS-6527.v2.patch
          6 kB
          Kihwal Lee
        6. HDFS-6527.trunk.patch
          2 kB
          Kihwal Lee
        7. HDFS-6527.branch-2.4.patch
          2 kB
          Kihwal Lee

        Activity

          People

            kihwal Kihwal Lee
            kihwal Kihwal Lee
            Votes:
            0 Vote for this issue
            Watchers:
            21 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: