Przeglądaj źródła

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.19@706798 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 16 lat temu
rodzic
commit
3f07fdd6df
2 zmienionych plików z 13 dodań i 2 usunięć
  1. 3 0
      CHANGES.txt
  2. 10 2
      src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

+ 3 - 0
CHANGES.txt

@@ -984,6 +984,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)
+ 
 Release 0.18.1 - 2008-09-17
 
   IMPROVEMENTS

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

@@ -1024,6 +1024,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
     private int bytesPerChecksum;
     private int checksumSize;
     private boolean gotEOS = false;
+    private boolean sentChecksumOk = false;
     
     byte[] skipBuf = null;
     ByteBuffer checksumBytes = null;
@@ -1058,8 +1059,15 @@ public class DFSClient implements FSConstants, java.io.Closeable {
       
       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;
     }