yuqi1129 commented on code in PR #12235:
URL: https://github.com/apache/gravitino/pull/12235#discussion_r3763047917


##########
core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java:
##########
@@ -339,20 +339,17 @@ public boolean dropSchema(NameIdentifier ident, boolean 
cascade) throws NonEmpty
             return droppedFromCatalog;
           }
 
-          // For the unmanaged schema, it could happen that the schema:
-          // 1. It's not found in the catalog (dropped directly from 
underlying sources)
-          // 2. It's found in the catalog but not in the store (not managed by 
Gravitino)
-          // 3. It's found in the catalog and the store (managed by Gravitino)
-          // 4. Neither found in the catalog nor in the store.
-          // In all situations, we try to delete the schema from the store, 
but we don't take the
-          // return value of the store operation into account. We only take 
the return value of the
-          // catalog into account.
-          try {
-            store.delete(ident, SCHEMA, true);
-          } catch (NoSuchEntityException e) {
-            LOG.warn("The schema to be dropped does not exist in the store: 
{}", ident, e);
-          } catch (Exception e) {
-            throw new RuntimeException(e);
+          // A false result can mean that the schema was renamed directly in 
the external catalog.
+          // Only remove the stored registration after the catalog confirms 
that this drop deleted
+          // the schema and its descendants.
+          if (droppedFromCatalog) {

Review Comment:
   The problem is that when `dropTable` returns `false`, it means it has been 
dropped, so we should not remove it from the gravitino store.  



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

Reply via email to