{"record":{"id":"5a5d20aca29e331d","repo":"apache/cassandra","slug":"number-of-concurrent-view-builders-should-be-great","errorCode":null,"errorMessage":"Number of concurrent view builders should be greater than 0.","messagePattern":"Number of concurrent view builders should be greater than 0\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":1580,"sourceCode":"        }\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()\n    {\n        return DatabaseDescriptor.getConcurrentViewBuilders();\n    }\n\n    public void setConcurrentViewBuilders(int value)\n    {\n        if (value <= 0)\n            throw new IllegalArgumentException(\"Number of concurrent view builders should be greater than 0.\");\n        DatabaseDescriptor.setConcurrentViewBuilders(value);\n        CompactionManager.instance.setConcurrentViewBuilders(DatabaseDescriptor.getConcurrentViewBuilders());\n    }\n\n    public boolean isIncrementalBackupsEnabled()\n    {\n        return DatabaseDescriptor.isIncrementalBackupsEnabled();\n    }\n\n    public void setIncrementalBackupsEnabled(boolean value)\n    {\n        DatabaseDescriptor.setIncrementalBackupsEnabled(value);\n    }\n\n    public Future<StreamState> startBootstrap(ClusterMetadata metadata,\n                                              InetAddressAndPort beingReplaced,\n                                              MovementMap movements,\n                                              MovementMap strictMovements)","sourceCodeStart":1562,"sourceCodeEnd":1598,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L1562-L1598","documentation":"Thrown by StorageService.setConcurrentViewBuilders when the caller sets the number of concurrent materialized-view build threads to zero or a negative value. At least one view builder thread is required for materialized views to build, so the value is rejected before updating DatabaseDescriptor and CompactionManager.","triggerScenarios":"Calling StorageService.setConcurrentViewBuilders(value) via JMX or programmatically with value <= 0; applying a cassandra.yaml concurrent_view_builders value of 0 or negative at runtime.","commonSituations":"Operators setting concurrent_view_builders: 0 intending to disable view building (use drop/disable instead); automated sizing scripts computing 0 on CPU-limited nodes; copy-pasted config blocks with placeholder values.","solutions":["Pass a positive integer, e.g. setConcurrentViewBuilders(1) or higher","To stop view building, drop the materialized view or use the appropriate nodetool controls rather than setting builders to 0","Audit config templates so the value is always resolved to >= 1"],"exampleFix":"// before\nstorageService.setConcurrentViewBuilders(0); // IllegalArgumentException\n// after\nstorageService.setConcurrentViewBuilders(Math.max(1, desiredViewBuilders));","handlingStrategy":"validation","validationCode":"if (value <= 0) throw new IllegalArgumentException(\"concurrentViewBuilders must be >= 1, got \" + value);\nstorageService.setConcurrentViewBuilders(value);","typeGuard":"boolean isValidViewBuilderCount(int v) { return v > 0; }","tryCatchPattern":"try { storageService.setConcurrentViewBuilders(value); } catch (IllegalArgumentException e) { logger.warn(\"Invalid concurrent_view_builders: {}\", value, e); }","preventionTips":["Clamp configured values to at least 1","Use view drop/disable mechanisms to stop view building, not 0","Validate templated config before applying via JMX"],"tags":["configuration","jmx","materialized-views","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"}