apache/cassandra · error · ConfigurationException

concurrent_compactors should be strictly greater than 0, but

Error message

concurrent_compactors should be strictly greater than 0, but was ${conf.concurrent_compactors}

What it means

concurrent_compactors controls the number of simultaneous compaction threads; Cassandra validates it is strictly greater than 0 at startup in applySimpleConfig. A zero or negative value would disable compaction entirely and break the node's write path bookkeeping, so ConfigurationException is thrown.

Source

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

            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);

        try
        {
            // if prepared_statements_cache_size option was set to "auto" then size of the cache should be "max(1/256 of Heap (in MiB), 10MiB)"
            preparedStatementsCacheSizeInMiB = (conf.prepared_statements_cache_size == null)
                                               ? Math.max(10, (int) (Runtime.getRuntime().maxMemory() / 1024 / 1024 / 256))
                                               : conf.prepared_statements_cache_size.toMebibytes();

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Edit cassandra.yaml and set concurrent_compactors to a positive integer (default is min(8, max(2, cores, data dirs)))
  2. Remove the key to use the computed default
  3. To throttle compaction instead of disabling it, tune compaction_throughput rather than setting 0
  4. Restart the node

Example fix

// before (cassandra.yaml)
concurrent_compactors: 0
// after
concurrent_compactors: 4
Defensive patterns

Strategy: validation

Validate before calling

if (conf.concurrentCompactors != null && conf.concurrentCompactors <= 0)
    throw new IllegalArgumentException("concurrent_compactors must be > 0");

Try / catch

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

Prevention

When it happens

Trigger: Node startup with concurrent_compactors: 0 or a negative integer in cassandra.yaml.

Common situations: Operator trying to 'disable' compaction by setting 0; templating bug that renders an empty/0 value; tuning experiment left in the 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/adc278f35dee3fed. Report an issue: GitHub.