{"record":{"id":"0a0d5635cd966eac","repo":"apache/druid","slug":"not-running-cleanup-or-callbacks-for-non-existing","errorCode":null,"errorMessage":"Not running cleanup or callbacks for non-existing segment[%s] on server[%s]","messagePattern":"Not running cleanup or callbacks for non-existing segment\\[(.+?)\\] on server\\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java","lineNumber":715,"sourceCode":"      return PartialLoadProfile.forLoaded(loadSpec, fingerprint, loadedBytes);\n    }\n\n    private void removeSegment(final DataSegment segment, boolean fullSync)\n    {\n      if (druidServer.removeDataSegment(segment.getId()) != null) {\n        runSegmentCallbacks(\n            new Function<>()\n            {\n              @Override\n              public CallbackAction apply(SegmentCallback input)\n              {\n                return input.segmentRemoved(druidServer.getMetadata(), segment);\n              }\n            }\n        );\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 running cleanup or callbacks for non-existing segment[%s] on server[%s]\",\n            segment.getId(),\n            druidServer.getName()\n        );\n      }\n    }\n  }\n}\n","sourceCodeStart":697,"sourceCodeEnd":724,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java#L697-L724","documentation":"When a sync asks the view to remove a segment that is not present in the server's tracked inventory, the view skips cleanup and segmentRemoved callbacks. In a delta sync this indicates the data server announced a removal for a segment the view never recorded; in a full sync (post-reset) it is expected and silent.","triggerScenarios":"removeSegment is called from fullSync or deltaSync with a segment id absent from the druidServer's inventory, e.g. the data server's inventory list no longer contains a segment that was never added or was already removed.","commonSituations":"Dropped or out-of-order delta sync messages; a server was reset (fullSync baseline) while segments were concurrently dropped; duplicate drop announcements from the data server after a failed ack.","solutions":["Ignore if it occurs right after a fullSync/reset — expected during re-baselining.","If seen on delta syncs, restart the affected data server so its announced inventory matches reality.","Check for duplicate segment drop announcements in the data server logs.","Verify segment cleanup on the data server is not announcing drops twice."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (serverInventory.containsKey(segment.getId())) { view.removeSegment(...); } else { log.debug(\"Skip unknown segment {}\", segment.getId()); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat post-reset occurrences as expected","Check for duplicate drop announcements","Restart data servers whose deltas repeatedly desync"],"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"}