{"record":{"id":"65d85e2617c17130","repo":"apache/cassandra","slug":"number-of-concurrent-index-builders-should-be-grea","errorCode":null,"errorMessage":"Number of concurrent index builders should be greater than 0.","messagePattern":"Number of concurrent index builders should be greater than 0\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":1540,"sourceCode":"        DatabaseDescriptor.allowUnlimitedConcurrentValidations = false ;\n    }\n\n    public boolean isConcurrentValidatorsLimitEnforced()\n    {\n        return DatabaseDescriptor.allowUnlimitedConcurrentValidations;\n    }\n\n    @Override\n    public int getConcurrentIndexBuilders()\n    {\n        return DatabaseDescriptor.getConcurrentIndexBuilders();\n    }\n\n    @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)","sourceCodeStart":1522,"sourceCodeEnd":1558,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L1522-L1558","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass a positive integer, e.g. setConcurrentIndexBuilders(1) or higher","Check the current value with getConcurrentIndexBuilders() before writing and only apply if the new value is >= 1","Fix the config template or compute logic so the value never evaluates to 0 or below"],"exampleFix":"// before\nstorageService.setConcurrentIndexBuilders(config.buildThreads); // may be 0\n// after\nif (config.buildThreads > 0)\n    storageService.setConcurrentIndexBuilders(config.buildThreads);","handlingStrategy":"validation","validationCode":"if (value <= 0) throw new IllegalArgumentException(\"concurrentIndexBuilders must be >= 1, got \" + value);\nstorageService.setConcurrentIndexBuilders(value);","typeGuard":"boolean isValidBuilderCount(int v) { return v > 0; }","tryCatchPattern":"try { storageService.setConcurrentIndexBuilders(value); } catch (IllegalArgumentException e) { logger.warn(\"Invalid concurrent_index_builders: {}\", value, e); }","preventionTips":["Default to 1 when a computed value is 0 or negative","Guard against unset config variables coercing to 0","Read the current value with getConcurrentIndexBuilders() before writing"],"tags":["configuration","jmx","index","validation"],"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-17T15:17:12.973Z"}