{"record":{"id":"8fc4db886ba300b3","repo":"nathanmarz/storm","slug":"parallelism-is-fixed-to-fixedp-but-max-parallelism-is-less","errorCode":null,"errorMessage":"Parallelism is fixed to ${fixedP} but max parallelism is less than that: ${maxP}","messagePattern":"Parallelism is fixed to (.+?) but max parallelism is less than that: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/storm/trident/TridentTopology.java","lineNumber":599,"sourceCode":"        for(Group g: groups) {\n            for(PartitionNode n: externalGroupInputs(g)) {\n                if(isIdentityPartition(n)) {\n                    Node parent = TridentUtils.getParent(graph, n);\n                    Group parentGroup = grouper.nodeGroup(parent);\n                    if(parentGroup!=null && !parentGroup.equals(g)) {\n                        equivs.addEdge(parentGroup, g);\n                    }\n                }\n            }            \n        }\n        \n        Map<Group, Integer> ret = new HashMap();\n        List<Set<Group>> equivGroups = new ConnectivityInspector<Group, Object>(equivs).connectedSets();\n        for(Set<Group> equivGroup: equivGroups) {\n            Integer fixedP = getFixedParallelism(equivGroup);\n            Integer maxP = getMaxParallelism(equivGroup);\n            if(fixedP!=null && maxP!=null && maxP < fixedP) {\n                throw new RuntimeException(\"Parallelism is fixed to \" + fixedP + \" but max parallelism is less than that: \" + maxP);\n            }\n            \n            \n            Integer p = 1;\n            for(Group g: equivGroup) {\n                for(Node n: g.nodes) {\n                    if(n.parallelismHint!=null) {\n                        p = Math.max(p, n.parallelismHint);\n                    }\n                }\n            }\n            if(maxP!=null) p = Math.min(maxP, p);\n            \n            if(fixedP!=null) p = fixedP;\n            for(Group g: equivGroup) {\n                ret.put(g, p);\n            }\n        }","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/storm/trident/TridentTopology.java#L581-L617","documentation":"When Trident groups nodes with equivalent parallelism (computeSourcedGroups/equiv groups), each group must have a satisfiable parallelism. If a group's parallelism is pinned by a state's requiredNumPartitions (fixedP) and some node also declares a max parallelism hint (maxP) smaller than that fixed value, no valid parallelism exists and build throws this RuntimeException.","triggerScenarios":"A topology where one equivalent-parallelism group contains a state spec requiring N partitions (e.g. memoryMapState/redis state with requiredNumPartitions=N) while another node in the same group has parallelismHint(max) with max < N.","commonSituations":"Adding parallelismHint to nodes connected to persistentAggregate state whose backing store fixes partition count; changing state backend requiredNumPartitions without updating parallelism hints; merging streams so previously separate groups become one equivalence group.","solutions":["Raise the max parallelism hint so it is >= the state's requiredNumPartitions","Lower or remove the state's requiredNumPartitions constraint","Remove the conflicting parallelismHint so the group takes the fixed parallelism","Refactor topology so the state-anchored nodes are not in the same equivalence group"],"exampleFix":"// before\nstate.newValuesStream().parallelismHint(2); // state requires 4 partitions\n// after\nstate.newValuesStream().parallelismHint(4); // max >= fixed required partitions","handlingStrategy":"validation","validationCode":"// ensure max hint >= state requiredNumPartitions before build\nif (fixedP != null && hint != null && hint < fixedP) {\n    throw new IllegalArgumentException(\"parallelismHint must be >= state requiredNumPartitions \" + fixedP);\n}","typeGuard":null,"tryCatchPattern":"try {\n    topology.build();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"but max parallelism is less than that\")) {\n        throw new IllegalStateException(\"Raise parallelismHint to at least the state's requiredNumPartitions\", e);\n    } throw e;\n}","preventionTips":["Match parallelismHints to each state backend's requiredNumPartitions","Call topology.build() in unit tests to validate parallelism constraints early","Document fixed parallelism sources (state specs) near their parallelismHints"],"tags":["storm","trident","parallelism","topology"],"backgroundTag":"conflicting-config-options","analyzedSha":"cdb116e942666973bc4eaa0df098d5bab82739e7","analyzedAt":"2026-09-12T14:30:00.714Z","contentChangedAt":"2026-09-12T14:30:00.714Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}