apache/druid · error · IllegalStateException
Batched segment allocation is disabled
Error message
Batched segment allocation is disabled
What it means
SegmentAllocateAction.performAsync() refuses to queue a segment-allocation request when the Overlord's TaskActionToolbox reports that batched segment allocation (the SegmentAllocationQueue) is not enabled. Batched allocation is a cluster feature toggled by druid.indexer.tasklock.batchedSegmentAllocation (and requires the task's datasource to be in the allow list). Throwing here prevents tasks from silently depending on a disabled feature.
Source
Thrown at indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentAllocateAction.java:200
}
@Override
public TypeReference<SegmentIdWithShardSpec> getReturnTypeReference()
{
return new TypeReference<>() {};
}
@Override
public boolean canPerformAsync(Task task, TaskActionToolbox toolbox)
{
return toolbox.canBatchSegmentAllocation();
}
@Override
public Future<SegmentIdWithShardSpec> performAsync(Task task, TaskActionToolbox toolbox)
{
if (!toolbox.canBatchSegmentAllocation()) {
throw new ISE("Batched segment allocation is disabled");
}
return toolbox.getSegmentAllocationQueue().add(
new SegmentAllocateRequest(task, this, MAX_ATTEMPTS)
);
}
@Override
public SegmentIdWithShardSpec perform(
final Task task,
final TaskActionToolbox toolbox
)
{
if (!(task instanceof PendingSegmentAllocatingTask)) {
throw DruidException.defensive(
"Task[%s] of type[%s] cannot allocate segments as it does not implement PendingSegmentAllocatingTask.",
task.getId(), task.getType()
);
}View on GitHub (pinned to 9b90983fd2)
Solutions
- Set druid.indexer.tasklock.batchedSegmentAllocation=true on the Overlord and restart it.
- Add the task's datasource to druid.indexer.tasklock.batchedSegmentAllocation.allowList.
- If the feature is intentionally off, use a task type/ingestion mode that does not rely on batched segment allocation (e.g. non-batch lineages / single-phase allocation).
- Verify all Overlords in the HA group run the same feature configuration.
Example fix
// before (runtime.properties) druid.indexer.tasklock.batchedSegmentAllocation=false // after druid.indexer.tasklock.batchedSegmentAllocation=true druid.indexer.tasklock.batchedSegmentAllocation.allowList=["my-datasource"]
Defensive patterns
Strategy: validation
Validate before calling
boolean batchedEnabled = Boolean.parseBoolean(
System.getProperty("druid.indexer.tasklock.batchedSegmentAllocation", "false"));
if (!batchedEnabled) { /* fall back to non-batched allocation path or enable the flag */ } Try / catch
try { future = action.performAsync(task, toolbox); } catch (IllegalStateException e) { if (e.getMessage().contains("Batched segment allocation is disabled")) { /* fallback to non-batched path */ } else throw e; } Prevention
- Enable druid.indexer.tasklock.batchedSegmentAllocation on every Overlord before running supervisor tasks.
- Keep the datasource allowList in sync with active supervisors.
- Check Overlord /status endpoints for feature config after upgrades.
- Align feature flags across all Overlord replicas.
When it happens
Trigger: A task (Kafka/Kinesis supervisor task, batch parallel task) calls SEGMENT_ALLOCATE while druid.indexer.tasklock.batchedSegmentAllocation=false, or the datasource is not listed in druid.indexer.tasklock.batchedSegmentAllocation.allowList.
Common situations: Rolling upgrades where some Overlords run without the feature flag; task launched against an Overlord whose allowList does not include the datasource; configs carried over from an older Druid version predating batched allocation.
Related errors
- Batched segment allocation is disabled.
- Cannot allocate segment if not leader.
- Task dataSource must match action dataSource, [%s] != [%s].
- The lock for interval[%s] is preempted and no longer valid
- Could not find interval for timestamp [%s]
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/d883d3e5e753f854.
Report an issue: GitHub.