apache/hadoop · error · IOException
Client requested checksum ${requestedChecksum} when appendin
Error message
Client requested checksum ${requestedChecksum} when appending to an existing block with different chunk size: ${checksum} What it means
Error "Client requested checksum ${requestedChecksum} when appending to an existing block with different chunk size: ${checksum}" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java:321
// the checksum that should actually be used -- this
// may differ from requestedChecksum for appends.
final DataChecksum checksum;
final RandomAccessFile metaRAF =
getFileIoProvider().getRandomAccessFile(getVolume(), metaFile, "rw");
if (!isCreate) {
// For append or recovery, we must enforce the existing checksum.
// Also, verify that the file has correct lengths, etc.
boolean checkedMeta = false;
try {
BlockMetadataHeader header =
BlockMetadataHeader.readHeader(metaRAF);
checksum = header.getChecksum();
if (checksum.getBytesPerChecksum() !=
requestedChecksum.getBytesPerChecksum()) {
throw new IOException("Client requested checksum " +
requestedChecksum + " when appending to an existing block " +
"with different chunk size: " + checksum);
}
int bytesPerChunk = checksum.getBytesPerChecksum();
int checksumSize = checksum.getChecksumSize();
blockDiskSize = bytesOnDisk;
crcDiskSize = BlockMetadataHeader.getHeaderSize() +
(blockDiskSize+bytesPerChunk-1)/bytesPerChunk*checksumSize;
if (blockDiskSize > 0 &&
(blockDiskSize > blockFile.length() ||
crcDiskSize>metaFile.length())) {
throw new IOException("Corrupted block: " + this);
}
checkedMeta = true;
} finally {
if (!checkedMeta) {View on GitHub (pinned to 2add963021)
Solutions
- Configure the client with the same bytes-per-checksum as the existing block (or recreate the file with the desired checksum chunk size).
- Ensure dfs.bytes-per-checksum / dfs.checksum.type are consistent across clients writing to the same file.
When it happens
Trigger: A client appends to an existing block requesting a checksum configuration whose chunk size differs from the block's recorded checksum.
Common situations: An append request specified a chunk/checksum size different from the existing block's. Recreate the file with the intended checksum configuration instead of appending.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/c173f87b2e62847c.
Report an issue: GitHub.