{"record":{"id":"4f81774fe3f9cde3","repo":"apache/druid","slug":"failed-eager-download-of-rule-selected-bundles-for","errorCode":null,"errorMessage":"Failed eager download of rule-selected bundles for segment[%s]; cleared partial-load rule","messagePattern":"Failed eager download of rule-selected bundles for segment\\[(.+?)\\]; cleared partial-load rule","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java","lineNumber":1243,"sourceCode":"        // Signal cancel WITHOUT interrupt — see cancel(false) comment above; interrupting mid-NIO closes the\n        // shared mapper FD.\n        f.cancel(false);\n      }\n      catch (ExecutionException e) {\n        firstFailure = e.getCause() != null ? e.getCause() : e;\n      }\n      catch (CancellationException e) {\n        // Defensive: shouldn't reach here on the first-failure branch (we only cancel after firstFailure is set),\n        // but if it does, treat it uniformly.\n        firstFailure = e;\n      }\n    }\n\n    if (firstFailure != null) {\n      // Any late-completing pool task that still succeeds after we've cleared the rule will call registerBundle →\n      // observing ruleSelectedBundleNames == {} and skipping the rule-hold acquire.\n      metadata.clearRule();\n      throw new SegmentLoadingException(\n          firstFailure,\n          \"Failed eager download of rule-selected bundles for segment[%s]; cleared partial-load rule\",\n          dataSegment.getId()\n      );\n    }\n  }\n\n  /**\n   * Materialize the segment's wrapped load spec to a {@link PartialLoadSpec}.\n   */\n  private PartialLoadSpec materializePartialLoadSpec(DataSegment dataSegment) throws SegmentLoadingException\n  {\n    final LoadSpec materializedLoadSpec;\n    try {\n      materializedLoadSpec = jsonMapper.convertValue(dataSegment.getLoadSpec(), LoadSpec.class);\n    }\n    catch (Exception e) {\n      throw new SegmentLoadingException(","sourceCodeStart":1225,"sourceCodeEnd":1261,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java#L1225-L1261","documentation":"When eager-downloading rule-selected bundles for a partial-load segment, SegmentLocalCacheManager collects failures across the download pool. On the first failure it clears the applied partial-load rule (so late successes are not held) and throws this SegmentLoadingException describing the segment and failure.","triggerScenarios":"Eager bundle download for a segment's partial-load rule fails — deep-storage fetch errors (S3/HTTP timeouts, 404/403), pool task exceptions, or network interruptions — leaving firstFailure non-null.","commonSituations":"Deep storage briefly unavailable or throttled; misconfigured rule selecting bundles that don't exist; network flakiness between historical and deep storage; credentials expiring mid-download.","solutions":["Inspect firstFailure (the wrapped cause) for the underlying download error and fix it (network, credentials, deep-storage health).","Verify the partial-load rule selects valid, existing bundles in deep storage.","Retry the load; ensure retries/backoff on deep-storage access are configured sensibly.","Check deep-storage credentials and bucket/container configuration (e.g. druid.s3.accessKey, endpoint settings)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight: verify rule-selected bundles exist in deep storage before eager download\nfor (final String bundle : ruleSelectedBundleNames) {\n  if (!deepStorage.objectExists(bucket, bundle)) {\n    throw new IllegalStateException(\"Rule-selected bundle missing in deep storage: \" + bundle);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  cacheManager.loadPartial(segment, rule);\n} catch (SegmentLoadingException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Failed eager download\")) {\n    retryWithBackoff(e); // deep-storage/network transients; rule was cleared, so re-apply cleanly\n  } else {\n    throw e;\n  }\n}","preventionTips":["Ensure deep-storage credentials and connectivity are stable (token refresh, VPC endpoints).","Validate partial-load rules select existing bundles.","Configure HTTP/S3 client retries and timeouts for deep-storage access.","Use coordinator retries rather than immediate re-submission after failures."],"tags":["network","download","partial-load","deep-storage"],"backgroundTag":"upstream-api-error","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"}