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

  1. Set druid.indexer.tasklock.batchedSegmentAllocation=true on the Overlord and restart it.
  2. Add the task's datasource to druid.indexer.tasklock.batchedSegmentAllocation.allowList.
  3. 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).
  4. 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

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


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/d883d3e5e753f854. Report an issue: GitHub.