{"record":{"id":"070770dc86914289","repo":"apache/druid","slug":"not-adding-or-running-callbacks-for-existing-segme","errorCode":null,"errorMessage":"Not adding or running callbacks for existing segment[%s] on server[%s]","messagePattern":"Not adding or running callbacks for existing segment\\[(.+?)\\] on server\\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java","lineNumber":665,"sourceCode":"          runSegmentCallbacks(\n              new Function<>()\n              {\n                @Override\n                public CallbackAction apply(SegmentCallback input)\n                {\n                  return input.segmentAdded(druidServer.getMetadata(), theSegment);\n                }\n              }\n          );\n        } else if (!Objects.equals(druidServer.getPartialLoadProfile(segment.getId()), profile)) {\n          // Already present, but the per-server partial-load profile changed (e.g. the historical re-announced after\n          // an additive reload swapped the wrapper / fingerprint). Update the inventory state in place; the segment\n          // is still on this server, only the profile metadata changed, so don't fire segmentAdded/segmentRemoved\n          // callbacks\n          druidServer.updateDataSegmentProfile(segment, profile);\n        } else if (!fullSync) {\n          // duplicates can happen when doing a full sync from a 'reset', so only warn for dupes on delta changes\n          log.warn(\n              \"Not adding or running callbacks for existing segment[%s] on server[%s]\",\n              segment.getId(),\n              druidServer.getName()\n          );\n        }\n      }\n    }\n\n    /**\n     * Builds a {@link PartialLoadProfile} from a load announcement when the historical populated the partial-load\n     * wire fields ({@code fingerprint} + {@code loadedBytes}). Returns {@code null} for plain full-load\n     * announcements, or defensively when a fingerprint/loadedBytes pair arrives without a partial-load wrapper on\n     * the segment's load spec (a wire-form contract violation from the historical).\n     */\n    @Nullable\n    private static PartialLoadProfile partialLoadProfileFor(SegmentChangeRequestLoad loadRequest)\n    {\n      final String fingerprint = loadRequest.getFingerprint();","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java#L647-L683","documentation":"When a sync reports a segment that the server's inventory already contains, HttpServerInventoryView skips adding it and skips segmentAdded callbacks. For delta syncs this is unexpected enough to warn about; for full syncs duplicates are expected after a reset, so no warning is emitted.","triggerScenarios":"addSegment is called from fullSync or deltaSync with a segment whose id already exists on the druidServer and whose fingerprint/profile is unchanged; in delta sync this indicates the data server re-sent an already-known segment in its delta inventory.","commonSituations":"Data server sent a delta that overlaps with existing inventory after a dropped/partially-applied earlier delta; a 'reset' triggered a fullSync that re-delivers known segments (normal, silent); race between two sync responses for the same server.","solutions":["Ignore when it appears only after fullSync/reset — it is expected and benign.","If warnings recur on delta sync, restart the affected data server to re-baseline its segment inventory.","Check the data server's segment announcement logic for duplicate announcements of the same segment id.","Verify no middle-manager/task is publishing the same segment id concurrently (duplicate ingestion)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!serverInventory.containsKey(segment.getId())) { view.addSegment(...); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ignore warnings occurring right after a fullSync/reset","Investigate data servers emitting overlapping delta inventories","Watch for duplicate segment announcements in ingestion"],"tags":["druid","segment-inventory","callbacks","sync"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}