apache/cassandra · error · ConfigurationException

accord.working_set_size option was set incorrectly to '<valu

Error message

accord.working_set_size option was set incorrectly to '<value>', supported values are <integer> >= 0.

What it means

Thrown by DatabaseDescriptor.applySimpleConfig when the accord.working_set_size config value cannot be parsed into a valid mebibyte integer (>= 0). Cassandra validates all simple config settings at startup, before the node can serve traffic. This is a ConfigurationException with a friendly message identifying the offending value.

Source

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

                throw new NumberFormatException(); // to escape duplicating error message
        }
        catch (NumberFormatException e)
        {
            throw new ConfigurationException("accord.cache_size option was set incorrectly to '"
                                             + conf.accord.cache_size + "', supported values are <integer> >= 0.", false);
        }

        try
        {
            // if accordWorkingSetSizeInMiB option was set to "auto" then size of the working set should be "max(5% of Heap (in MB), 1MB)
            // if negative, there is no limit
            accordWorkingSetSizeInMiB = (conf.accord.working_set_size == null)
                                  ? Math.max(1, (int) ((Runtime.getRuntime().totalMemory() * 0.05) / 1024 / 1024))
                                  : conf.accord.working_set_size.toMebibytes();
        }
        catch (NumberFormatException e)
        {
            throw new ConfigurationException("accord.working_set_size option was set incorrectly to '"
                                             + conf.accord.working_set_size + "', supported values are <integer> >= 0.", false);
        }

        try
        {
            // if consensusMigrationCacheSizeInMiB option was set to "auto" then size of the cache should be "min(1% of Heap (in MB), 50MB)
            consensusMigrationCacheSizeInMiB = (conf.consensus_migration_cache_size == null)
                                               ? Math.min(Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.01 / 1024 / 1024)), 50)
                                               : conf.consensus_migration_cache_size.toMebibytes();

            if (consensusMigrationCacheSizeInMiB < 0)
                throw new NumberFormatException(); // to escape duplicating error message
        }
        catch (NumberFormatException e)
        {
            throw new ConfigurationException("consensus_migration_cache_size option was set incorrectly to '"
                                             + conf.consensus_migration_cache_size + "', supported values are <integer> >= 0.", false);
        }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Fix accord.working_set_size in cassandra.yaml to a non-negative integer of mebibytes (e.g. 64) or remove the option entirely to let Cassandra auto-size it to max(1, 5% of heap in MiB).
  2. If set to 'auto' or empty intent, delete the key rather than leaving an unparseable token.
  3. Restart the node; validation runs in applySimpleConfig during startup/toolInitialization.

Example fix

# before (cassandra.yaml)
accord:
  working_set_size: -5mib
# after
accord:
  working_set_size: 64MiB
Defensive patterns

Strategy: validation

Validate before calling

// before deploy, parse cassandra.yaml and check
String v = yaml.get("accord.working_set_size");
if (v != null && (v.trim().isEmpty() || v.contains("-") || !v.matches("[0-9]+\\s*(MiB|MB)?")))
    throw new IllegalArgumentException("accord.working_set_size must be a non-negative integer mebibyte value, got: " + v);

Type guard

boolean isValidWorkingSetSize(Object v) {
    return v == null || (v instanceof Number && ((Number) v).longValue() >= 0);
}

Try / catch

try {
    DatabaseDescriptor.applySimpleConfig();
} catch (ConfigurationException e) {
    if (e.getMessage().contains("accord.working_set_size")) {
        logger.error("Fix accord.working_set_size in cassandra.yaml: {}", e.getMessage());
        // fall back to removing the key and restarting
    }
}

Prevention

When it happens

Trigger: cassandra.yaml contains accord.working_set_size set to a value that fails toMebibytes() parsing (e.g. non-numeric string, negative number, malformed size string like '5x' or '-1mib'), or negative numeric value caught by the surrounding NumberFormatException handler.

Common situations: Operators enabling Accord (transactional) features hand-edit cassandra.yaml and mistype the size; config copied from an older/newer version with a different accepted syntax; automation templates injecting negative or placeholder values.

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/095a4c753cd33761. Report an issue: GitHub.