Hadoop Common
  1. Hadoop Common
  2. HADOOP-4643

NameNode should exclude excessive replicas when counting live replicas for a block

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.18.3
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Currently NameNode include excessive replicas in blockMap and count them as live replicas. Although excessive replicas have marked as invalid, scheduling deletion may be delayed and also datanode does not send deletion confirmation until the next block report. As a result, excessive replicas may stay in blocksMap for quite a while. This may cause underReplicated blocks undetected in NameNode.

      For example, assume that block b is at datanode d1, d2, and d3. We have the following scenario
      1. d1 loses heartbeat, NN will replicate b to another datanode, assuming it is d4.
      2. d1 comes back. NN finds out b is over-replicated therefore choosing one replica, assuming d4, as a excessive replica and marking it as invalid. Now b has 3 valid replicas d1, d2, d3 and 1 excessive (invalid) replica d4, all in blocksMap.
      3. d2 loses heartbeat. d2 gets removed from blocksMap. Block b has 2 valid replicas d1 and d3, and 1 excessive invalid replica d4. Block b is under-replicated; But NN still counts block b has 3 live replicas so does not take any action to replicate block b.

      1. nodeCount-br18.patch
        13 kB
        Hairong Kuang
      2. nodeCount.patch
        13 kB
        Hairong Kuang

        Issue Links

          Activity

          Hairong Kuang created issue -
          Hide
          Hairong Kuang added a comment -

          A patch to HADOOP-4540 will fix the problem described in this jira. But while I am working on HADOOP-4540, I realize that the policy change proposed in HADOOP-4540 bring subtle dfs semantics change which needs more discussion. So I plan to mark HADOOP-4540 to be fixed in 0.20 and having a simple solution in this jira to be fixed in 0.18. This jira is a part of the solution to avoid data loss as described in HADOOP-4556.

          Show
          Hairong Kuang added a comment - A patch to HADOOP-4540 will fix the problem described in this jira. But while I am working on HADOOP-4540 , I realize that the policy change proposed in HADOOP-4540 bring subtle dfs semantics change which needs more discussion. So I plan to mark HADOOP-4540 to be fixed in 0.20 and having a simple solution in this jira to be fixed in 0.18. This jira is a part of the solution to avoid data loss as described in HADOOP-4556 .
          Hairong Kuang made changes -
          Field Original Value New Value
          Link This issue is part of HADOOP-4556 [ HADOOP-4556 ]
          Hide
          Hairong Kuang added a comment -

          Here is a patch that does not count excess replicas as live replicas.

          Show
          Hairong Kuang added a comment - Here is a patch that does not count excess replicas as live replicas.
          Hairong Kuang made changes -
          Attachment nodeCount.patch [ 12393903 ]
          Hide
          Raghu Angadi added a comment -

          +1. Patch looks good.

          Show
          Raghu Angadi added a comment - +1. Patch looks good.
          Hairong Kuang made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Hairong Kuang added a comment -

          patch for branch 0.18.

          Show
          Hairong Kuang added a comment - patch for branch 0.18.
          Hairong Kuang made changes -
          Attachment nodeCount-br18.patch [ 12393907 ]
          Hairong Kuang made changes -
          Attachment nodeCount.patch [ 12393903 ]
          Hide
          Hairong Kuang added a comment -

          Patch for the trunk again.

          Show
          Hairong Kuang added a comment - Patch for the trunk again.
          Hairong Kuang made changes -
          Attachment nodeCount.patch [ 12393908 ]
          Hairong Kuang made changes -
          Attachment nodeCount.patch [ 12393908 ]
          Hairong Kuang made changes -
          Attachment nodeCount.patch [ 12393910 ]
          Hide
          Hairong Kuang added a comment -

          Ant test-core build passed on my local machine.

          Ant test-patch result:

          [exec] +1 overall.

          [exec] +1 @author. The patch does not contain any @author tags.

          [exec] +1 tests included. The patch appears to include 10 new ormodified tests.

          [exec] +1 javadoc. The javadoc tool did not generate any warningmessages.

          [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.

          [exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

          Show
          Hairong Kuang added a comment - Ant test-core build passed on my local machine. Ant test-patch result: [exec] +1 overall. [exec] +1 @author. The patch does not contain any @author tags. [exec] +1 tests included. The patch appears to include 10 new ormodified tests. [exec] +1 javadoc. The javadoc tool did not generate any warningmessages. [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity.
          Hide
          Hairong Kuang added a comment -

          I just committed this.

          Show
          Hairong Kuang added a comment - I just committed this.
          Hairong Kuang made changes -
          Resolution Fixed [ 1 ]
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Hide
          Hudson added a comment -

          Integrated in Hadoop-trunk #661 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/661/)
          . NameNode should exclude excessive replicas when counting live replicas for a block. Contributed by Hairong Kuang.

          Show
          Hudson added a comment - Integrated in Hadoop-trunk #661 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/661/ ) . NameNode should exclude excessive replicas when counting live replicas for a block. Contributed by Hairong Kuang.
          Robert Chansler made changes -
          Link This issue is related to HADOOP-4540 [ HADOOP-4540 ]
          Nigel Daley made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Owen O'Malley made changes -
          Component/s dfs [ 12310710 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          1d 3h 16m 1 Hairong Kuang 13/Nov/08 23:13
          Patch Available Patch Available Resolved Resolved
          1h 51m 1 Hairong Kuang 14/Nov/08 01:04
          Resolved Resolved Closed Closed
          77d 19h 10m 1 Nigel Daley 30/Jan/09 20:14

            People

            • Assignee:
              Hairong Kuang
              Reporter:
              Hairong Kuang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development