github-actions[bot] commented on code in PR #64043:
URL: https://github.com/apache/doris/pull/64043#discussion_r3345504982


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/PluginDrivenExternalCatalog.java:
##########
@@ -296,6 +297,25 @@ public void gsonPostProcess() throws IOException {
         }
     }
 
+    @Override
+    public void createDb(String dbName, boolean ifNotExists, Map<String, 
String> properties)
+            throws DdlException {
+        makeSureInitialized();
+        LOG.info("Creating database {} in catalog {} (ifNotExists={})", 
dbName, getName(), ifNotExists);
+        HashMap<String, String> props = new HashMap<>(properties);
+        props.put("jdbc_if_not_exists", String.valueOf(ifNotExists));
+        ConnectorSession session = buildConnectorSession();
+        connector.getMetadata(session).createDatabase(session, dbName, props);

Review Comment:
   This executes the remote CREATE DATABASE but leaves the initialized 
ExternalCatalog caches unchanged and also skips the edit-log replay hook used 
by the existing external DDL path. Because `makeSureInitialized()` has already 
loaded `metaCache`, `getDbNames()`/`SHOW DATABASES` will continue to return the 
old names until a manual `REFRESH CATALOG` or cache expiry; the new regression 
test explicitly refreshes after create/drop, so it hides this. Existing 
implementations go through `ExternalMetadataOps.createDb()`, then 
`afterCreateDb()` calls `resetMetaCacheNames()`, and 
`ExternalCatalog.createDb()` logs `CreateDbInfo` so followers replay the 
invalidation. Please invalidate/update the plugin-driven catalog cache after 
successful create and unregister/invalidate after successful drop, and add the 
corresponding edit-log/replay behavior or delegate through the same 
ExternalCatalog path so all FEs converge.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to