hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r644189 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSEditLog.java
Date Thu, 03 Apr 2008 07:04:28 GMT
Author: dhruba
Date: Thu Apr  3 00:04:26 2008
New Revision: 644189

URL: http://svn.apache.org/viewvc?rev=644189&view=rev
Log:
HADOOP-3118.  Fix Namenode NPE while loading fsimage after a cluster
upgrade from older disk format. (dhruba)


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSEditLog.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=644189&r1=644188&r2=644189&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Apr  3 00:04:26 2008
@@ -440,6 +440,9 @@
 
     HADOOP-3114. Fix TestDFSShell on Windows. (Lohit Vijaya Renu via cdouglas)
 
+    HADOOP-3118.  Fix Namenode NPE while loading fsimage after a cluster 
+    upgrade from older disk format. (dhruba)
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSEditLog.java?rev=644189&r1=644188&r2=644189&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSEditLog.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSEditLog.java Thu Apr  3 00:04:26 2008
@@ -486,8 +486,9 @@
             }
 
             // clientname, clientMachine and block locations of last block.
-            clientName = null;
-            clientMachine = null;
+            clientName = "";
+            clientMachine = "";
+            lastLocations = null;
             if (opcode == OP_ADD && logVersion <= -12) {
               UTF8 uu = new UTF8();
               UTF8 cl = new UTF8();
@@ -500,6 +501,8 @@
               writables = aw.get();
               lastLocations = new DatanodeDescriptor[writables.length];
               System.arraycopy(writables, 0, lastLocations, 0, writables.length);
+            } else {
+              lastLocations = new DatanodeDescriptor[0];
             }
   
             // The open lease transaction re-creates a file if necessary.
@@ -507,10 +510,8 @@
             if (FSNamesystem.LOG.isDebugEnabled()) {
               FSNamesystem.LOG.debug(opcode + ": " + name.toString() + 
                                      " numblocks : " + blocks.length +
-                                     " clientHolder " +  
-                                     ((clientName != null) ? clientName : "") +
-                                     " clientMachine " +
-                                     ((clientMachine != null) ? clientMachine : ""));
+                                     " clientHolder " +  clientName +
+                                     " clientMachine " + clientMachine);
             }
 
             old = fsDir.unprotectedDelete(path, mtime, null);
@@ -534,7 +535,7 @@
                                         node.getPermissionStatus(),
                                         clientName, 
                                         clientMachine, 
-                                        null, 
+                                        null,
                                         lastLocations);
               fsDir.replaceNode(path, node, cons);
               fsNamesys.addLease(path, clientName);



Mime
View raw message