Browse Source

Merge -r 706795:706796 from trunk to main to move the change log of HADOOP-3914.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.18@706799 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 17 years ago
parent
commit
b092b41e0a
2 changed files with 13 additions and 2 deletions
  1. 3 0
      CHANGES.txt
  2. 10 2
      src/hdfs/org/apache/hadoop/dfs/DFSClient.java

+ 3 - 0
CHANGES.txt

@@ -36,6 +36,9 @@ Release 0.18.2 - Unreleased
 
     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

+ 10 - 2
src/hdfs/org/apache/hadoop/dfs/DFSClient.java

@@ -823,6 +823,7 @@ class DFSClient implements FSConstants {
     private int bytesPerChecksum;
     private int checksumSize;
     private boolean gotEOS = false;
+    private boolean sentChecksumOk = false;
     
     byte[] skipBuf = null;
     ByteBuffer checksumBytes = null;
@@ -857,8 +858,15 @@ class DFSClient implements FSConstants {
       
       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;
     }