diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedBlockChecksumReconstructor.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedBlockChecksumReconstructor.java index 944ed9dfd3..9555618990 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedBlockChecksumReconstructor.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedBlockChecksumReconstructor.java @@ -132,6 +132,7 @@ private long checksumWithTargetOutput(byte[] outputData, int toReconstructLen, // case-2) length of data bytes which is less than bytesPerCRC if (partialLength > 0) { byte[] partialCrc = new byte[getChecksum().getChecksumSize()]; + getChecksum().reset(); getChecksum().update(outputData, dataOffset, partialLength); getChecksum().writeValue(partialCrc, 0, true); digester.update(partialCrc);