{"record":{"id":"ab1435bb6292a427","repo":"apache/hadoop","slug":"corrupted-block-this","errorCode":null,"errorMessage":"Corrupted block: ${this}","messagePattern":"Corrupted block: (.+?)","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":335,"sourceCode":"        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) {\n          // clean up in case of exceptions.\n          IOUtils.closeStream(metaRAF);\n        }\n      }\n    } else {\n      // for create, we can use the requested checksum\n      checksum = requestedChecksum;\n    }\n\n    final FileIoProvider fileIoProvider = getFileIoProvider();\n    FileOutputStream blockOut = null;\n    FileOutputStream crcOut = null;\n    try {\n      blockOut = fileIoProvider.getFileOutputStream(","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L317-L353","documentation":"Error \"Corrupted block: ${this}\" thrown in apache/hadoop.","triggerScenarios":"A CRC check on the replica's data or metadata fails while the replica is in the pipeline, marking it corrupt.","commonSituations":"The replica being written failed validation and was marked corrupt. Check disk health and the client pipeline for the corruption source.","solutions":["Report the block as corrupt (the DataNode normally does this automatically) so the NameNode re-replicates from a good replica.","Check disk/memory health on this DataNode to find the corruption source."],"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"}