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

getAdditionalBlock() can create multiple blocks if the client times out and retries.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.2-alpha
    • Fix Version/s: 2.0.3-alpha
    • Component/s: namenode
    • Labels:
      None

      Description

      HDFS client tries to addBlock() to a file. If NameNode is busy the client can timeout and will reissue the same request again. The two requests will race with each other in FSNamesystem.getAdditionalBlock(), which can result in creating two new blocks on the NameNode while the client will know of only one of them. This eventually results in NotReplicatedYetException because the extra block is never reported by any DataNode, which stalls file creation and puts it in invalid state with an empty block in the middle.

        Attachments

        1. TestAddBlockRetry.java
          3 kB
          Konstantin Shvachko
        2. getAdditionalBlock.patch
          15 kB
          Konstantin Shvachko
        3. getAdditionalBlock.patch
          20 kB
          Konstantin Shvachko
        4. getAdditionalBlock-branch2.patch
          20 kB
          Konstantin Shvachko
        5. getAdditionalBlock.patch
          20 kB
          Konstantin Shvachko

          Issue Links

            Activity

              People

              • Assignee:
                shv Konstantin Shvachko
                Reporter:
                shv Konstantin Shvachko
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: