hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r529330 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java
Date Mon, 16 Apr 2007 17:18:39 GMT
Author: cutting
Date: Mon Apr 16 10:18:38 2007
New Revision: 529330

URL: http://svn.apache.org/viewvc?view=rev&rev=529330
Log:
HADOOP-1256.  Fix NameNode so that multiple DatanodeDescriptors can no longer be created on
startup.  Contributed by Hairong.

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=529330&r1=529329&r2=529330
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Apr 16 10:18:38 2007
@@ -198,6 +198,9 @@
     NullPointerException in JobControl.  
     (Johan Oskarson via tomwhite)
 
+60. HADOOP-1256.  Fix NameNode so that multiple DataNodeDescriptors
+    can no longer be created on startup.  (Hairong Kuang via cutting)
+
 
 Release 0.12.3 - 2007-04-06
 

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=529330&r1=529329&r2=529330
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Mon Apr 16 10:18:38
2007
@@ -2008,7 +2008,12 @@
     }
     
     void unprotectedAddDatanode( DatanodeDescriptor nodeDescr ) {
-      datanodeMap.put( nodeDescr.getStorageID(), nodeDescr );
+      /* To keep host2DataNodeMap consistent with datanodeMap,
+         remove  from host2DataNodeMap the datanodeDescriptor removed
+         from datanodeMap before adding nodeDescr to host2DataNodeMap.
+       */
+      host2DataNodeMap.remove(
+          datanodeMap.put(nodeDescr.getStorageID(), nodeDescr));
       host2DataNodeMap.add(nodeDescr);
       
       NameNode.stateChangeLog.debug(
@@ -2024,8 +2029,7 @@
      */
     void wipeDatanode( DatanodeID nodeID ) throws IOException {
       String key = nodeID.getStorageID();
-      datanodeMap.remove(key);
-      host2DataNodeMap.remove(getDatanode( nodeID ));
+      host2DataNodeMap.remove(datanodeMap.remove(key));
       NameNode.stateChangeLog.debug(
           "BLOCK* NameSystem.wipeDatanode: "
           + nodeID.getName() + " storage " + key 



Mime
View raw message