{"record":{"id":"98a6716f3e4de107","repo":"apache/cassandra","slug":"cannot-set-concurrent-validations-greater-than-con","errorCode":null,"errorMessage":"Cannot set concurrent_validations greater than concurrent_compactors (%d)","messagePattern":"Cannot set concurrent_validations greater than concurrent_compactors \\((.+?)\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":1554,"sourceCode":"    @Override\n    public void setConcurrentIndexBuilders(int value)\n    {\n        if (value <= 0)\n            throw new IllegalArgumentException(\"Number of concurrent index builders should be greater than 0.\");\n        DatabaseDescriptor.setConcurrentIndexBuilders(value);\n        CompactionManager.instance.setConcurrentIndexBuilders(value);\n    }\n\n    public int getConcurrentValidators()\n    {\n        return DatabaseDescriptor.getConcurrentValidations();\n    }\n\n    public void setConcurrentValidators(int value)\n    {\n        int concurrentCompactors = DatabaseDescriptor.getConcurrentCompactors();\n        if (value > concurrentCompactors && !DatabaseDescriptor.allowUnlimitedConcurrentValidations)\n            throw new IllegalArgumentException(\n            String.format(\"Cannot set concurrent_validations greater than concurrent_compactors (%d)\",\n                          concurrentCompactors));\n\n        if (value <= 0)\n        {\n            logger.info(\"Using default value of concurrent_compactors ({}) for concurrent_validations\", concurrentCompactors);\n            value = concurrentCompactors;\n        }\n        else\n        {\n            logger.info(\"Setting concurrent_validations to {}\", value);\n        }\n\n        DatabaseDescriptor.setConcurrentValidations(value);\n        CompactionManager.instance.setConcurrentValidations();\n    }\n\n    public int getConcurrentViewBuilders()","sourceCodeStart":1536,"sourceCodeEnd":1572,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L1536-L1572","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set concurrent_validations to a value <= getConcurrentCompactors(), e.g. setConcurrentValidators(concurrentCompactors)","If higher validation concurrency is truly intended, start the JVM with -Dcassandra.allow_unlimited_concurrent_validations=true","First raise concurrent_compactors via setConcurrentCompactors, then set concurrent_validations to the new allowed value","Pass a value <= 0 to fall back to the default (concurrent_compactors) behavior"],"exampleFix":"// before\nstorageService.setConcurrentValidators(16); // fails when compactors = 8\n// after\nint compactors = storageService.getConcurrentCompactors();\nstorageService.setConcurrentValidators(Math.min(16, compactors));","handlingStrategy":"validation","validationCode":"int compactors = storageService.getConcurrentCompactors();\nif (value > compactors && !Boolean.getBoolean(\"cassandra.allow_unlimited_concurrent_validations\"))\n    value = compactors;\nstorageService.setConcurrentValidators(value);","typeGuard":null,"tryCatchPattern":"try { storageService.setConcurrentValidators(value); } catch (IllegalArgumentException e) { logger.warn(\"concurrent_validations must be <= concurrent_compactors ({}), got {}\", storageService.getConcurrentCompactors(), value, e); }","preventionTips":["Always derive concurrent_validations from getConcurrentCompactors()","Remember values <= 0 mean 'use default' and are valid","Keep the cassandra.allow_unlimited_concurrent_validations system property consistent across restarts"],"tags":["configuration","jmx","compaction","validation","repair"],"backgroundTag":"value-out-of-range","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"}