apache/cassandra · error · IllegalArgumentException

Number of concurrent index builders should be greater than…

Error message

Number of concurrent index builders should be greater than 0.

What it means

Thrown by StorageService.setConcurrentIndexBuilders when the caller sets the number of concurrent secondary index build threads to zero or a negative value. At least one builder thread is required for index builds to proceed, so the value is validated before being stored in DatabaseDescriptor and applied to CompactionManager.

Solutions

  1. Pass a positive integer, e.g. setConcurrentIndexBuilders(1) or higher
  2. Check the current value with getConcurrentIndexBuilders() before writing and only apply if the new value is >= 1
  3. Fix the config template or compute logic so the value never evaluates to 0 or below

Example fix

// before
storageService.setConcurrentIndexBuilders(config.buildThreads); // may be 0
// after
if (config.buildThreads > 0)
    storageService.setConcurrentIndexBuilders(config.buildThreads);
Defensive patterns

Strategy: validation

Validate before calling

if (value <= 0) throw new IllegalArgumentException("concurrentIndexBuilders must be >= 1, got " + value);
storageService.setConcurrentIndexBuilders(value);

Type guard

boolean isValidBuilderCount(int v) { return v > 0; }

Try / catch

try { storageService.setConcurrentIndexBuilders(value); } catch (IllegalArgumentException e) { logger.warn("Invalid concurrent_index_builders: {}", value, e); }

Prevention

When it happens

Trigger: Calling StorageService.setConcurrentIndexBuilders(value) via JMX or programmatically with value <= 0; applying a cassandra.yaml-derived concurrent_index_builders value of 0 or negative at runtime.

Common situations: Containerized deployments with fractional CPU limits where a computed thread count floors to 0; operators confusing 0 with 'unlimited' or 'disabled'; config templating engines emitting empty variables that coerce to 0.

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/65d85e2617c17130. Report an issue: GitHub.

Appendix: source

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

        DatabaseDescriptor.allowUnlimitedConcurrentValidations = false ;
    }

    public boolean isConcurrentValidatorsLimitEnforced()
    {
        return DatabaseDescriptor.allowUnlimitedConcurrentValidations;
    }

    @Override
    public int getConcurrentIndexBuilders()
    {
        return DatabaseDescriptor.getConcurrentIndexBuilders();
    }

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

View on GitHub (pinned to 88fd0f6a0e)