{"record":{"id":"df75fcc5378f4aef","repo":"apache/hadoop","slug":"unknown-blockchecksumtype-groupchecksumtype","errorCode":null,"errorMessage":"Unknown BlockChecksumType: \" + groupChecksumType","messagePattern":"Unknown BlockChecksumType: \" \\+ groupChecksumType","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockChecksumHelper.java","lineNumber":625,"sourceCode":"            getDatanode(), Op.BLOCK_CHECKSUM, block);\n\n        // get block checksum\n        // A BlockGroupCheckum of type COMPOSITE_CRC uses underlying\n        // BlockChecksums also of type COMPOSITE_CRC but with\n        // stripeLength == ecPolicy.getCellSize().\n        BlockChecksumOptions childOptions;\n        BlockChecksumType groupChecksumType =\n            getBlockChecksumOptions().getBlockChecksumType();\n        switch (groupChecksumType) {\n        case MD5CRC:\n          childOptions = getBlockChecksumOptions();\n          break;\n        case COMPOSITE_CRC:\n          childOptions = new BlockChecksumOptions(\n              BlockChecksumType.COMPOSITE_CRC, ecPolicy.getCellSize());\n          break;\n        default:\n          throw new IOException(\n              \"Unknown BlockChecksumType: \" + groupChecksumType);\n        }\n        createSender(pair).blockChecksum(block, blockToken, childOptions);\n\n        final DataTransferProtos.BlockOpResponseProto reply =\n            DataTransferProtos.BlockOpResponseProto.parseFrom(\n                PBHelperClient.vintPrefixed(pair.in));\n\n        String logInfo = \"for block \" + block\n            + \" from datanode \" + targetDatanode;\n        DataTransferProtoUtil.checkBlockOpStatus(reply, logInfo);\n\n        DataTransferProtos.OpBlockChecksumResponseProto checksumData =\n            reply.getChecksumResponse();\n\n        // read crc-type\n        final DataChecksum.Type ct;\n        if (checksumData.hasCrcType()) {","sourceCodeStart":607,"sourceCodeEnd":643,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockChecksumHelper.java#L607-L643","documentation":"While preparing per-internal-block child requests for an erasure-coded block-group checksum, the DataNode switches on the group checksum type to build child BlockChecksumOptions (MD5CRC passes the parent options through; COMPOSITE_CRC is rewritten with the EC cell size). Any other value hits the default and aborts before any peer request is sent.","triggerScenarios":"getBlockChecksum/fileChecksum on a striped (EC) block group whose requested BlockChecksumType is neither MD5CRC nor COMPOSITE_CRC — again typically an unknown enum ordinal from version skew or manual construction.","commonSituations":"Rolling upgrade with EC files in play, custom client builds, cross-branch testing.","solutions":["Use only MD5CRC or COMPOSITE_CRC for striped files until the whole cluster is on one version","Finish the rolling upgrade before any client requests composite CRCs on EC data","Check the client's checksum-type setting that feeds BlockChecksumOptions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"BlockChecksumType t = opts.getBlockChecksumType();\nif (t != BlockChecksumType.MD5CRC && t != BlockChecksumType.COMPOSITE_CRC) {\n  opts = new BlockChecksumOptions(BlockChecksumType.MD5CRC,\n      opts.getStripeLength());\n}","typeGuard":"static boolean isKnownBlockChecksumType(BlockChecksumType t) {\n  return t == BlockChecksumType.MD5CRC\n      || t == BlockChecksumType.COMPOSITE_CRC;\n}","tryCatchPattern":"catch (IOException e) {\n  if (String.valueOf(e.getMessage()).contains(\"Unknown BlockChecksumType\")) {\n    LOG.warn(\"DN lacks support for {}; retrying as MD5CRC\", requestedType);\n    return fetchAsMd5Crc();\n  }\n  throw e;\n}","preventionTips":["For striped files, request only MD5CRC or COMPOSITE_CRC and nothing custom","Complete rolling upgrades before exercising EC checksum paths"],"tags":["hdfs","datanode","erasure-coding","block-checksum","enum-switch"],"backgroundTag":"unhandled-enum-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}