geyanggang opened a new issue, #15073: URL: https://github.com/apache/gravitino/issues/15073
### What would you like to be improved? #14756 added `gravitino.excludedCatalogs`, so that a Flink job can create a session catalog (for example a native Paimon catalog) with the name of an existing Gravitino catalog. The option needs the conflicting names in advance: - Set per job, every existing job that creates such a catalog needs a configuration change. - Set cluster-wide, the listed Gravitino catalogs are hidden from every job, including jobs that rely on them. The names are often unknown, because catalogs are created in Gravitino independently of the jobs. ### How should we improve? Add an opt-in boolean option, `table.catalog-store.gravitino.gravitino.enableSessionCatalogShadowing` (default `false`, only valid with `enableSessionCatalogSupport=true`). It has no catalog names, so it can be set once cluster-wide: - `CREATE CATALOG` with a non-Gravitino-managed type creates a session catalog under the name of a Gravitino catalog that the session has not accessed. The session catalog shadows the Gravitino catalog in that session only. Jobs that do not create the catalog keep using the Gravitino catalog. - The shadowed Gravitino catalog is never loaded, modified, or dropped. Dropping the session catalog makes the Gravitino catalog visible again. As noted in #14756, Flink uses `CatalogStore#contains` both before creating a catalog (must be false) and before dropping or altering one (must be true). Reporting every Gravitino-only catalog as absent makes `DROP CATALOG` silently skip a Gravitino catalog that the session has used: on Flink 1.20, Flink reports success while `removeCatalog` is never called. To avoid this, the store tracks the Gravitino catalogs that the session has accessed (loaded or created), and those keep the existing behavior. Remaining differences, all opt-in and documented: - A Gravitino catalog that the session has accessed cannot be shadowed (`CREATE CATALOG` fails as today). - `DROP CATALOG` on a Gravitino catalog that the session has not accessed fails with `does not exist`, and `DROP CATALOG IF EXISTS` does nothing. Flink SQL never drops a Gravitino catalog that the session has not used. - Creating a Gravitino-managed type under the name of an existing Gravitino catalog fails, also with `IF NOT EXISTS`. -- 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]
