geyanggang commented on code in PR #14963:
URL: https://github.com/apache/gravitino/pull/14963#discussion_r4596623014
##########
docs/kafka-catalog.md:
##########
@@ -20,7 +20,28 @@ Besides the [common catalog
properties](./gravitino-server-config.md#catalog-pro
| Property Name | Description
|
Default Value | Required |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|
| `bootstrap.servers` | The Kafka broker(s) to connect to, allowing for
multiple brokers by comma-separating them.
|
(none) | Yes |
-| `gravitino.bypass.` | Property name with this prefix passed down to the
underlying Kafka Admin client for use. (refer to [Kafka Admin
Configs](https://kafka.apache.org/34/documentation.html#adminclientconfigs) for
more details) | (none) | No |
+| `gravitino.bypass.` | Property name with this prefix passed down to the
underlying Kafka Admin client for use. (refer to [Kafka Admin
Configs](https://kafka.apache.org/39/configuration/admin-configs/) for more
details) | (none) | No |
+
+The Kafka catalog rejects the Kafka config provider properties
`gravitino.bypass.config.providers`
+and `gravitino.bypass.config.providers.*` (for example
`gravitino.bypass.config.providers.file.class`),
+because a provider can read the Gravitino server's own environment and files.
Creating a catalog,
+testing a connection, or altering a catalog with these properties fails with
an error naming them.
+This includes properties that come from `catalogs/kafka/conf/kafka.conf`, so a
provider property in
+that file blocks the creation of every Kafka catalog. A catalog created before
upgrading that still
+has them fails on schema and topic operations until they are removed.
+
+:::caution Credentials in bypass properties
+Bypass properties can be returned in plaintext by the catalog REST API.
Gravitino masks only keys
+whose names match [sensitive key
keywords](./gravitino-server-config.md#sensitive-property-key-matching),
+so `gravitino.bypass.ssl.truststore.password` is masked but a password inside
Review Comment:
Confirmed and fixed in 3c84bdbe2. Both pages now say the masking example
holds "with the default keywords" and that
`gravitino.secret.sensitiveKeyKeywords` replaces the default list, so what is
masked depends on the server configuration.
##########
docs/migration-guide.md:
##########
@@ -69,6 +69,67 @@ and shutdown steps in [Upgrade
Gravitino](./how-to-upgrade.md) before applying t
whole Kubernetes pod CIDR, lets those clients choose the recorded address
again. See
[HTTP Server](./gravitino-server-config.md#http-server).
+### Kafka catalog client upgrade
+- The Kafka catalog now ships the Kafka client 3.9.2 instead of 3.4.0. The
`gravitino.bypass.`
+ properties are passed to this client, so check them against the
+ [Kafka Admin
Configs](https://kafka.apache.org/39/configuration/admin-configs/).
+- The Kafka catalog rejects `gravitino.bypass.config.providers` and every
+ `gravitino.bypass.config.providers.*` property (for example `.class` and
`.param.*`), each on its
+ own. Kafka 3.5 added an environment variable config provider, and any
provider can read the
+ Gravitino server's own environment or files. In 1.3, the file and directory
providers could be
+ used through these properties. After the upgrade:
+ - Creating, testing, or altering a catalog with any of them is rejected with
an error that names
+ them. This includes values from `catalogs/kafka/conf/kafka.conf`, so one
provider property in
+ that file blocks the creation of every Kafka catalog.
+ - An existing catalog that still has any of them fails on schema and topic
operations and on
+ `testConnection` until they are removed.
+- `kafka.conf` values are copied into the properties of each catalog when it
is created. Editing
+ or removing the file later does not change existing catalogs, which must be
updated with
+ `alterCatalog`.
+- Before upgrading, while still on 1.3, take an inventory:
+ 1. List every Kafka catalog and `kafka.conf` that has
`gravitino.bypass.config.providers` or any
+ `gravitino.bypass.config.providers.*` property. Include catalogs that
have only
+ `gravitino.bypass.config.providers.*` keys: they must be removed even
when nothing refers to
+ them.
+ 2. Read the provider aliases from `gravitino.bypass.config.providers`. Its
value is a
+ comma-separated list of aliases chosen by the operator, for example
`file`, `env`, or
+ `fileProvider`. For each alias, search the property values for
`${<alias>:...}` references.
+ Searching only for `${file:`, `${directory:`, or `${env:` misses custom
aliases. See
+ [Kafka configuration
providers](https://kafka.apache.org/39/configuration/configuration-providers/).
+ 3. Record the value each reference resolves to, and whether it is a
credential.
+- Before starting the 2.0 server, update `catalogs/kafka/conf/kafka.conf`:
+ - Remove all provider properties.
+ - Replace every non-sensitive `${<alias>:...}` reference with the value it
resolved to, for
+ example a timeout. Removing only the provider properties leaves the
reference unresolved,
+ and a new catalog inherits the literal `${...}` text. A numeric option
such as
+ `gravitino.bypass.request.timeout.ms` then fails to connect because the
Kafka client cannot
+ parse it. A string option such as
`gravitino.bypass.metrics.context.region` is kept as the
+ literal placeholder and a connection test can still succeed, so replace
every reference even
+ when the connection test passes.
+ - Remove every credential-bearing setting from the file and bind it per
catalog after the
+ upgrade (see below). Keep only non-sensitive defaults in this file,
because its values become
+ catalog properties that can be returned by the REST API.
+- After upgrading to 2.0, update each affected catalog with one `alterCatalog`
call that removes
+ all of its provider properties and replaces every reference. An
`alterCatalog` call that leaves
+ any provider property in place is rejected, including a comment-only change.
Until this update,
+ the catalog cannot run Kafka operations, so apply it right after the upgrade.
+ - Set a non-sensitive value, such as a timeout, as a literal value.
+ - Do not set a credential as a literal value. Bypass properties can be
returned in plaintext by
+ the REST API: Gravitino masks only keys that match
+ [sensitive key
keywords](./gravitino-server-config.md#sensitive-property-key-matching), so a
+ password inside `gravitino.bypass.sasl.jaas.config` is returned unchanged.
With a Gravitino
+ secret provider configured, bind the whole property with
`CatalogChange.setSecretBinding`
Review Comment:
Confirmed and fixed in 3c84bdbe2. `SecretProvider.writeSecretVersion` throws
by default, so `setSecretBinding` needs a provider with versioned writes. The
migration guide and the Kafka catalog page now cover
`CatalogChange.setSecretReference` (REST `setSecretReference`) for an external
secret that holds the whole property value, say that a `setSecretBinding` call
fails with a reference-only provider and leaves the catalog unable to run Kafka
operations, and tell operators to record the secret locator during the
inventory. I checked both methods against `CatalogChange` and `catalogs.yaml`.
--
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]