{"record":{"id":"d883d3e5e753f854","repo":"apache/druid","slug":"batched-segment-allocation-is-disabled","errorCode":null,"errorMessage":"Batched segment allocation is disabled","messagePattern":"Batched segment allocation is disabled","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentAllocateAction.java","lineNumber":200,"sourceCode":"  }\n\n  @Override\n  public TypeReference<SegmentIdWithShardSpec> getReturnTypeReference()\n  {\n    return new TypeReference<>() {};\n  }\n\n  @Override\n  public boolean canPerformAsync(Task task, TaskActionToolbox toolbox)\n  {\n    return toolbox.canBatchSegmentAllocation();\n  }\n\n  @Override\n  public Future<SegmentIdWithShardSpec> performAsync(Task task, TaskActionToolbox toolbox)\n  {\n    if (!toolbox.canBatchSegmentAllocation()) {\n      throw new ISE(\"Batched segment allocation is disabled\");\n    }\n    return toolbox.getSegmentAllocationQueue().add(\n        new SegmentAllocateRequest(task, this, MAX_ATTEMPTS)\n    );\n  }\n\n  @Override\n  public SegmentIdWithShardSpec perform(\n      final Task task,\n      final TaskActionToolbox toolbox\n  )\n  {\n    if (!(task instanceof PendingSegmentAllocatingTask)) {\n      throw DruidException.defensive(\n          \"Task[%s] of type[%s] cannot allocate segments as it does not implement PendingSegmentAllocatingTask.\",\n          task.getId(), task.getType()\n      );\n    }","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentAllocateAction.java#L182-L218","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (runtime.properties)\ndruid.indexer.tasklock.batchedSegmentAllocation=false\n// after\ndruid.indexer.tasklock.batchedSegmentAllocation=true\ndruid.indexer.tasklock.batchedSegmentAllocation.allowList=[\"my-datasource\"]","handlingStrategy":"validation","validationCode":"boolean batchedEnabled = Boolean.parseBoolean(\n  System.getProperty(\"druid.indexer.tasklock.batchedSegmentAllocation\", \"false\"));\nif (!batchedEnabled) { /* fall back to non-batched allocation path or enable the flag */ }","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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."],"tags":["druid","segment-allocation","feature-flag","overlord"],"backgroundTag":"feature-not-enabled","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}