{"record":{"id":"9cc5457be743ebd8","repo":"apache/cassandra","slug":"repair-session-space-must-be-0-but-was-conf-r","errorCode":null,"errorMessage":"repair_session_space must be > 0, but was ${conf.repair_session_space}","messagePattern":"repair_session_space must be > 0, but was (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":779,"sourceCode":"\n        if (conf.repair_session_max_tree_depth != null)\n        {\n            logger.warn(\"repair_session_max_tree_depth has been deprecated and should be removed from cassandra.yaml. Use repair_session_space instead\");\n            if (conf.repair_session_max_tree_depth < 10)\n                throw new ConfigurationException(\"repair_session_max_tree_depth should not be < 10, but was \" + conf.repair_session_max_tree_depth);\n            if (conf.repair_session_max_tree_depth > 20)\n                logger.warn(\"repair_session_max_tree_depth of \" + conf.repair_session_max_tree_depth + \" > 20 could lead to excessive memory usage\");\n        }\n        else\n        {\n            conf.repair_session_max_tree_depth = 20;\n        }\n\n        if (conf.repair_session_space == null)\n            conf.repair_session_space = new DataStorageSpec.IntMebibytesBound(Math.max(1, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));\n\n        if (conf.repair_session_space.toMebibytes() < 1)\n            throw new ConfigurationException(\"repair_session_space must be > 0, but was \" + conf.repair_session_space);\n        else if (conf.repair_session_space.toMebibytes() > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))\n            logger.warn(\"A repair_session_space of \" + conf.repair_session_space + \" mebibytes is likely to cause heap pressure\");\n\n        checkForLowestAcceptedTimeouts(conf);\n\n        long valueInBytes = conf.native_transport_max_frame_size.toBytes();\n        if (valueInBytes < 0 || valueInBytes > Integer.MAX_VALUE - 1)\n        {\n            throw new ConfigurationException(String.format(\"native_transport_max_frame_size must be positive value < %dB, but was %dB\",\n                                                           Integer.MAX_VALUE,\n                                                           valueInBytes),\n                                             false);\n        }\n\n        if (conf.column_index_size != null)\n            checkValidForByteConversion(conf.column_index_size, \"column_index_size\");\n        checkValidForByteConversion(conf.column_index_cache_size, \"column_index_cache_size\");\n        checkValidForByteConversion(conf.batch_size_warn_threshold, \"batch_size_warn_threshold\");","sourceCodeStart":761,"sourceCodeEnd":797,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L761-L797","documentation":"repair_session_space caps the total memory Merkle trees in active repair sessions may use. DatabaseDescriptor throws ConfigurationException at startup if the configured value is less than 1 MiB. When unset, a default of max(1, maxMemory/16MiB) MiB is computed; a warning (not an error) is emitted above maxMemory/4MiB.","triggerScenarios":"Setting repair_session_space to 0 or a sub-1MiB value (e.g. '512KiB') in cassandra.yaml; applySimpleConfig validates toMebibytes() < 1 during toolInitialization/applyAll.","commonSituations":"Typo in unit suffix causing tiny parsed value; attempts to 'disable' repair memory by setting it to 0; copy-pasted configs from smaller nodes.","solutions":["Set repair_session_space to at least 1MiB in cassandra.yaml (e.g. repair_session_space: 512MiB)","Remove the option to let Cassandra compute a default from heap size (maxMemory/16MiB)","Verify the DataStorageSpec unit suffix parses to the intended mebibyte value"],"exampleFix":"// before (cassandra.yaml)\nrepair_session_space: 0\n// after (cassandra.yaml)\nrepair_session_space: 512MiB","handlingStrategy":"validation","validationCode":"Object v = yaml.get(\"repair_session_space\");\nif (v != null) {\n    DataStorageSpec.IntMebibytesBound b = DataStorageSpec.IntMebibytesBound.parse(v.toString());\n    if (b.toMebibytes() < 1)\n        throw new IllegalArgumentException(\"repair_session_space must be >= 1MiB, got \" + b);\n}","typeGuard":null,"tryCatchPattern":"try {\n    DatabaseDescriptor.daemonInitialization();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"repair_session_space\"))\n        throw new StartupConfigError(\"repair_session_space must be at least 1MiB\", e);\n    throw e;\n}","preventionTips":["Keep repair_session_space >= 1MiB (default is maxMemory/16MiB)","Use explicit MiB units to avoid parse surprises","Warn if value exceeds maxMemory/4MiB to avoid heap pressure"],"tags":["cassandra","configuration","repair","memory"],"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"}