apache/cassandra · error · ConfigurationException
concurrent_writes must be at least 2, but was ${conf.concurr
Error message
concurrent_writes must be at least 2, but was ${conf.concurrent_writes} What it means
concurrent_writes sets the write stage worker thread count and must be at least 2. applySimpleConfig enforces this at startup, but skips the check while the TEST_FAIL_MV_LOCKS_COUNT system property is set, which some materialized-view tests use to run with degenerate pools.
Source
Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:733
"(options: direct/auto) " + conf.compaction_read_disk_access_mode);
}
logger.info("compaction_read_disk_access_mode resolved to: {}", compactionReadDiskAccessMode);
/* phi convict threshold for FailureDetector */
if (conf.phi_convict_threshold < 5 || conf.phi_convict_threshold > 16)
{
throw new ConfigurationException("phi_convict_threshold must be between 5 and 16, but was " + conf.phi_convict_threshold, false);
}
/* Thread per pool */
if (conf.concurrent_reads < 2)
{
throw new ConfigurationException("concurrent_reads must be at least 2, but was " + conf.concurrent_reads, false);
}
if (conf.concurrent_writes < 2 && TEST_FAIL_MV_LOCKS_COUNT.getString("").isEmpty())
{
throw new ConfigurationException("concurrent_writes must be at least 2, but was " + conf.concurrent_writes, false);
}
if (conf.concurrent_counter_writes < 2)
throw new ConfigurationException("concurrent_counter_writes must be at least 2, but was " + conf.concurrent_counter_writes, false);
if (conf.networking_cache_size == null)
conf.networking_cache_size = new DataStorageSpec.IntMebibytesBound(Math.min(128, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));
if (conf.file_cache_size == null)
conf.file_cache_size = new DataStorageSpec.IntMebibytesBound(Math.min(512, (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576))));
// round down for SSDs and round up for spinning disks
if (conf.file_cache_round_up == null)
conf.file_cache_round_up = conf.disk_optimization_strategy == Config.DiskOptimizationStrategy.spinning;
if (conf.memtable_offheap_space == null)
conf.memtable_offheap_space = new DataStorageSpec.IntMebibytesBound((int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)));
// for the moment, we default to twice as much on-heap space as off-heap, as heap overhead is very largeView on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set `concurrent_writes` to at least 2 (shipped default is 32).
- Remove the override to use the default.
- If a test harness intentionally sets low values, ensure TEST_FAIL_MV_LOCKS_COUNT is only set in test environments, never in production.
Example fix
// before (cassandra.yaml) concurrent_writes: 0 // after (cassandra.yaml) concurrent_writes: 32
Defensive patterns
Strategy: validation
Validate before calling
// Java, before toolInitialization()
int writes = /* configured concurrent_writes */;
boolean testFlag = !System.getProperty("cassandra.test.fail_mv_locks_count", "").isEmpty();
if (writes < 2 && !testFlag)
throw new IllegalArgumentException("concurrent_writes must be >= 2, got " + writes); Prevention
- Never let test-only system properties leak into production startup scripts.
- Clamp generated pool sizes to >= 2.
- Prefer removing overrides over hand-tuning tiny pool sizes.
When it happens
Trigger: cassandra.yaml (or programmatic Config) has `concurrent_writes` below 2 (e.g. 0 or 1) when DatabaseDescriptor.toolInitialization/applyAll runs, and the TEST_FAIL_MV_LOCKS_COUNT system property is unset/empty.
Common situations: Shrinking pools on memory-constrained containers; CI images with generated configs producing 0/1; mixing test-only property flags into production startup scripts that then behave differently from expected.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- concurrent_reads must be at least 2, but was ${conf.concurre
- Missing value for commitlog_sync_group_window.
- Missing value for commitlog_sync_period.
- concurrent_counter_writes must be at least 2, but was ${conf
- memtable_flush_writers must be at least 1, but was ${conf.me
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/1dc89e4642718465.
Report an issue: GitHub.