{"record":{"id":"122d6fee5b15a88e","repo":"apache/cassandra","slug":"concurrent-reads-must-be-at-least-2-but-was-con","errorCode":null,"errorMessage":"concurrent_reads must be at least 2, but was ${conf.concurrent_reads}","messagePattern":"concurrent_reads must be at least 2, but was (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":728,"sourceCode":"            compactionReadDiskAccessMode = DiskAccessMode.direct;\n        }\n        else\n        {\n            throw new IllegalArgumentException(\"Unsupported disk access mode for compaction_read_disk_access_mode \" +\n                                               \"(options: direct/auto) \" + conf.compaction_read_disk_access_mode);\n        }\n        logger.info(\"compaction_read_disk_access_mode resolved to: {}\", compactionReadDiskAccessMode);\n\n        /* phi convict threshold for FailureDetector */\n        if (conf.phi_convict_threshold < 5 || conf.phi_convict_threshold > 16)\n        {\n            throw new ConfigurationException(\"phi_convict_threshold must be between 5 and 16, but was \" + conf.phi_convict_threshold, false);\n        }\n\n        /* Thread per pool */\n        if (conf.concurrent_reads < 2)\n        {\n            throw new ConfigurationException(\"concurrent_reads must be at least 2, but was \" + conf.concurrent_reads, false);\n        }\n\n        if (conf.concurrent_writes < 2 && TEST_FAIL_MV_LOCKS_COUNT.getString(\"\").isEmpty())\n        {\n            throw new ConfigurationException(\"concurrent_writes must be at least 2, but was \" + conf.concurrent_writes, false);\n        }\n\n        if (conf.concurrent_counter_writes < 2)\n            throw new ConfigurationException(\"concurrent_counter_writes must be at least 2, but was \" + conf.concurrent_counter_writes, false);\n\n        if (conf.networking_cache_size == null)\n            conf.networking_cache_size = new DataStorageSpec.IntMebibytesBound(Math.min(128, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));\n\n        if (conf.file_cache_size == null)\n            conf.file_cache_size = new DataStorageSpec.IntMebibytesBound(Math.min(512, (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576))));\n\n        // round down for SSDs and round up for spinning disks\n        if (conf.file_cache_round_up == null)","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L710-L746","documentation":"concurrent_reads controls the number of read stage worker threads; Cassandra requires at least 2 so the read pipeline can make progress even while one thread blocks. applySimpleConfig rejects values below 2 at startup with this ConfigurationException.","triggerScenarios":"Setting `concurrent_reads: 0` or `concurrent_reads: 1` in cassandra.yaml (or passing such a Config programmatically) before DatabaseDescriptor.toolInitialization/applyAll.","commonSituations":"Aggressively shrinking thread pools on tiny test containers or dev laptops; config generators computing thread counts as 'cores - N' yielding 1 or 0; typos like concurrent_reads: 2_ (parsed low) or unset-derived zeros in templated YAML.","solutions":["Raise `concurrent_reads` to at least 2; the shipped default is 32 (16 x CPU cores in many builds).","Remove the override to use the default value.","Fix the config generator to clamp the computed value to a minimum of 2."],"exampleFix":"// before (cassandra.yaml)\nconcurrent_reads: 1\n// after (cassandra.yaml)\nconcurrent_reads: 32","handlingStrategy":"validation","validationCode":"// Java, before toolInitialization()\nint reads = /* configured concurrent_reads */;\nif (reads < 2)\n    throw new IllegalArgumentException(\"concurrent_reads must be >= 2, got \" + reads);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp all concurrent_* pool values to >= 2 in any config generator.","Don't set pools to 0 or 1 to 'shrink' Cassandra on dev machines; use the defaults.","Validate cassandra.yaml with a startup smoke test in CI."],"tags":["config","thread-pools","validation","startup"],"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"}