Author: hairong
Date: Tue Oct 21 15:12:57 2008
New Revision: 706796
URL: http://svn.apache.org/viewvc?rev=706796&view=rev
Log:
HADOOP-3914. DFSClient sends Checksum Ok only once for a block. Contributed by
Chritian Kunz and Hairong Kuang.
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=706796&r1=706795&r2=706796&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Oct 21 15:12:57 2008
@@ -1046,6 +1046,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)
+
Release 0.18.1 - 2008-09-17
IMPROVEMENTS
Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java?rev=706796&r1=706795&r2=706796&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java Tue Oct 21
15:12:57 2008
@@ -1024,6 +1024,7 @@
private int bytesPerChecksum;
private int checksumSize;
private boolean gotEOS = false;
+ private boolean sentChecksumOk = false;
byte[] skipBuf = null;
ByteBuffer checksumBytes = null;
@@ -1058,8 +1059,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;
}