Issue Details (XML | Word | Printable)

Key: HADOOP-4643
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Hairong Kuang
Reporter: Hairong Kuang
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

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

Created: 12/Nov/08 07:56 PM   Updated: 08/Jul/09 04:43 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.18.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works nodeCount-br18.patch 2008-11-14 12:04 AM Hairong Kuang 13 kB
Text File Licensed for inclusion in ASF works nodeCount.patch 2008-11-14 12:42 AM Hairong Kuang 13 kB
Issue Links:
Incorporates
 
Reference
 

Hadoop Flags: Reviewed
Resolution Date: 14/Nov/08 01:04 AM


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Hairong Kuang added a comment - 12/Nov/08 08:01 PM
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 - 12/Nov/08 08:03 PM
Field Original Value New Value
Link This issue is part of HADOOP-4556 [ HADOOP-4556 ]
Hairong Kuang added a comment - 13/Nov/08 10:39 PM
Here is a patch that does not count excess replicas as live replicas.

Hairong Kuang made changes - 13/Nov/08 10:39 PM
Attachment nodeCount.patch [ 12393903 ]
Raghu Angadi added a comment - 13/Nov/08 11:07 PM
+1. Patch looks good.

Hairong Kuang made changes - 13/Nov/08 11:13 PM
Status Open [ 1 ] Patch Available [ 10002 ]
Hairong Kuang added a comment - 14/Nov/08 12:04 AM
patch for branch 0.18.

Hairong Kuang made changes - 14/Nov/08 12:04 AM
Attachment nodeCount-br18.patch [ 12393907 ]
Hairong Kuang made changes - 14/Nov/08 12:04 AM
Attachment nodeCount.patch [ 12393903 ]
Hairong Kuang added a comment - 14/Nov/08 12:04 AM
Patch for the trunk again.

Hairong Kuang made changes - 14/Nov/08 12:04 AM
Attachment nodeCount.patch [ 12393908 ]
Hairong Kuang made changes - 14/Nov/08 12:42 AM
Attachment nodeCount.patch [ 12393908 ]
Hairong Kuang made changes - 14/Nov/08 12:42 AM
Attachment nodeCount.patch [ 12393910 ]
Hairong Kuang added a comment - 14/Nov/08 12:46 AM
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.


Repository Revision Date User Message
ASF #713888 Fri Nov 14 00:50:39 UTC 2008 hairong HADOOP-4643. NameNode should exclude excessive replicas when counting live replicas for a block. Contributed by Hairong Kuang.
Files Changed
MODIFY /hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/MiniDFSCluster.java
MODIFY /hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java
MODIFY /hadoop/core/trunk/CHANGES.txt
ADD /hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java
MODIFY /hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Repository Revision Date User Message
ASF #713890 Fri Nov 14 00:57:29 UTC 2008 hairong Merge -r 713887:713888 from trunk to main to move the change of HADOOP-4643 into branch 0.19
Files Changed
ADD /hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java (from /hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java)
MODIFY /hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
MODIFY /hadoop/core/branches/branch-0.19
MODIFY /hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/MiniDFSCluster.java
MODIFY /hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java
MODIFY /hadoop/core/branches/branch-0.19/CHANGES.txt

Repository Revision Date User Message
ASF #713891 Fri Nov 14 01:01:21 UTC 2008 hairong Merge -r 713887:713888 fromtrunk to main to move the change of HADOOP-4643 into branch 0.18
Files Changed
ADD /hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestNodeCount.java
MODIFY /hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/MiniDFSCluster.java
MODIFY /hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java
MODIFY /hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestDatanodeBlockScanner.java
MODIFY /hadoop/core/branches/branch-0.18/CHANGES.txt

Hairong Kuang added a comment - 14/Nov/08 01:04 AM
I just committed this.

Hairong Kuang made changes - 14/Nov/08 01:04 AM
Resolution Fixed [ 1 ]
Hadoop Flags [Reviewed]
Status Patch Available [ 10002 ] Resolved [ 5 ]
Hudson added a comment - 14/Nov/08 06:33 PM
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 - 30/Jan/09 12:19 AM
Link This issue is related to HADOOP-4540 [ HADOOP-4540 ]
Nigel Daley made changes - 30/Jan/09 08:14 PM
Status Resolved [ 5 ] Closed [ 6 ]
Owen O'Malley made changes - 08/Jul/09 04:43 PM
Component/s dfs [ 12310710 ]