{"record":{"id":"72f7423957311578","repo":"apache/cassandra","slug":"memtable-cleanup-threshold-must-be-0-01-but-wa","errorCode":null,"errorMessage":"memtable_cleanup_threshold must be >= 0.01, but was ${conf.memtable_cleanup_threshold}","messagePattern":"memtable_cleanup_threshold must be >= 0\\.01, but was (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":956,"sourceCode":"        if (conf.memtable_flush_writers == 0)\n        {\n            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","sourceCodeStart":938,"sourceCodeEnd":974,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L938-L974","documentation":"Cassandra requires memtable_cleanup_threshold to be at least 0.01. During startup DatabaseDescriptor.applySimpleConfig validates the value loaded from cassandra.yaml and throws ConfigurationException if it falls below this lower bound, because a threshold this small would trigger memtable cleanup far too aggressively and destabilize the node.","triggerScenarios":"Node startup (DatabaseDescriptor.toolInitialization / applyAll -> applySimpleConfig) with cassandra.yaml containing memtable_cleanup_threshold: 0.0, a negative value, or any value < 0.01.","commonSituations":"Hand-edited cassandra.yaml with a typo or mis-scaled value (e.g. 0 instead of 0.1); automated config templating that substitutes an unset variable producing 0; copying config from an old cluster with a bad value.","solutions":["Edit cassandra.yaml and set memtable_cleanup_threshold to a value in [0.01, 0.99] (typically 0.1 or leave it unset to accept defaults)","Remove the memtable_cleanup_threshold key entirely — it is deprecated and the default is used","If the value is templated, fix the template/default so it emits a valid float >= 0.01","Restart the node after correcting the config"],"exampleFix":"// before (cassandra.yaml)\nmemtable_cleanup_threshold: 0\n// after\ndelete the line, or:\nmemtable_cleanup_threshold: 0.1","handlingStrategy":"validation","validationCode":"// Pre-startup config check\nif (conf.memtable_cleanup_threshold < 0.01f || conf.memtable_cleanup_threshold > 0.99f)\n    throw new IllegalArgumentException(\"memtable_cleanup_threshold must be in [0.01, 0.99]: \" + conf.memtable_cleanup_threshold);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); }\ncatch (ConfigurationException e) { LOG.fatal(\"Bad cassandra.yaml: \" + e.getMessage()); System.exit(1); }","preventionTips":["Omit the deprecated memtable_cleanup_threshold key entirely","Validate cassandra.yaml with a linter or nodetool/StartupChecks before rolling out","Keep fraction (not percentage) values in config templates"],"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"}