{"record":{"id":"db0fd275cf75f2d8","repo":"apache/druid","slug":"failed-to-publish-segments","errorCode":null,"errorMessage":"Failed to publish segments","messagePattern":"Failed to publish segments","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java","lineNumber":1249,"sourceCode":"      // segment metrics:\n      emitMetric(toolbox.getEmitter(), \"ingest/tombstones/count\", tombStones.size());\n      emitMetric(toolbox.getEmitter(), \"ingest/segments/count\", newSegments.size());\n      emitMetric(toolbox.getEmitter(), \"ingest/rows/published\", IndexTaskUtils.getTotalRowCount(newSegments));\n      // If partitionsSpec is range or hash, we emit info about the size in rows of generated partitions, to detect a hot partition.\n      if ((type == SecondaryPartitionType.RANGE || type == SecondaryPartitionType.HASH) && maxRowsPerSegment != null) {\n        oversizedSegments = IndexTaskUtils.getOversizedSegments(newSegments, maxRowsPerSegment, DEFAULT_OVERSIZE_RATIO);\n        if (oversizedSegments > 0) {\n          LOG.warn(\n              \"Published [%d] oversized segments with more than (maxRowsPerSegment [%d] x ratio [%s]) rows.\",\n              oversizedSegments,\n              maxRowsPerSegment,\n              DEFAULT_OVERSIZE_RATIO\n          );\n          emitMetric(toolbox.getEmitter(), \"ingest/segments/oversized\", oversizedSegments);\n        }\n      }\n    } else {\n      throw new ISE(\"Failed to publish segments\");\n    }\n\n    segmentsPublished = (long) newSegments.size();\n  }\n\n  private TaskStatus runSequential(TaskToolbox toolbox) throws Exception\n  {\n    IndexTask sequentialIndexTask = new IndexTask(\n        getId(),\n        getGroupId(),\n        getTaskResource(),\n        getDataSource(),\n        baseSubtaskSpecName,\n        new IndexIngestionSpec(\n            getIngestionSchema().getDataSchema(),\n            getIngestionSchema().getIOConfig(),\n            convertToIndexTuningConfig(getIngestionSchema().getTuningConfig())\n        ),","sourceCodeStart":1231,"sourceCodeEnd":1267,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java#L1231-L1267","documentation":"Thrown in the supervisor task's segment-publish path when the publish result indicates segments were not published (the success branch condition failed). After a sequential/single-phase run completes, publishSegments must report success; otherwise the task aborts with this generic ISE.","triggerScenarios":"Task complete report arrives without a 'published segments' payload (success == false) — e.g. the segment publisher failed, metadata store transaction failed, or the task report is missing the publish section.","commonSituations":"Metadata store (derby/mysql/postgres) connectivity problems during publish; overlord unable to commit segments; timeouts in segment loading/announce; task reports lost due to overlord restart.","solutions":["Check overlord and task logs for the underlying publish failure (metadata store errors, timeouts).","Verify the metadata store is reachable and has capacity; fix connectivity and rerun the task.","Look for 'published segments' in the task report via the UI to confirm what the publisher returned.","Retry the ingestion task; published segments are idempotent per segment version."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (ISE e) {\n  if (\"Failed to publish segments\".equals(e.getMessage())) {\n    // check overlord/metadata-store health, then resubmit the task (publish is idempotent)\n  }\n}","preventionTips":["Ensure metadata store (derby/mysql/postgres) is reachable and healthy","Watch overlord logs during publish phase","Avoid overlord restarts mid-task; use HA overlord setup","Retry failed batch tasks — segment publishing is version-idempotent"],"tags":["segment-publish","parallel-ingestion","metadata-store"],"backgroundTag":"http-request-failed","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"}