{"record":{"id":"fb6da01a593bb709","repo":"apache/cassandra","slug":"cannot-set-repair-session-max-tree-depth-to-which","errorCode":null,"errorMessage":"Cannot set repair_session_max_tree_depth to which is < 10, doing nothing","messagePattern":"Cannot set repair_session_max_tree_depth to which is < 10, doing nothing","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":4755,"sourceCode":"    public static long getMemtableOffheapSpaceInMiB()\n    {\n        return conf.memtable_offheap_space.toMebibytes();\n    }\n\n    public static Config.MemtableAllocationType getMemtableAllocationType()\n    {\n        return conf.memtable_allocation_type;\n    }\n\n    public static int getRepairSessionMaxTreeDepth()\n    {\n        return conf.repair_session_max_tree_depth;\n    }\n\n    public static void setRepairSessionMaxTreeDepth(int depth)\n    {\n        if (depth < 10)\n            throw new ConfigurationException(\"Cannot set repair_session_max_tree_depth to \" + depth +\n                                             \" which is < 10, doing nothing\");\n        else if (depth > 20)\n            logger.warn(\"repair_session_max_tree_depth of \" + depth + \" > 20 could lead to excessive memory usage\");\n\n        conf.repair_session_max_tree_depth = depth;\n    }\n\n    public static int getRepairSessionSpaceInMiB()\n    {\n        return conf.repair_session_space.toMebibytes();\n    }\n\n    public static void setRepairSessionSpaceInMiB(int sizeInMiB)\n    {\n        if (sizeInMiB < 1)\n            throw new ConfigurationException(\"Cannot set repair_session_space to \" + sizeInMiB +\n                                             \" < 1 mebibyte\");\n        else if (sizeInMiB > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))","sourceCodeStart":4737,"sourceCodeEnd":4773,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L4737-L4773","documentation":"Cassandra throws this ConfigurationException when setRepairSessionMaxTreeDepth is called with a depth below 10. The Merkle-tree depth for repair sessions controls tree granularity; values under 10 are not permitted, while values over 20 only produce a memory-usage warning.","triggerScenarios":"Calling DatabaseDescriptor.setRepairSessionMaxTreeDepth(depth) with depth < 10, e.g. via JMX nodetool-side config updates or startup validation of repair_session_max_tree_depth.","commonSituations":"Operators tuning repair performance lower the depth to reduce memory, going below the enforced minimum of 10; mistakes transposing values (e.g. entering 1 instead of 16).","solutions":["Set the depth to at least 10","If smaller trees are needed for memory reasons, reduce parallel repair sessions (repair_session_space) instead","Verify the value in cassandra.yaml for repair_session_max_tree_depth"],"exampleFix":"// before\nDatabaseDescriptor.setRepairSessionMaxTreeDepth(8);\n// after\nDatabaseDescriptor.setRepairSessionMaxTreeDepth(12);","handlingStrategy":"validation","validationCode":"if (depth < 10 || depth > 20) throw new IllegalArgumentException(\"repair_session_max_tree_depth should be between 10 and 20, got: \" + depth);","typeGuard":null,"tryCatchPattern":"try {\n    DatabaseDescriptor.setRepairSessionMaxTreeDepth(depth);\n} catch (ConfigurationException e) {\n    logger.warn(\"Invalid repair_session_max_tree_depth; using default\", e);\n}","preventionTips":["Keep the depth in the 10-20 range (above 20 only warns about memory)","Tune repair memory via repair_session_space instead of lowering depth below 10","Double-check numeric config edits for transposition errors"],"tags":["configuration","repair","validation"],"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"}