{"record":{"id":"fbb7c7e19fd330f0","repo":"apache/hadoop","slug":"number-of-data-and-parity-blocks-in-an-ec-group","errorCode":null,"errorMessage":"\"Number of data and parity blocks in an EC group \" + blocksInGroup + \" should not exceed maximum \" + HdfsServerConstants.MAX_BLOCKS_IN_GROUP","messagePattern":"\"Number of data and parity blocks in an EC group \" \\+ blocksInGroup \\+ \" should not exceed maximum \" \\+ HdfsServerConstants\\.MAX_BLOCKS_IN_GROUP","errorType":"exception","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java","lineNumber":310,"sourceCode":"  /**\n   * Add an erasure coding policy.\n   * @return the added policy\n   */\n  public synchronized ErasureCodingPolicy addPolicy(\n      ErasureCodingPolicy policy) {\n    if (!userDefinedAllowed) {\n      throw new HadoopIllegalArgumentException(\n          \"Addition of user defined erasure coding policy is disabled.\");\n    }\n\n    if (!CodecUtil.hasCodec(policy.getCodecName())) {\n      throw new HadoopIllegalArgumentException(\"Codec name \"\n          + policy.getCodecName() + \" is not supported\");\n    }\n\n    int blocksInGroup = policy.getNumDataUnits() + policy.getNumParityUnits();\n    if (blocksInGroup > HdfsServerConstants.MAX_BLOCKS_IN_GROUP) {\n      throw new HadoopIllegalArgumentException(\"Number of data and parity blocks in an EC group \" +\n          blocksInGroup + \" should not exceed maximum \" + HdfsServerConstants.MAX_BLOCKS_IN_GROUP);\n    }\n\n    if (policy.getCellSize() > maxCellSize) {\n      throw new HadoopIllegalArgumentException(\"Cell size \" +\n          policy.getCellSize() + \" should not exceed maximum \" +\n          maxCellSize + \" bytes\");\n    }\n\n    String assignedNewName = ErasureCodingPolicy.composePolicyName(\n        policy.getSchema(), policy.getCellSize());\n    for (ErasureCodingPolicyInfo info : getPolicies()) {\n      final ErasureCodingPolicy p = info.getPolicy();\n      if (p.getName().equals(assignedNewName)) {\n        LOG.info(\"The policy name \" + assignedNewName + \" already exists\");\n        return p;\n      }\n      if (p.getSchema().equals(policy.getSchema()) &&","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java#L292-L328","documentation":"Error \"\"Number of data and parity blocks in an EC group \" + blocksInGroup + \" should not exceed maximum \" + HdfsServerConstants.MAX_BLOCKS_IN_GROUP\" thrown in apache/hadoop.","triggerScenarios":"Adding a custom erasure coding policy whose total number of data plus parity blocks exceeds HdfsServerConstants.MAX_BLOCKS_IN_GROUP.","commonSituations":"See trigger scenarios.","solutions":["Choose an EC schema whose data+parity block count does not exceed HdfsServerConstants.MAX_BLOCKS_IN_GROUP.","Reduce the number of data or parity blocks in the policy being added."],"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"}