{"record":{"id":"4eb895a2ef922c90","repo":"apache/cassandra","slug":"max-concurrent-automatic-sstable-upgrades-can-t-be","errorCode":null,"errorMessage":"max_concurrent_automatic_sstable_upgrades can't be negative","messagePattern":"max_concurrent_automatic_sstable_upgrades can't be negative","errorType":"validation","errorClass":"org.apache.cassandra.exceptions.ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":5236,"sourceCode":"    }\n\n    public static int maxConcurrentAutoUpgradeTasks()\n    {\n        return conf.max_concurrent_automatic_sstable_upgrades;\n    }\n\n    public static void setMaxConcurrentAutoUpgradeTasks(int value)\n    {\n        if (conf.max_concurrent_automatic_sstable_upgrades != value)\n            logger.debug(\"Changing max_concurrent_automatic_sstable_upgrades to {}\", value);\n        validateMaxConcurrentAutoUpgradeTasksConf(value);\n        conf.max_concurrent_automatic_sstable_upgrades = value;\n    }\n\n    private static void validateMaxConcurrentAutoUpgradeTasksConf(int value)\n    {\n        if (value < 0)\n            throw new ConfigurationException(\"max_concurrent_automatic_sstable_upgrades can't be negative\");\n        if (value > getConcurrentCompactors())\n            logger.warn(\"max_concurrent_automatic_sstable_upgrades ({}) is larger than concurrent_compactors ({})\", value, getConcurrentCompactors());\n    }\n\n    public static AuditLogOptions getAuditLoggingOptions()\n    {\n        return conf.audit_logging_options;\n    }\n\n    public static void setAuditLoggingOptions(AuditLogOptions auditLoggingOptions)\n    {\n        conf.audit_logging_options = new AuditLogOptions.Builder(auditLoggingOptions).build();\n    }\n\n    public static Config.CorruptedTombstoneStrategy getCorruptedTombstoneStrategy()\n    {\n        return conf.corrupted_tombstone_strategy;\n    }","sourceCodeStart":5218,"sourceCodeEnd":5254,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L5218-L5254","documentation":"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.","triggerScenarios":"Calling DatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks or setConcurrentCompactors such that a negative value is passed, e.g. setMaxConcurrentAutoUpgradeTasks(-1) or lowering concurrent_compactors below the current value.","commonSituations":"Negative values in cassandra.yaml (typo or signed int overflow), or JMX/setter misuse when disabling automatic sstable upgrades.","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"],"exampleFix":"// before\nDatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks(-1);\n// after\nDatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks(0); // disable","handlingStrategy":"validation","validationCode":"if (value < 0) throw new IllegalArgumentException(\"max_concurrent_automatic_sstable_upgrades must be >= 0\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.setMaxConcurrentAutoUpgradeTasks(v); } catch (ConfigurationException e) { logger.error(\"invalid max_concurrent_automatic_sstable_upgrades: {}\", e.getMessage()); }","preventionTips":["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"],"tags":["config","validation","compaction"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}