roryqi opened a new issue, #13770: URL: https://github.com/apache/gravitino/issues/13770
### Version main branch ### Describe what is wrong When multiple catalogs expose the same physical metadata, an external schema, table, or view may have the same persisted Gravitino identifier under different Gravitino paths. The current import logic may write the entity with overwrite enabled. Importing it through another path can therefore reassign the stored entity to a different catalog or schema. Privilege relationships reference stable entity IDs. Reassigning an entity can cause privileges to be reported or enforced under the wrong path, and repeated grants may create duplicate privilege records. External renames and entities exposed through multiple paths are ambiguous. Gravitino should not automatically overwrite an existing imported identity. ### Error message and/or stacktrace No exception is currently raised. The entity metadata may be silently reassigned, and role details may display privileges under the wrong catalog or schema. ### How to reproduce 1. Create two catalogs connected to the same Hive Metastore. 2. Access the same schema through the first catalog so it is imported. 3. Grant catalog and schema privileges to a role. 4. Access the same physical schema through the second catalog. 5. Retrieve the role details or repeat the grant. 6. Observe that the schema privilege may be reported under the second catalog or duplicated. The same unsafe overwrite behavior also applies when importing external tables and views with persisted Gravitino identifiers. ### Additional context Imports should use create-only writes. If the write conflicts, Gravitino should reload the entity to support normal HA import races. If the stored identity still does not match, it should report that external renames and multi-path identity conflicts require manual reconciliation. This intentionally trades automatic handling of external renames for metadata and privilege consistency. No automatic repair or migration of existing conflicting records is included because Gravitino cannot safely determine the canonical path. -- 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]
