{"record":{"id":"7eab3fc5ec8a6054","repo":"apache/cassandra","slug":"unrecognized-fast-path-options-provided","errorCode":null,"errorMessage":"Unrecognized fast path options provided: ","messagePattern":"Unrecognized fast path options provided: ","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/topology/ParameterizedFastPathStrategy.java","lineNumber":300,"sourceCode":"                {\n                    if (hasAuto) throw cfe(\"Cannot mix auto and manual DC weights\");\n                    hasManual = true;\n                }\n\n                mutableDcs.put(dc.name, dc);\n            }\n            dcMap = ImmutableMap.copyOf(mutableDcs);\n        }\n        else\n        {\n            dcMap = ImmutableMap.of();\n        }\n\n        Set<String> keys = new HashSet<>(map.keySet());\n        keys.remove(SIZE);\n        keys.remove(DCS);\n        if (!keys.isEmpty())\n            throw cfe(\"Unrecognized fast path options provided: \", keys);\n\n        return new ParameterizedFastPathStrategy(size, dcMap);\n    }\n\n    @Override\n    public Kind kind()\n    {\n        return Kind.PARAMETERIZED;\n    }\n\n    @VisibleForImplementation\n    public Iterable<String> dcStrings()\n    {\n        return dcs.values().stream().sorted().map(Object::toString).collect(Collectors.toList());\n    }\n\n    @Override\n    public String toString()","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/topology/ParameterizedFastPathStrategy.java#L282-L318","documentation":"After extracting the recognized options ('size' and 'dcs'), fromMap() checks whether any keys remain in the input map. Any leftover key means an unknown/misspelled option was supplied, and a ConfigurationException listing the unrecognized keys is thrown. This strictness prevents silently ignoring typos in strategy configuration.","triggerScenarios":"Calling fromMap() with a map containing keys other than 'size' and 'dcs', e.g. {\"sizes\": \"10\"}, {\"dc\": \"dc1\"}, or arbitrary extra options.","commonSituations":"Typos in option names ('sizes', 'dcs ' with trailing space); reusing option maps built for a different Accord strategy kind; older/newer option names across version changes.","solutions":["Remove the unrecognized keys; only 'size' and 'dcs' are accepted","Fix typos in option names (check the exact spelling of 'size' and 'dcs')","Check the error message's key list to identify exactly which keys to drop or rename"],"exampleFix":"// before\nMap<String,String> opts = Map.of(\"size\", \"10\", \"dc\", \"dc1\");\nParameterizedFastPathStrategy.fromMap(opts); // throws: unrecognized \"dc\"\n// after\nMap<String,String> opts = Map.of(\"size\", \"10\", \"dcs\", \"dc1\");\nParameterizedFastPathStrategy.fromMap(opts); // ok","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"size\", \"dcs\");\nSet<String> unknown = new HashSet<>(map.keySet());\nunknown.removeAll(allowed);\nif (!unknown.isEmpty())\n    throw new IllegalArgumentException(\"unknown fast-path options: \" + unknown);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build option maps from a shared whitelist constant, not string literals scattered in code","Compare against per-strategy allowed keys when reusing maps between strategies"],"tags":["configuration","validation","accord"],"backgroundTag":"unsupported-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}