apache/cassandra · error · IllegalArgumentException

Cannot set concurrent_validations greater than concurrent_co

Error message

Cannot set concurrent_validations greater than concurrent_compactors (%d)

What it means

Thrown by StorageService.setConcurrentValidators when the requested concurrent_validations value exceeds the configured concurrent_compactors count and DatabaseDescriptor.allowUnlimitedConcurrentValidations is false. Validators run on the compaction thread pool, so allowing more validations than compactors would oversubscribe that pool and starve normal compaction; the guard caps the value unless the escape hatch flag is enabled.

Source

Thrown at src/java/org/apache/cassandra/service/StorageService.java:1554

    @Override
    public void setConcurrentIndexBuilders(int value)
    {
        if (value <= 0)
            throw new IllegalArgumentException("Number of concurrent index builders should be greater than 0.");
        DatabaseDescriptor.setConcurrentIndexBuilders(value);
        CompactionManager.instance.setConcurrentIndexBuilders(value);
    }

    public int getConcurrentValidators()
    {
        return DatabaseDescriptor.getConcurrentValidations();
    }

    public void setConcurrentValidators(int value)
    {
        int concurrentCompactors = DatabaseDescriptor.getConcurrentCompactors();
        if (value > concurrentCompactors && !DatabaseDescriptor.allowUnlimitedConcurrentValidations)
            throw new IllegalArgumentException(
            String.format("Cannot set concurrent_validations greater than concurrent_compactors (%d)",
                          concurrentCompactors));

        if (value <= 0)
        {
            logger.info("Using default value of concurrent_compactors ({}) for concurrent_validations", concurrentCompactors);
            value = concurrentCompactors;
        }
        else
        {
            logger.info("Setting concurrent_validations to {}", value);
        }

        DatabaseDescriptor.setConcurrentValidations(value);
        CompactionManager.instance.setConcurrentValidations();
    }

    public int getConcurrentViewBuilders()

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set concurrent_validations to a value <= getConcurrentCompactors(), e.g. setConcurrentValidators(concurrentCompactors)
  2. If higher validation concurrency is truly intended, start the JVM with -Dcassandra.allow_unlimited_concurrent_validations=true
  3. First raise concurrent_compactors via setConcurrentCompactors, then set concurrent_validations to the new allowed value
  4. Pass a value <= 0 to fall back to the default (concurrent_compactors) behavior

Example fix

// before
storageService.setConcurrentValidators(16); // fails when compactors = 8
// after
int compactors = storageService.getConcurrentCompactors();
storageService.setConcurrentValidators(Math.min(16, compactors));
Defensive patterns

Strategy: validation

Validate before calling

int compactors = storageService.getConcurrentCompactors();
if (value > compactors && !Boolean.getBoolean("cassandra.allow_unlimited_concurrent_validations"))
    value = compactors;
storageService.setConcurrentValidators(value);

Try / catch

try { storageService.setConcurrentValidators(value); } catch (IllegalArgumentException e) { logger.warn("concurrent_validations must be <= concurrent_compactors ({}), got {}", storageService.getConcurrentCompactors(), value, e); }

Prevention

When it happens

Trigger: Calling StorageService.setConcurrentValidators(value) via JMX or programmatically with value > DatabaseDescriptor.getConcurrentCompactors() while cassandra.allow_unlimited_concurrent_validations is not enabled; lowering concurrent_compactors below the currently-set concurrent_validations then trying to re-apply validations.

Common situations: Operators tuning repair-time validator concurrency to speed up repairs and setting it above the compactor count; scripts deriving concurrent_validations independently from concurrent_compactors; disabling the -Dcassandra.allow_unlimited_concurrent_validations JVM property after previously relying on it.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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