apache/cassandra · error · ConfigurationException

memtable_cleanup_threshold must be <= 0.99, but was ${conf.m

Error message

memtable_cleanup_threshold must be <= 0.99, but was ${conf.memtable_cleanup_threshold}

What it means

memtable_cleanup_threshold is also capped at 0.99. applySimpleConfig throws ConfigurationException when the configured value exceeds this upper bound, since a threshold that high means memtable cleanup would essentially never run.

Source

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

            conf.memtable_flush_writers = conf.data_file_directories.length == 1 ? 2 : 1;
        }

        if (conf.memtable_flush_writers < 1)
            throw new ConfigurationException("memtable_flush_writers must be at least 1, but was " + conf.memtable_flush_writers, false);

        if (conf.memtable_cleanup_threshold == null)
        {
            conf.memtable_cleanup_threshold = (float) (1.0 / (1 + conf.memtable_flush_writers));
        }
        else
        {
            logger.warn("memtable_cleanup_threshold has been deprecated and should be removed from cassandra.yaml");
        }

        if (conf.memtable_cleanup_threshold < 0.01f)
            throw new ConfigurationException("memtable_cleanup_threshold must be >= 0.01, but was " + conf.memtable_cleanup_threshold, false);
        if (conf.memtable_cleanup_threshold > 0.99f)
            throw new ConfigurationException("memtable_cleanup_threshold must be <= 0.99, but was " + conf.memtable_cleanup_threshold, false);
        if (conf.memtable_cleanup_threshold < 0.1f)
            logger.warn("memtable_cleanup_threshold is set very low [{}], which may cause performance degradation", conf.memtable_cleanup_threshold);

        if (conf.concurrent_compactors == null)
            conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));

        if (conf.concurrent_compactors <= 0)
            throw new ConfigurationException("concurrent_compactors should be strictly greater than 0, but was " + conf.concurrent_compactors, false);

        applyConcurrentValidations(conf);
        applyRepairCommandPoolSize(conf);
        applyThresholdsValidations(conf);

        if (conf.concurrent_materialized_view_builders <= 0)
            throw new ConfigurationException("concurrent_materialized_view_builders should be strictly greater than 0, but was " + conf.concurrent_materialized_view_builders, false);

        if (conf.num_tokens != null && conf.num_tokens > MAX_NUM_TOKENS)
            throw new ConfigurationException(String.format("A maximum number of %d tokens per node is supported", MAX_NUM_TOKENS), false);

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Edit cassandra.yaml and set memtable_cleanup_threshold to a fraction <= 0.99 (e.g. 0.3, or 0.5)
  2. Remove the deprecated memtable_cleanup_threshold line entirely to use defaults
  3. If using a percentage-style value, divide by 100
  4. Restart the node

Example fix

// before (cassandra.yaml)
memtable_cleanup_threshold: 100
// after
memtable_cleanup_threshold: 0.3
Defensive patterns

Strategy: validation

Validate before calling

if (conf.memtable_cleanup_threshold > 0.99f)
    throw new IllegalArgumentException("memtable_cleanup_threshold must be <= 0.99: " + conf.memtable_cleanup_threshold);

Try / catch

try { DatabaseDescriptor.daemonInitialization(); }
catch (ConfigurationException e) { LOG.fatal(e.getMessage()); System.exit(1); }

Prevention

When it happens

Trigger: Node startup with cassandra.yaml specifying memtable_cleanup_threshold > 0.99 (e.g. 1.0, 1, or 100 if someone confuses fraction with percentage).

Common situations: Writing the value as a percentage (e.g. 100 meaning 100%) instead of a fraction (0.99); setting 1 intending 'always'; copy-paste from an invalid example config.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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