You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by ha...@apache.org on 2010/12/01 23:16:16 UTC

svn commit: r1041190 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java

Author: hairong
Date: Wed Dec  1 22:16:16 2010
New Revision: 1041190

URL: http://svn.apache.org/viewvc?rev=1041190&view=rev
Log:
HDFS-1524. Image loader should make sure to read every byte in image file. Contributed by Hairong Kuang.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1041190&r1=1041189&r2=1041190&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Wed Dec  1 22:16:16 2010
@@ -419,6 +419,9 @@ Release 0.22.0 - Unreleased
 
     HDFS-1503. TestSaveNamespace fails. (Todd Lipcon via cos)
 
+    HDFS-1524. Image loader should make sure to read every byte in image file.
+    (hairong)
+
 Release 0.21.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java?rev=1041190&r1=1041189&r2=1041190&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java Wed Dec  1 22:16:16 2010
@@ -273,6 +273,9 @@ public abstract class FSImageFormat {
 
         this.loadSecretManagerState(in, targetNamesystem);
 
+        // make sure to read to the end of file
+        int eof = in.read();
+        assert eof == -1 : "Should have reached the end of image file " + curFile;
       } finally {
         in.close();
       }