{"record":{"id":"52fb24e22872dafb","repo":"apache/hadoop","slug":"cell-size-policy-getcellsize-should-not","errorCode":null,"errorMessage":"\"Cell size \" + policy.getCellSize() + \" should not exceed maximum \" + maxCellSize + \" bytes\"","messagePattern":"\"Cell size \" \\+ policy\\.getCellSize\\(\\) \\+ \" should not exceed maximum \" \\+ maxCellSize \\+ \" bytes\"","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":315,"sourceCode":"      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()) &&\n          p.getCellSize() == policy.getCellSize()) {\n        LOG.info(\"A policy with same schema \"\n            + policy.getSchema().toString() + \" and cell size \"\n            + p.getCellSize() + \" already exists\");\n        return p;","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java#L297-L333","documentation":"Error \"\"Cell size \" + policy.getCellSize() + \" should not exceed maximum \" + maxCellSize + \" bytes\"\" thrown in apache/hadoop.","triggerScenarios":"Adding a custom erasure coding policy whose cell size is larger than the configured maximum cell size (dfs.namenode.ec.policies.max.cellsize).","commonSituations":"See trigger scenarios.","solutions":["Use a cellSize no larger than the configured maximum (dfs.namenode.ec.policies.max.cellsize).","Pick one of the predefined system EC policies whose cell size is within the limit."],"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"}