{"record":{"id":"64133cbfcdd1837a","repo":"apache/cassandra","slug":"memtable-cleanup-threshold-must-be-0-99-but-wa","errorCode":null,"errorMessage":"memtable_cleanup_threshold must be <= 0.99, but was ${conf.memtable_cleanup_threshold}","messagePattern":"memtable_cleanup_threshold must be <= 0\\.99, but was (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":958,"sourceCode":"            conf.memtable_flush_writers = conf.data_file_directories.length == 1 ? 2 : 1;\n        }\n\n        if (conf.memtable_flush_writers < 1)\n            throw new ConfigurationException(\"memtable_flush_writers must be at least 1, but was \" + conf.memtable_flush_writers, false);\n\n        if (conf.memtable_cleanup_threshold == null)\n        {\n            conf.memtable_cleanup_threshold = (float) (1.0 / (1 + conf.memtable_flush_writers));\n        }\n        else\n        {\n            logger.warn(\"memtable_cleanup_threshold has been deprecated and should be removed from cassandra.yaml\");\n        }\n\n        if (conf.memtable_cleanup_threshold < 0.01f)\n            throw new ConfigurationException(\"memtable_cleanup_threshold must be >= 0.01, but was \" + conf.memtable_cleanup_threshold, false);\n        if (conf.memtable_cleanup_threshold > 0.99f)\n            throw new ConfigurationException(\"memtable_cleanup_threshold must be <= 0.99, but was \" + conf.memtable_cleanup_threshold, false);\n        if (conf.memtable_cleanup_threshold < 0.1f)\n            logger.warn(\"memtable_cleanup_threshold is set very low [{}], which may cause performance degradation\", conf.memtable_cleanup_threshold);\n\n        if (conf.concurrent_compactors == null)\n            conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));\n\n        if (conf.concurrent_compactors <= 0)\n            throw new ConfigurationException(\"concurrent_compactors should be strictly greater than 0, but was \" + conf.concurrent_compactors, false);\n\n        applyConcurrentValidations(conf);\n        applyRepairCommandPoolSize(conf);\n        applyThresholdsValidations(conf);\n\n        if (conf.concurrent_materialized_view_builders <= 0)\n            throw new ConfigurationException(\"concurrent_materialized_view_builders should be strictly greater than 0, but was \" + conf.concurrent_materialized_view_builders, false);\n\n        if (conf.num_tokens != null && conf.num_tokens > MAX_NUM_TOKENS)\n            throw new ConfigurationException(String.format(\"A maximum number of %d tokens per node is supported\", MAX_NUM_TOKENS), false);","sourceCodeStart":940,"sourceCodeEnd":976,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L940-L976","documentation":"memtable_cleanup_threshold is also capped at 0.99. applySimpleConfig throws ConfigurationException when the configured value exceeds this upper bound, since a threshold that high means memtable cleanup would essentially never run.","triggerScenarios":"Node startup with cassandra.yaml specifying memtable_cleanup_threshold > 0.99 (e.g. 1.0, 1, or 100 if someone confuses fraction with percentage).","commonSituations":"Writing the value as a percentage (e.g. 100 meaning 100%) instead of a fraction (0.99); setting 1 intending 'always'; copy-paste from an invalid example config.","solutions":["Edit cassandra.yaml and set memtable_cleanup_threshold to a fraction <= 0.99 (e.g. 0.3, or 0.5)","Remove the deprecated memtable_cleanup_threshold line entirely to use defaults","If using a percentage-style value, divide by 100","Restart the node"],"exampleFix":"// before (cassandra.yaml)\nmemtable_cleanup_threshold: 100\n// after\nmemtable_cleanup_threshold: 0.3","handlingStrategy":"validation","validationCode":"if (conf.memtable_cleanup_threshold > 0.99f)\n    throw new IllegalArgumentException(\"memtable_cleanup_threshold must be <= 0.99: \" + conf.memtable_cleanup_threshold);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); }\ncatch (ConfigurationException e) { LOG.fatal(e.getMessage()); System.exit(1); }","preventionTips":["Express thresholds as fractions in [0, 1), never percentages","Remove the deprecated key so defaults apply","Peer-review config changes before restart"],"tags":["cassandra","configuration","startup"],"backgroundTag":"invalid-config-value","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"}