{"record":{"id":"b49b487232558285","repo":"apache/cassandra","slug":"provided-values-s-are-not-recommended-for-s-war","errorCode":null,"errorMessage":"Provided values %s are not recommended for %s (warned values are: %s)","messagePattern":"Provided values (.+?) are not recommended for (.+?) \\(warned values are: (.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/guardrails/Values.java","lineNumber":127,"sourceCode":"        Set<T> disallowed = disallowedValues.apply(state);\n        Set<T> toDisallow = Sets.intersection(values, disallowed);\n        if (!toDisallow.isEmpty())\n            fail(format(\"Provided values %s are not allowed for %s (disallowed values are: %s)\",\n                        toDisallow.stream().sorted().collect(Collectors.toList()), what, disallowed), state);\n\n        Set<T> ignored = ignoredValues.apply(state);\n        Set<T> toIgnore = Sets.intersection(values, ignored);\n        if (!toIgnore.isEmpty())\n        {\n            warn(format(\"Ignoring provided values %s as they are not supported for %s (ignored values are: %s)\",\n                        toIgnore.stream().sorted().collect(Collectors.toList()), what, ignored));\n            toIgnore.forEach(ignoreAction);\n        }\n\n        Set<T> warned = warnedValues.apply(state);\n        Set<T> toWarn = Sets.intersection(values, warned);\n        if (!toWarn.isEmpty())\n            warn(format(\"Provided values %s are not recommended for %s (warned values are: %s)\",\n                        toWarn.stream().sorted().collect(Collectors.toList()), what, warned));\n    }\n}\n","sourceCodeStart":109,"sourceCodeEnd":131,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/guardrails/Values.java#L109-L131","documentation":"Values.guard intersects the provided values with the guardrail's 'warned' set. When any provided value falls in the warned set, this warning is emitted but the operation proceeds. It signals 'not recommended' usage without blocking it.","triggerScenarios":"An operation supplies values configured in the guardrail's warned list (e.g. discouraged replication strategies, table options, feature settings) for the guardrail's 'what' category; also exercised by test harnesses (testValuesWarned).","commonSituations":"Clusters using settings flagged discouraged after an upgrade; schema copied from reference clusters using non-recommended options; capacity planners flagging dangerous defaults.","solutions":["Replace the warned values with recommended alternatives.","If usage is intentional, acknowledge the warning or tune the guardrail's warned threshold in cassandra.yaml.","Escalate the guardrail to 'failed' in configuration if the values must never be used."],"exampleFix":"// before\nCREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};\n// after (multi-DC cluster)\nCREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': 3};","handlingStrategy":"validation","validationCode":"Set<String> provided = parseOptions(statement);\nSet<String> warned = guardrailsConfig.warnedValuesFor(what);\nif (!Collections.disjoint(provided, warned)) {\n    logger.warn(\"Non-recommended options in use: {}\", Sets.intersection(provided, warned));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Follow version-specific best-practice option lists.","Run guardrail checks in CI schema tests.","Re-audit warned configurations after upgrades."],"tags":["guardrails","best-practice","configuration"],"backgroundTag":"deprecated-api-usage","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"}