apache/cassandra · warning

repair_session_max_tree_depth has been deprecated and should

Error message

repair_session_max_tree_depth has been deprecated and should be removed from cassandra.yaml. Use repair_session_space instead

What it means

DatabaseDescriptor detects the deprecated cassandra.yaml property repair_session_max_tree_depth and logs a warning advising removal and use of repair_session_space instead. It still honors the old value, validating it is >= 10 (a ConfigurationException if lower) and warning if > 20. The property is being phased out in favor of memory-bounded repair sessions.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:764

        if (conf.file_cache_round_up == null)
            conf.file_cache_round_up = conf.disk_optimization_strategy == Config.DiskOptimizationStrategy.spinning;

        if (conf.memtable_offheap_space == null)
            conf.memtable_offheap_space = new DataStorageSpec.IntMebibytesBound((int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)));
        // for the moment, we default to twice as much on-heap space as off-heap, as heap overhead is very large
        if (conf.memtable_heap_space == null)
            conf.memtable_heap_space = new DataStorageSpec.IntMebibytesBound((int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)));
        if (conf.memtable_heap_space.toMebibytes() == 0)
            throw new ConfigurationException("memtable_heap_space must be positive, but was " + conf.memtable_heap_space, false);
        logger.info("Global memtable on-heap threshold is enabled at {}", conf.memtable_heap_space);
        if (conf.memtable_offheap_space.toMebibytes() == 0)
            logger.info("Global memtable off-heap threshold is disabled, HeapAllocator will be used instead");
        else
            logger.info("Global memtable off-heap threshold is enabled at {}", conf.memtable_offheap_space);

        if (conf.repair_session_max_tree_depth != null)
        {
            logger.warn("repair_session_max_tree_depth has been deprecated and should be removed from cassandra.yaml. Use repair_session_space instead");
            if (conf.repair_session_max_tree_depth < 10)
                throw new ConfigurationException("repair_session_max_tree_depth should not be < 10, but was " + conf.repair_session_max_tree_depth);
            if (conf.repair_session_max_tree_depth > 20)
                logger.warn("repair_session_max_tree_depth of " + conf.repair_session_max_tree_depth + " > 20 could lead to excessive memory usage");
        }
        else
        {
            conf.repair_session_max_tree_depth = 20;
        }

        if (conf.repair_session_space == null)
            conf.repair_session_space = new DataStorageSpec.IntMebibytesBound(Math.max(1, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));

        if (conf.repair_session_space.toMebibytes() < 1)
            throw new ConfigurationException("repair_session_space must be > 0, but was " + conf.repair_session_space);
        else if (conf.repair_session_space.toMebibytes() > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
            logger.warn("A repair_session_space of " + conf.repair_session_space + " mebibytes is likely to cause heap pressure");

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove repair_session_max_tree_depth from cassandra.yaml
  2. Tune repair memory usage with repair_session_space instead
  3. If you must keep it temporarily, set a value between 10 and 20 to silence the other warnings

Example fix

# before
cassandra.yaml:
  repair_session_max_tree_depth: 24
# after
cassandra.yaml:
  repair_session_space: 256MiB
Defensive patterns

Strategy: validation

Validate before calling

if (config.repair_session_max_tree_depth != null) {
    int d = config.repair_session_max_tree_depth;
    if (d < 10) throw new IllegalArgumentException("repair_session_max_tree_depth must be >= 10, was " + d);
    if (d > 20) logger.warn("depth {} may cause excessive memory usage; prefer repair_session_space", d);
}

Try / catch

try { DatabaseDescriptor.applySimpleConfig(conf); } catch (ConfigurationException e) { /* repair_session_max_tree_depth < 10 rejected here */ }

Prevention

When it happens

Trigger: cassandra.yaml contains repair_session_max_tree_depth; applySimpleConfig finds it non-null and warns, then either rejects values < 10 or warns for values > 20.

Common situations: Upgrading clusters that carried over older repair tuning options into a newer Cassandra version; operators copying legacy yaml files between environments or versions.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/0f13ce165d35274f. Report an issue: GitHub.