hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r635978 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/DataNode.java
Date Tue, 11 Mar 2008 15:39:52 GMT
Author: rangadi
Date: Tue Mar 11 08:39:11 2008
New Revision: 635978

URL: http://svn.apache.org/viewvc?rev=635978&view=rev
Log:
 HADOOP-2955. Fix TestCrcCorruption test failures caused by HADOOP-2758 (rangadi)

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

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=635978&r1=635977&r2=635978&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Mar 11 08:39:11 2008
@@ -170,6 +170,9 @@
     HADOOP-2971. select multiple times if it returns early in 
     SocketIOWithTimeout. (rangadi)
 
+    HADOOP-2955. Fix TestCrcCorruption test failures caused by HADOOP-2758
+    (rangadi)
+
 Release 0.16.1 - 2008-03-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DataNode.java?rev=635978&r1=635977&r2=635978&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DataNode.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DataNode.java Tue Mar 11 08:39:11 2008
@@ -1587,7 +1587,16 @@
               16 * 1024);
         }
 
+        /* If bytesPerChecksum is very large, then the metadata file
+         * is mostly corrupted. For now just truncate bytesPerchecksum to
+         * blockLength.
+         */        
         bytesPerChecksum = checksum.getBytesPerChecksum();
+        if (bytesPerChecksum > 10*1024*1024 && bytesPerChecksum > blockLength){
+          checksum = DataChecksum.newDataChecksum(checksum.getChecksumType(),
+                                     Math.max((int)blockLength, 10*1024*1024));
+          bytesPerChecksum = checksum.getBytesPerChecksum();        
+        }
         checksumSize = checksum.getChecksumSize();
 
         if (length < 0) {



Mime
View raw message