mchades commented on code in PR #13771:
URL: https://github.com/apache/gravitino/pull/13771#discussion_r4245760817


##########
core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java:
##########
@@ -665,7 +677,9 @@ private void importSchema(NameIdentifier identifier) {
                     .build())
             .build();
     try {
-      store.put(schemaEntity, true);
+      // Never overwrite imported schema metadata. In particular, an overwrite 
by stable ID can
+      // silently change catalog ownership and make existing privileges refer 
to the wrong path.
+      store.put(schemaEntity, false);

Review Comment:
   **[P1] Handle deleted registrations before rejecting an import**
   
   Removing and re-registering a Hive catalog containing a schema created 
through Gravitino now leaves that schema unloadable. Catalog removal 
soft-deletes the schema/table rows, but Hive retains their 
`gravitino.identifier` values and the deleted rows retain those primary keys. 
This insert therefore conflicts, while the reload excludes deleted rows, so 
loading the schema and its tables remains blocked until physical garbage 
collection removes them (seven-day default retention), despite no live catalog 
owning the identity. Distinguish deleted registrations from active identity 
conflicts here and in table import, and cover catalog removal/re-registration 
using the relational 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