geyanggang opened a new pull request, #14905:
URL: https://github.com/apache/gravitino/pull/14905
### What changes were proposed in this pull request?
- Add the optional catalog store option `gravitino.excludedCatalogs`
(`table.catalog-store.gravitino.gravitino.excludedCatalogs`). It is only
valid when
`gravitino.enableSessionCatalogSupport` is `true`, and otherwise fails
fast.
- In `GravitinoSessionCatalogStore`, excluded names are never resolved
against Gravitino:
`contains`, `getCatalog`, `listCatalogs`, and `removeCatalog` only consult
the in-memory store.
- Reject Gravitino-managed catalog types under excluded names in
`FactoryUtils#createCatalogFactoryHelper`, before Flink instantiates the
catalog. The
catalog store also rejects them as a fallback.
- Move `FlinkSupportsSessionCatalogIT`, which was not compiled by any module
after the
Flink version split, into `flink-common`, and run it on Flink 1.19 and
1.20.
- Document the option, and correct the "Name conflict" statement in the docs.
### Why are the changes needed?
With session catalog support enabled, `CREATE CATALOG` for a session catalog
fails if
Gravitino already has a catalog with the same name, because Flink's
`CatalogManager`
checks `CatalogStore#contains` first. Existing jobs that create native
catalogs, such as
Paimon, cannot keep their own configuration after the platform exposes the
same name
through Gravitino.
Changing `contains` alone is not enough, because Flink also uses it for
`DROP` and
`ALTER CATALOG`. An explicit exclusion keeps all operations consistent.
Flink also
instantiates and registers a catalog before storing it. Without the
factory-level check,
a rejected Gravitino-managed catalog stays registered on Flink 1.19 and
resolves the
excluded Gravitino catalog.
Fixes #14756
### Does this PR introduce _any_ user-facing change?
Yes. It adds the optional property
`table.catalog-store.gravitino.gravitino.excludedCatalogs`
(semicolon-separated, case-sensitive,
empty by default). Nothing changes when it is not set.
Excluding a name does not modify Gravitino metadata, and does not change
authorization. Session
catalogs use their own connector authentication, as before.
### How was this patch tested?
- Unit tests for the store, the factory option, and the factory-level check.
- `TestGravitinoSessionCatalogStoreWithCatalogManager` runs the store in a
real Flink
`TableEnvironment` (Gravitino store mocked) on Flink 1.19, 1.20, 2.1, and
2.2.
- `FlinkSupportsSessionCatalogIT119/120` run against a real Gravitino server
and Hive container.
- Full `-PskipITs` test runs for `flink-common`, `flink-1.19`, `flink-1.20`,
`flink-2.1`, `flink-2.2`.
- Regression: `FlinkHiveCatalogIT120`,
`FlinkPaimonLocalFileSystemBackendIT120`,
`FlinkIcebergHiveCatalogIT120`, `FlinkJdbcMysqlCatalogIT120`.
- `spotlessCheck`, `javadoc`, and the runtime jar tests.
--
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]