{"record":{"id":"b435299968886c64","repo":"apache/druid","slug":"dimensiondistributionphaserunner-has-been-stopped","errorCode":null,"errorMessage":"DimensionDistributionPhaseRunner has been stopped. %s","messagePattern":"DimensionDistributionPhaseRunner has been stopped\\. (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionParallelIndexTaskRunner.java","lineNumber":122,"sourceCode":"    allReportsProcessedPhaser.register();\n    executor.submit(() -> extractDistributionsFromReport(report));\n  }\n\n  /**\n   * Map from an interval to PartitionBoundaries calculated by applying the target\n   * row size on the final StringDistribution. The final distribution for an\n   * interval is obtained by merging the distributions reported by all the\n   * sub-tasks for that interval.\n   */\n  public Map<Interval, PartitionBoundaries> getIntervalToPartitionBoundaries(\n      DimensionRangePartitionsSpec partitionsSpec\n  )\n  {\n    waitToProcessPendingReports();\n\n    // Do not proceed if a shutdown has been requested\n    if (getStopReason() != null) {\n      throw new ISE(\"DimensionDistributionPhaseRunner has been stopped. %s\", getStopReason());\n    }\n\n    // Merge distributions only from succeeded sub-tasks\n    final Set<String> succeededTaskIds = super.getReports().keySet();\n    final Map<Interval, PartitionBoundaries> intervalToPartitions = new HashMap<>();\n    intervalToTaskIds.forEach(\n        (interval, subTaskIds) -> {\n          final File intervalDir = getIntervalDistributionDir(interval);\n          final StringDistributionMerger merger = new StringSketchMerger();\n          subTaskIds\n              .stream()\n              .filter(succeededTaskIds::contains)\n              .map(subTaskId -> readDistributionFromFile(intervalDir, subTaskId))\n              .forEach(merger::merge);\n          final StringDistribution mergedDistribution = merger.getResult();\n\n          final PartitionBoundaries partitions;\n          Integer targetRowsPerSegment = partitionsSpec.getTargetRowsPerSegment();","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionParallelIndexTaskRunner.java#L104-L140","documentation":"During the dimension-distribution phase of a range-partitioned parallel batch ingest, the runner checks whether a shutdown/stop has been requested before merging sub-task reports into partition boundaries. If stopGracefully() was called (due to an error elsewhere, supervisor cancellation, or task shutdown), it throws ISE reporting the stop reason.","triggerScenarios":"Calling getIntervalToPartitionBoundaries() after stopGracefully() was invoked on the runner - typically because a sibling sub-task failed and wrote a distribution file error, or the supervisor task was asked to stop.","commonSituations":"A multi-phase range partitioned batch job aborting mid-flight; one sub-task's distribution write failed causing graceful stop; operator killing the supervisor task while distribution collection was pending.","solutions":["Read the stop reason embedded in the message to find the root failure that caused graceful shutdown, and fix that first.","Retry the batch ingestion task; this error usually follows an earlier failure, not an input-config problem.","Check Overlord task logs for the sub-task that failed or was killed during the distribution phase."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { runner.getIntervalToPartitionBoundaries(...) } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"DimensionDistributionPhaseRunner has been stopped\")) { log.error(\"run aborted: {}\", e.getMessage()); /* retry whole supervisor task */ } else { throw e; } }","preventionTips":["Treat this as a downstream symptom: always investigate the earlier stop reason/root failure.","Avoid killing supervisor tasks mid-distribution-phase; cancel cleanly between phases.","Ensure worker disk space is sufficient so earlier phases don't fail and trigger graceful stop."],"tags":["druid","batch-ingestion","task-shutdown","range-partitioning"],"backgroundTag":"invalid-state-transition","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"}