{"record":{"id":"d3608163127f6e7a","repo":"apache/druid","slug":"requested-delete-of-lookup-s-s-but-lookup-do","errorCode":null,"errorMessage":"Requested delete of lookup [%s]/[%s] but lookup does not exist!","messagePattern":"Requested delete of lookup \\[(.+?)\\]/\\[(.+?)\\] but lookup does not exist!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java","lineNumber":295,"sourceCode":"  public boolean deleteLookup(final String tier, final String lookup, AuditInfo auditInfo)\n  {\n    Preconditions.checkState(lifecycleLock.awaitStarted(5, TimeUnit.SECONDS), \"not started\");\n\n    synchronized (this) {\n      final Map<String, Map<String, LookupExtractorFactoryMapContainer>> priorSpec = getKnownLookups();\n      if (priorSpec == null) {\n        LOG.warn(\"Requested delete lookup [%s]/[%s]. But no lookups exist!\", tier, lookup);\n        return false;\n      }\n      final Map<String, Map<String, LookupExtractorFactoryMapContainer>> updateSpec = new HashMap<>(priorSpec);\n      final Map<String, LookupExtractorFactoryMapContainer> priorTierSpec = updateSpec.get(tier);\n      if (priorTierSpec == null) {\n        LOG.warn(\"Requested delete of lookup [%s]/[%s] but tier does not exist!\", tier, lookup);\n        return false;\n      }\n\n      if (!priorTierSpec.containsKey(lookup)) {\n        LOG.warn(\"Requested delete of lookup [%s]/[%s] but lookup does not exist!\", tier, lookup);\n        return false;\n      }\n\n      final Map<String, LookupExtractorFactoryMapContainer> updateTierSpec = new HashMap<>(priorTierSpec);\n      updateTierSpec.remove(lookup);\n\n      if (updateTierSpec.isEmpty()) {\n        updateSpec.remove(tier);\n      } else {\n        updateSpec.put(tier, updateTierSpec);\n      }\n      return configManager.set(LOOKUP_CONFIG_KEY, updateSpec, auditInfo).isOk();\n    }\n  }\n\n  public Set<String> discoverTiers()\n  {\n    Preconditions.checkState(lifecycleLock.awaitStarted(5, TimeUnit.SECONDS), \"not started\");","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java#L277-L313","documentation":"LookupCoordinatorManager.deleteLookup() logs this warning and returns false when the tier exists but the named lookup is not in it (priorTierSpec.containsKey(lookup) is false). The delete is a no-op and the config is left unchanged.","triggerScenarios":"deleteLookup(tier, lookup) is called with a lookup name not present in the tier's lookup map — typo, already-deleted lookup, or lookup configured under a different tier.","commonSituations":"Repeated DELETE calls after the lookup was already removed; automation scripts using stale lookup names; case-sensitivity mismatches in lookup names.","solutions":["List lookups in the tier via GET /druid/coordinator/v1/lookups/{tier} to confirm the exact name.","Treat the false return as idempotent success if the desired end state is 'lookup absent'.","Fix the lookup name (case-sensitive) in the client.","Guard automation against double-deletes by checking existence first or tolerating the false return."],"exampleFix":"// before\nmanager.deleteLookup(\"__default\", \"Country\"); // wrong case\n// after\nmanager.deleteLookup(\"__default\", \"country\");","handlingStrategy":"validation","validationCode":"Map<String, Map<String, Object>> config = coordinatorManager.getKnownLookups();\nboolean exists = config != null\n    && config.getOrDefault(tier, Collections.emptyMap()).containsKey(lookup);\nif (!exists) { /* lookup absent: skip or treat as success */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List lookups in the tier before deleting.","Mind case-sensitivity of lookup names.","Make delete jobs idempotent with respect to false returns.","Avoid double-deletes by checking state first."],"tags":["lookups","coordinator","delete","not-found"],"backgroundTag":"resource-not-found","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"}