hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r522260 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java
Date Sun, 25 Mar 2007 13:16:07 GMT
Author: tomwhite
Date: Sun Mar 25 06:16:06 2007
New Revision: 522260

URL: http://svn.apache.org/viewvc?view=rev&rev=522260
Log:
HADOOP-1122.  Fix divide-by-zero exception in FSNamesystem chooseTarget method.  Contributed
by Dhruba Borthakur.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=522260&r1=522259&r2=522260
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Sun Mar 25 06:16:06 2007
@@ -34,6 +34,9 @@
 10. HADOOP-1068.  Improve error message for clusters with 0 datanodes.
     (Dhruba Borthakur via tomwhite)
 
+11. HADOOP-1122.  Fix divide-by-zero exception in FSNamesystem
+    chooseTarget method.  (Dhruba Borthakur via tomwhite)
+
 
 Release 0.12.2 - 2007-23-17
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java?view=diff&rev=522260&r1=522259&r2=522260
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Sun Mar 25 06:16:06
2007
@@ -2794,8 +2794,9 @@
           List<DatanodeDescriptor> choosenNodes,
           List<DatanodeDescriptor> excludedNodes,
           long blocksize ) {
-        if( numOfReplicas == 0 )
+        if( numOfReplicas == 0 || clusterMap.getNumOfLeaves()==0 ) {
           return new DatanodeDescriptor[0];
+        }
         
         if( excludedNodes == null) {
           excludedNodes = new ArrayList<DatanodeDescriptor>();



Mime
View raw message