apache/druid · error · ISE
Could not perform task action[retrieveUpgradedToSegmentIds]…
Error message
Could not perform task action[retrieveUpgradedToSegmentIds] to retrieve segment IDs which share load specs with segments being killed. Stopping kill task to avoid data loss in case the segment files are shared by other segments.
What it means
Analogous to the upgraded-from check: before killing segments the task queries which other segments share load specs with the victims (retrieveUpgradedToSegmentIds). Any exception from this task action aborts the kill, because deleting shared segment files would lose data for surviving segments.
Solutions
- Restore metadata store health / fix connectivity, then resubmit the kill task
- Reduce the kill interval or segment limit to shrink the action's work
- Upgrade/restart overlord and middle managers to matching versions if the failure began after an upgrade
Defensive patterns
Strategy: retry
Try / catch
try { killTask.submit(); } catch (ISE e) { if (e.getMessage().contains("retrieveUpgradedToSegmentIds")) { scheduleRetryWithBackoff(e.getCause()); } else { throw e; } } Prevention
- Keep overlord and middle managers on matching versions
- Limit kill task size to reduce action timeout risk
- Alert on metadata store errors during maintenance windows
When it happens
Trigger: The retrieveUpgradedToSegmentIds action throws during getKillableSegments — metadata store errors, action timeouts, connectivity failure to the Overlord — while computing segmentsToKillFromDeepStore.
Common situations: Metadata store outage or replication lag; oversized kill ranges causing long-running actions; overlord restart mid-action; version mismatch between overlord and task after an upgrade.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- Could not retrieve parent segment ids using task…
- Locks[ ] for task[ ] can't cover segments[ ]
- A-Not-B requires at least 1 sketch
- Access-Check-Result
- Action [ ] failed for worker [ ] with status ( )
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/ad94b6e8e078d6b5.
Report an issue: GitHub.
Appendix: source
Thrown at indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:497
);
if (response != null && response.getUpgradedToSegmentIds() != null) {
response.getUpgradedToSegmentIds().forEach((parent, children) -> {
if (!unusedSegments.keySet().containsAll(children)) {
// Do not kill segment if its load spec is shared by another segment
// which is not being killed.
LOG.info(
"Skipping kill of segments[%s] as its load spec is shared by segment IDs[%s].",
parentIdToUnusedSegments.get(parent), children
);
parentIdToUnusedSegments.remove(parent);
}
});
}
}
catch (Exception e) {
// Do not proceed with the kill of any segment as we cannot be sure if their
// load specs are shared by any other segment
throw new ISE(
e,
"Could not perform task action[retrieveUpgradedToSegmentIds] to retrieve"
+ " segment IDs which share load specs with segments being killed."
+ " Stopping kill task to avoid data loss in case the segment files"
+ " are shared by other segments."
);
}
// Filter using the used segment load specs as segment upgrades predate the above task action
return parentIdToUnusedSegments.values()
.stream()
.flatMap(Set::stream)
.filter(segment -> !isSegmentLoadSpecPresentIn(segment, usedSegmentLoadSpecs))
.collect(Collectors.toList());
}
/**
* @return true if the load spec of the segment is present in the given set ofView on GitHub (pinned to 9b90983fd2)