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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonMetadataOps.java:
##########
@@ -146,29 +146,26 @@ public void afterCreateDb() {
     }
 
     @Override
-    public void dropDbImpl(String dbName, boolean ifExists, boolean force) 
throws DdlException {
+    public boolean dropDbImpl(String dbName, boolean ifExists, boolean force) 
throws DdlException {
         try {
-            executionAuthenticator.execute(() -> {
-                performDropDb(dbName, ifExists, force);
-                return null;
-            });
+            return executionAuthenticator.execute(() -> performDropDb(dbName, 
ifExists, force));
         } catch (Exception e) {
             throw new DdlException(
                 "Failed to drop database: " + dbName + ", error message is:" + 
e.getMessage(), e);
         }
     }
 
-    private void performDropDb(String dbName, boolean ifExists, boolean force) 
throws DdlException {
+    private boolean performDropDb(String dbName, boolean ifExists, boolean 
force) throws DdlException {
         ExternalDatabase dorisDb = dorisCatalog.getDbNullable(dbName);
         if (dorisDb == null) {
             if (ifExists) {
                 LOG.info("drop database[{}] which does not exist", dbName);
                 // Database does not exist and IF EXISTS is specified; treat 
as no-op.
-                return;
+                return false;
             } else {
                 ErrorReport.reportDdlException(ErrorCode.ERR_DB_DROP_EXISTS, 
dbName);
                 // ErrorReport.reportDdlException is expected to throw 
DdlException.

Review Comment:
   [P1] Do not equate this unresolved no-op with having no retained local 
incarnation. In mode 2, a names refresh can observe an external drop and remove 
the lowercase mapping while the canonical `ExternalDatabase` (with a complete 
nested names cache and SDK state) remains in the independent object cache. An 
alternate-case `DROP DATABASE IF EXISTS` then returns `false` here, so the 
wrapper never reaches the new unresolved retirement in `afterDropDb`; a 
same-name recreation can restore the mapping and reuse that stale object. This 
is distinct from the ordinary uncached no-op in the earlier thread. Separate 
the remote-mutation/journaling decision from targeted local cleanup (and 
follower cleanup if needed), and cover a lost mode-2 mapping with a retained 
canonical database object.



-- 
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