{"record":{"id":"4baf4e95c50678df","repo":"apache/cassandra","slug":"minimum-replication-factor-fail-threshold-to-be-se","errorCode":null,"errorMessage":"minimum_replication_factor_fail_threshold to be set (%d) cannot be greater than default_keyspace_rf (%d)","messagePattern":"minimum_replication_factor_fail_threshold to be set \\((.+?)\\) cannot be greater than default_keyspace_rf \\((.+?)\\)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/GuardrailsOptions.java","lineNumber":1542,"sourceCode":"    {\n        validatePositiveNumeric(warn, Long.MAX_VALUE, name + \"_warn_threshold\");\n        validatePositiveNumeric(fail, Long.MAX_VALUE, name + \"_fail_threshold\");\n        validateWarnLowerThanFail(warn, fail, name);\n    }\n\n    private static void validateMinIntThreshold(int warn, int fail, String name)\n    {\n        validatePositiveNumeric(warn, Integer.MAX_VALUE, name + \"_warn_threshold\");\n        validatePositiveNumeric(fail, Integer.MAX_VALUE, name + \"_fail_threshold\");\n        validateWarnGreaterThanFail(warn, fail, name);\n    }\n\n    private static void validateMinRFThreshold(int warn, int fail)\n    {\n        validateMinIntThreshold(warn, fail, \"minimum_replication_factor\");\n\n        if (fail > DatabaseDescriptor.getDefaultKeyspaceRF())\n            throw new IllegalArgumentException(format(\"minimum_replication_factor_fail_threshold to be set (%d) \" +\n                                                      \"cannot be greater than default_keyspace_rf (%d)\",\n                                                      fail, DatabaseDescriptor.getDefaultKeyspaceRF()));\n    }\n\n    private static void validateMaxRFThreshold(int warn, int fail)\n    {\n        validateMaxIntThreshold(warn, fail, \"maximum_replication_factor\");\n\n        if (fail != -1 && fail < DatabaseDescriptor.getDefaultKeyspaceRF())\n            throw new IllegalArgumentException(format(\"maximum_replication_factor_fail_threshold to be set (%d) \" +\n                                                      \"cannot be lesser than default_keyspace_rf (%d)\",\n                                                      fail, DatabaseDescriptor.getDefaultKeyspaceRF()));\n    }\n\n    private static void validateMinCmsSizeThreshold(int value, String name)\n    {\n        if (value == -1)\n            return;","sourceCodeStart":1524,"sourceCodeEnd":1560,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/GuardrailsOptions.java#L1524-L1560","documentation":"The minimum_replication_factor guardrail's fail threshold must not exceed the cluster's default_keyspace_rf (DatabaseDescriptor.getDefaultKeyspaceRF()). A fail threshold above the default RF would mark every default-keyspace operation as failing immediately, so GuardrailsOptions.validateMinRFThreshold() throws IllegalArgumentException during config validation.","triggerScenarios":"Setting minimum_replication_factor_fail_threshold (e.g. minimum_replication_factor_fail_threshold: 5) while default_keyspace_rf is lower (e.g. 3) in cassandra.yaml, or applying such a pair via live guardrail update on startup validation.","commonSituations":"Operators raising the min-RF fail guardrail after reducing default_keyspace_rf, or raising default_keyspace_rf expectations without aligning the two; clusters migrating from SimpleStrategy defaults (RF=1 or 3) where the guardrail was tuned for another topology.","solutions":["Lower minimum_replication_factor_fail_threshold to a value <= default_keyspace_rf (or set it to -1 to disable).","Raise default_keyspace_rf in cassandra.yaml if the higher fail threshold is the intended policy.","Also keep minimum_replication_factor_warn_threshold >= fail threshold (MinInt threshold semantics) to clear the preceding validation."],"exampleFix":"// before\ndefault_keyspace_rf: 3\nminimum_replication_factor_warn_threshold: 4\nminimum_replication_factor_fail_threshold: 5\n// after\nminimum_replication_factor_fail_threshold: 3","handlingStrategy":"validation","validationCode":"int fail = cfg.minimum_replication_factor_fail_threshold;\nint defaultRF = DatabaseDescriptor.getDefaultKeyspaceRF();\nif (fail != -1 && fail > defaultRF) throw new IllegalArgumentException(\"min RF fail threshold \" + fail + \" > default_keyspace_rf \" + defaultRF);","typeGuard":null,"tryCatchPattern":"try { validateGuardrailRf(cfg); } catch (IllegalArgumentException e) { log.error(\"minimum_replication_factor guardrail misconfigured: {}\", e.getMessage()); throw e; }","preventionTips":["Always review minimum_replication_factor and default_keyspace_rf together when editing cassandra.yaml.","For min-style guardrails warn >= fail; check both orderings in your config linter.","Use -1 to disable rather than extreme values."],"tags":["config","guardrails","replication-factor","cassandra"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}