You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ha...@apache.org on 2008/10/22 00:25:10 UTC

svn commit: r706799 - in /hadoop/core/branches/branch-0.18: CHANGES.txt src/hdfs/org/apache/hadoop/dfs/DFSClient.java

Author: hairong
Date: Tue Oct 21 15:25:08 2008
New Revision: 706799

URL: http://svn.apache.org/viewvc?rev=706799&view=rev
Log:
Merge -r 706795:706796 from trunk to main to move the change log of HADOOP-3914.

Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=706799&r1=706798&r2=706799&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Tue Oct 21 15:25:08 2008
@@ -36,6 +36,9 @@
 
     HADOOP-4469. Rename and add the ant task jar file to the tar file. (nigel)
 
+    HADOOP-3914. DFSClient sends Checksum Ok only once for a block.
+    (Christain Kunz via hairong)
+
   NEW FEATURES
 
     HADOOP-2421.  Add jdiff output to documentation, listing all API

Modified: hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java?rev=706799&r1=706798&r2=706799&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java (original)
+++ hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java Tue Oct 21 15:25:08 2008
@@ -823,6 +823,7 @@
     private int bytesPerChecksum;
     private int checksumSize;
     private boolean gotEOS = false;
+    private boolean sentChecksumOk = false;
     
     byte[] skipBuf = null;
     ByteBuffer checksumBytes = null;
@@ -857,8 +858,15 @@
       
       int nRead = super.read(buf, off, len);
       if (nRead >= 0 && gotEOS && needChecksum()) {
-        //checksum is verified and there are no errors.
-        checksumOk(dnSock);
+        if (sentChecksumOk) {
+           // this should not happen; log the error for the debugging purpose
+           LOG.info(StringUtils.stringifyException(new IOException(
+             "Checksum ok was sent and should not be sent again")));  
+        } else {
+          //checksum is verified and there are no errors.
+          checksumOk(dnSock);
+          sentChecksumOk = true;
+       }
       }
       return nRead;
     }