{"record":{"id":"cefff799caf5c392","repo":"apache/pulsar","slug":"supported-namespace-bundle-split-algorithms-must-c","errorCode":null,"errorMessage":"Supported namespace bundle split algorithms must contains the default namespace bundle split algorithm","messagePattern":"Supported namespace bundle split algorithms must contains the default namespace bundle split algorithm","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java","lineNumber":191,"sourceCode":"                        .toAbsolutePath().normalize().toString();\n                brokerConfig = loadConfig(filepath);\n            }\n\n            int maxFrameSize = brokerConfig.getMaxMessageSize() + Commands.MESSAGE_SIZE_FRAME_PADDING;\n            if (maxFrameSize >= DirectMemoryUtils.jvmMaxDirectMemory()) {\n                throw new IllegalArgumentException(\"Max message size need smaller than jvm directMemory\");\n            }\n\n            if (!NamespaceBundleSplitAlgorithm.AVAILABLE_ALGORITHMS.containsAll(\n                    brokerConfig.getSupportedNamespaceBundleSplitAlgorithms())) {\n                throw new IllegalArgumentException(\n                        \"The given supported namespace bundle split algorithm has unavailable algorithm. \"\n                                + \"Available algorithms are \" + NamespaceBundleSplitAlgorithm.AVAILABLE_ALGORITHMS);\n            }\n\n            if (!brokerConfig.getSupportedNamespaceBundleSplitAlgorithms().contains(\n                    brokerConfig.getDefaultNamespaceBundleSplitAlgorithm())) {\n                throw new IllegalArgumentException(\"Supported namespace bundle split algorithms \"\n                        + \"must contains the default namespace bundle split algorithm\");\n            }\n\n            // init functions worker\n            if (starterArguments.runFunctionsWorker || brokerConfig.isFunctionsWorkerEnabled()) {\n                final String filepath = Path.of(starterArguments.fnWorkerConfigFile)\n                        .toAbsolutePath().normalize().toString();\n                workerConfig = PulsarService.initializeWorkerConfigFromBrokerConfig(brokerConfig, filepath);\n                functionsWorkerService = WorkerServiceLoader.load(workerConfig);\n            } else {\n                workerConfig = null;\n                functionsWorkerService = null;\n            }\n\n            // init pulsar service\n            pulsarService = new PulsarService(brokerConfig,\n                                              workerConfig,\n                                              Optional.ofNullable(functionsWorkerService),","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java#L173-L209","documentation":"After checking that all supported algorithms are valid, the broker requires defaultNamespaceBundleSplitAlgorithm to be a member of supportedNamespaceBundleSplitAlgorithms. If the default is not in the supported list, startup fails with this IllegalArgumentException.","triggerScenarios":"broker.conf sets supportedNamespaceBundleSplitAlgorithms without including the value of defaultNamespaceBundleSplitAlgorithm (or leaves default at a value not present in a custom supported list).","commonSituations":"Overriding the supported list (e.g. only topic_count_evenness_split) while defaultNamespaceBundleSplitAlgorithm stays at the default (specified_positions_split); partial config copy between clusters.","solutions":["Add the default algorithm to supportedNamespaceBundleSplitAlgorithms in broker.conf","Or change defaultNamespaceBundleSplitAlgorithm to one of the supported entries","Restart the broker after the config fix"],"exampleFix":"// before (broker.conf)\nsupportedNamespaceBundleSplitAlgorithms=topic_count_evenness_split\ndefaultNamespaceBundleSplitAlgorithm=specified_positions_split\n// after\nsupportedNamespaceBundleSplitAlgorithms=topic_count_evenness_split,specified_positions_split\ndefaultNamespaceBundleSplitAlgorithm=topic_count_evenness_split","handlingStrategy":"validation","validationCode":"String def = brokerConf.getDefaultNamespaceBundleSplitAlgorithm();\nSet<String> supported = Set.of(brokerConf.getSupportedNamespaceBundleSplitAlgorithms().split(\",\"));\nif (!supported.contains(def)) {\n    throw new IllegalStateException(\"defaultNamespaceBundleSplitAlgorithm \" + def\n        + \" must be in \" + supported);\n}","typeGuard":null,"tryCatchPattern":"try {\n    int rc = starter.call();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"must contains the default\")) {\n        throw new IllegalStateException(\"Add the default algorithm to supportedNamespaceBundleSplitAlgorithms\", e);\n    }\n    throw e;\n}","preventionTips":["Change supportedNamespaceBundleSplitAlgorithms and defaultNamespaceBundleSplitAlgorithm together","Add a config smoke test asserting default ∈ supported before deployment"],"tags":["configuration","startup","validation"],"backgroundTag":"invalid-config-enum-value","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}