{"record":{"id":"6b5aa3aa2f54542c","repo":"apache/cassandra","slug":"featurename-is-not-recommended","errorCode":null,"errorMessage":"{featureName} is not recommended","messagePattern":"(.+?) is not recommended","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/guardrails/EnableFlag.java","lineNumber":132,"sourceCode":"     * @param state       The client state, used to skip the check if the query is internal or is done by a superuser. A\n     *                    {@code null} value means that the check should be done regardless of the query, although it\n     *                    won't throw any exception if the failure threshold is exceeded. This is so because checks\n     *                    without an associated client come from asynchronous processes such as compaction, and we don't\n     *                    want to interrupt such processes.\n     */\n    public void ensureEnabled(String featureName, @Nullable ClientState state)\n    {\n        if (!enabled(state))\n            return;\n\n        if (!enabled.test(state))\n        {\n            fail(featureName + \" is not allowed\", state);\n            return;\n        }\n\n        if (warned.test(state))\n            warn(featureName + \" is not recommended\");\n    }\n}\n","sourceCodeStart":114,"sourceCodeEnd":135,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/guardrails/EnableFlag.java#L114-L135","documentation":"EnableFlag.ensureEnabled evaluates a guardrail-protected feature (featureName) against the client state. When the feature is explicitly disallowed the client gets a failure; when it merely crosses the 'warned' threshold, this warning is raised and the operation continues. It is a recommendation signal, not a hard failure.","triggerScenarios":"A client operation (e.g. enabling a risky feature such asConsistentReplacement or user-defined functions) is issued while the guardrail's warned flag configuration matches the cluster/client state, after the not-allowed check passed.","commonSituations":"Operators enabling features flagged as discouraged in a production cluster; upgraded clusters inheriting default warn thresholds for features now considered unsafe.","solutions":["Review the feature's documentation and decide whether to proceed despite the recommendation.","Adjust the guardrail's warned threshold in cassandra.yaml if the feature is acceptable in your environment.","Set the guardrail's enabled/allowed flag explicitly if you want the operation blocked or silenced."],"exampleFix":"// before (cassandra.yaml)\nfull_query_logging_warn_threshold: 10\n// after — warn earlier or raise threshold deliberately\nfull_query_logging_warn_threshold: 100","handlingStrategy":"validation","validationCode":"// Before enabling a feature, check the guardrail state\nif (Guardrails.instance.isEnabled(EnableFlag.FEATURE_NAME)) {\n    logger.info(\"Feature {} is allowed\", FEATURE_NAME);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Review guardrail warn thresholds after every Cassandra upgrade.","Document in runbooks which features are flagged 'not recommended'.","Monitor guardrail warn counters in metrics."],"tags":["guardrails","feature-flag","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"}