{"record":{"id":"346679fbb80f5e93","repo":"apache/cassandra","slug":"max-space-usable-for-compactions-in-percentage-mus","errorCode":null,"errorMessage":"max_space_usable_for_compactions_in_percentage must be between 0 and 1","messagePattern":"max_space_usable_for_compactions_in_percentage must be between 0 and 1","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1245,"sourceCode":"        validateMaxConcurrentAutoUpgradeTasksConf(conf.max_concurrent_automatic_sstable_upgrades);\n\n        if (conf.default_keyspace_rf < conf.minimum_replication_factor_fail_threshold)\n        {\n            throw new ConfigurationException(String.format(\"default_keyspace_rf (%d) cannot be less than minimum_replication_factor_fail_threshold (%d)\",\n                                                           conf.default_keyspace_rf, conf.minimum_replication_factor_fail_threshold));\n        }\n\n        if (conf.paxos_repair_parallelism <= 0)\n            conf.paxos_repair_parallelism = Math.max(1, conf.concurrent_writes / 8);\n\n        Paxos.setPaxosVariant(conf.paxos_variant);\n        if (conf.paxos_state_purging == null)\n            conf.paxos_state_purging = PaxosStatePurging.legacy;\n\n        logInitializationOutcome(logger);\n\n        if (conf.max_space_usable_for_compactions_in_percentage < 0 || conf.max_space_usable_for_compactions_in_percentage > 1)\n            throw new ConfigurationException(\"max_space_usable_for_compactions_in_percentage must be between 0 and 1\", false);\n\n        if (conf.dump_heap_on_uncaught_exception && DatabaseDescriptor.getHeapDumpPath() == null)\n            throw new ConfigurationException(String.format(\"Invalid configuration. Heap dump is enabled but cannot create heap dump output path: %s.\", conf.heap_dump_path != null ? conf.heap_dump_path : \"null\"));\n\n        conf.sai_options.validate();\n\n        List<ConsistencyLevel> progressBarrierCLsArr = Arrays.asList(ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE, NODE_LOCAL);\n        Set<ConsistencyLevel> progressBarrierCls = new HashSet<>(progressBarrierCLsArr);\n        if (!progressBarrierCls.contains(conf.progress_barrier_min_consistency_level))\n        {\n            throw new ConfigurationException(String.format(\"Invalid value for progress_barrier_min_consistency_level %s. Allowed values: %s\",\n                                                           conf.progress_barrier_min_consistency_level, progressBarrierCLsArr));\n        }\n\n        if (!progressBarrierCls.contains(conf.progress_barrier_default_consistency_level))\n        {\n            throw new ConfigurationException(String.format(\"Invalid value for.progress_barrier_default_consistency_level %s. Allowed values: %s\",\n                                                           conf.progress_barrier_default_consistency_level, progressBarrierCLsArr));","sourceCodeStart":1227,"sourceCodeEnd":1263,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1227-L1263","documentation":"max_space_usable_for_compactions_in_percentage is a fraction (0-1) of disk space usable for compactions. DatabaseDescriptor throws this ConfigurationException when the value is negative or greater than 1, since it is a proportion, not a percent integer.","triggerScenarios":"applySimpleConfig (via toolInitialization/applyAll) with cassandra.yaml setting max_space_usable_for_compactions_in_percentage outside [0, 1].","commonSituations":"Operator writes 50 meaning 50% instead of the required 0.5; copy-paste from older docs or other tools that use percent (0-100) semantics.","solutions":["Set the value as a fraction, e.g. 0.5 for 50%","Clamp/remove any out-of-range value in cassandra.yaml before startup"],"exampleFix":"// before (cassandra.yaml)\nmax_space_usable_for_compactions_in_percentage: 50\n// after\nmax_space_usable_for_compactions_in_percentage: 0.5","handlingStrategy":"validation","validationCode":"double p = conf.max_space_usable_for_compactions_in_percentage; if (p < 0 || p > 1) throw new IllegalArgumentException(\"max_space_usable_for_compactions_in_percentage must be a fraction in [0,1], e.g. 0.5\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { System.err.println(e.getMessage()); System.exit(2); }","preventionTips":["Remember this setting is a fraction (0.5 = 50%), never a percent integer","Document unit semantics in your cassandra.yaml comments","Add pre-deploy config checks in CI"],"tags":["cassandra","configuration","disk"],"backgroundTag":"value-out-of-range","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"}