{"record":{"id":"a5092c0b411b2ba8","repo":"apache/druid","slug":"received-creation-event-for-existing-entry-s","errorCode":null,"errorMessage":"Received creation event for existing entry: %s","messagePattern":"Received creation event for existing entry: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CachedMetadataCatalog.java","lineNumber":187,"sourceCode":"          );\n          break;\n        case PROPERTY_UPDATE:\n          cache.compute(\n              name,\n              (k, v) -> computePropertiesUpdate(v, table)\n          );\n          break;\n        default:\n          // Don't know what to do\n          return;\n      }\n      version = Math.max(version, table.updateTime());\n    }\n\n    private TableEntry computeCreate(TableEntry entry, TableMetadata update)\n    {\n      if (entry != null && entry.table != null) {\n        LOG.warn(\"Received creation event for existing entry: %s\", update.id().sqlName());\n        return computeUpdate(entry, update);\n      }\n      return new TableEntry(update);\n    }\n\n    private TableEntry computeUpdate(TableEntry entry, TableMetadata update)\n    {\n      if (!checkExists(entry, update)) {\n        return new TableEntry(update);\n      }\n      if (!checkVersion(entry, update)) {\n        return entry;\n      }\n      return new TableEntry(update);\n    }\n\n    private boolean checkExists(TableEntry entry, TableMetadata update)\n    {","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CachedMetadataCatalog.java#L169-L205","documentation":"CachedMetadataCatalog.computeCreate() warns when a creation event arrives for a table entry already present in the cache. Instead of blindly overwriting, it delegates to computeUpdate() so the existing entry is updated in place. This indicates duplicate CREATE notifications or a cache that was not cleared between events.","triggerScenarios":"A TableMetadata create event (via update() or resync()) arrives for a table whose TableEntry already exists with a non-null table value; duplicated event delivery from the catalog broker; a table recreated externally with the same SQL name while the cache retains the old entry.","commonSituations":"Duplicate catalog notifications after broker reconnect; dropped/late messages replayed by the message bus; dropping and recreating a table with the same name; stale cache not invalidated before resync.","solutions":["Usually benign: the code safely falls back to computeUpdate(); verify table contents are correct after the event.","If recurring, check the notifier/receiver for duplicate event delivery and ensure resync clears or reconciles entries.","Force a resync() of the catalog cache to converge with authoritative metadata.","Confirm the table was not dropped/recreated with the same name; if intentional, expect update semantics rather than a fresh entry."],"exampleFix":"// before\n// cache entry stale after table was recreated externally\n// after\ncatalog.resync(); // reconcile cache; creation event for existing entry then handled as update","handlingStrategy":"validation","validationCode":"if (catalogCache.getEntry(sqlName) != null) { treatAsUpdate(); } else { treatAsCreate(); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Call resync() after reconnecting to the catalog source to reconcile duplicates.","Ensure single delivery path for catalog events.","Drop-and-recreate of tables with the same name should be followed by a resync."],"tags":["cache","duplicate-event","catalog-sync","out-of-order"],"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"}