apache/cassandra · error · org.apache.cassandra.exceptions.ConfigurationException
max_concurrent_automatic_sstable_upgrades can't be negative
Error message
max_concurrent_automatic_sstable_upgrades can't be negative
What it means
validateMaxConcurrentAutoUpgradeTasksConf rejects a negative max_concurrent_automatic_sstable_upgrades value with ConfigurationException. Zero is allowed (disables auto upgrades) but any negative count is invalid; values above concurrent_compactors are only warned about.
Source
Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5236
}
public static int maxConcurrentAutoUpgradeTasks()
{
return conf.max_concurrent_automatic_sstable_upgrades;
}
public static void setMaxConcurrentAutoUpgradeTasks(int value)
{
if (conf.max_concurrent_automatic_sstable_upgrades != value)
logger.debug("Changing max_concurrent_automatic_sstable_upgrades to {}", value);
validateMaxConcurrentAutoUpgradeTasksConf(value);
conf.max_concurrent_automatic_sstable_upgrades = value;
}
private static void validateMaxConcurrentAutoUpgradeTasksConf(int value)
{
if (value < 0)
throw new ConfigurationException("max_concurrent_automatic_sstable_upgrades can't be negative");
if (value > getConcurrentCompactors())
logger.warn("max_concurrent_automatic_sstable_upgrades ({}) is larger than concurrent_compactors ({})", value, getConcurrentCompactors());
}
public static AuditLogOptions getAuditLoggingOptions()
{
return conf.audit_logging_options;
}
public static void setAuditLoggingOptions(AuditLogOptions auditLoggingOptions)
{
conf.audit_logging_options = new AuditLogOptions.Builder(auditLoggingOptions).build();
}
public static Config.CorruptedTombstoneStrategy getCorruptedTombstoneStrategy()
{
return conf.corrupted_tombstone_strategy;
}View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Pass 0 to disable automatic sstable upgrades instead of a negative number
- Fix the negative value in cassandra.yaml
- Use Math.max(0, value) before calling the setter
Example fix
// before DatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks(-1); // after DatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks(0); // disable
Defensive patterns
Strategy: validation
Validate before calling
if (value < 0) throw new IllegalArgumentException("max_concurrent_automatic_sstable_upgrades must be >= 0"); Try / catch
try { DatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks(v); } catch (ConfigurationException e) { logger.error("invalid max_concurrent_automatic_sstable_upgrades: {}", e.getMessage()); } Prevention
- Use 0 to disable auto upgrades, not -1
- Sanity-check yaml int fields for accidental negatives
- Verify the value stays >= 0 after changing concurrent_compactors
When it happens
Trigger: Calling DatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks or setConcurrentCompactors such that a negative value is passed, e.g. setMaxConcurrentAutoUpgradeTasks(-1) or lowering concurrent_compactors below the current value.
Common situations: Negative values in cassandra.yaml (typo or signed int overflow), or JMX/setter misuse when disabling automatic sstable upgrades.
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
- Invalid value of auto_snapshot_ttl: ${conf.auto_snapshot_ttl
- Missing value for commitlog_sync_group_window.
- Missing value for commitlog_sync_period.
- Unsupported disk access mode for compaction_read_disk_access
- concurrent_reads must be at least 2, but was ${conf.concurre
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/4eb895a2ef922c90.
Report an issue: GitHub.