{"record":{"id":"c173f87b2e62847c","repo":"apache/hadoop","slug":"client-requested-checksum-requestedchecksum-whe","errorCode":null,"errorMessage":"Client requested checksum ${requestedChecksum} when appending to an existing block with different chunk size: ${checksum}","messagePattern":"Client requested checksum (.+?) when appending to an existing block with different chunk size: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java","lineNumber":321,"sourceCode":"    // the checksum that should actually be used -- this\n    // may differ from requestedChecksum for appends.\n    final DataChecksum checksum;\n\n    final RandomAccessFile metaRAF =\n        getFileIoProvider().getRandomAccessFile(getVolume(), metaFile, \"rw\");\n\n    if (!isCreate) {\n      // For append or recovery, we must enforce the existing checksum.\n      // Also, verify that the file has correct lengths, etc.\n      boolean checkedMeta = false;\n      try {\n        BlockMetadataHeader header =\n            BlockMetadataHeader.readHeader(metaRAF);\n        checksum = header.getChecksum();\n\n        if (checksum.getBytesPerChecksum() !=\n            requestedChecksum.getBytesPerChecksum()) {\n          throw new IOException(\"Client requested checksum \" +\n              requestedChecksum + \" when appending to an existing block \" +\n              \"with different chunk size: \" + checksum);\n        }\n\n        int bytesPerChunk = checksum.getBytesPerChecksum();\n        int checksumSize = checksum.getChecksumSize();\n\n        blockDiskSize = bytesOnDisk;\n        crcDiskSize = BlockMetadataHeader.getHeaderSize() +\n          (blockDiskSize+bytesPerChunk-1)/bytesPerChunk*checksumSize;\n        if (blockDiskSize > 0 &&\n            (blockDiskSize > blockFile.length() ||\n               crcDiskSize>metaFile.length())) {\n          throw new IOException(\"Corrupted block: \" + this);\n        }\n        checkedMeta = true;\n      } finally {\n        if (!checkedMeta) {","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L303-L339","documentation":"Error \"Client requested checksum ${requestedChecksum} when appending to an existing block with different chunk size: ${checksum}\" thrown in apache/hadoop.","triggerScenarios":"A client appends to an existing block requesting a checksum configuration whose chunk size differs from the block's recorded checksum.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}