lucliu1108 commented on code in PR #23453:
URL: https://github.com/apache/kafka/pull/23453#discussion_r4486919197
##########
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala:
##########
@@ -429,15 +429,7 @@ class DynamicBrokerConfig(private val kafkaConfig:
KafkaConfig) extends Logging
newProps ++= staticBrokerConfigs
overrideProps(newProps, dynamicDefaultConfigs)
overrideProps(newProps, dynamicBrokerConfigs)
- // The 2-arg AbstractConfig ctor used for clamping enforces
org.apache.kafka.automatic.config.providers.
- // That allowlist is meant to gate providers supplied via dynamic config
changes, not ones already
- // declared in server.properties, which are trusted regardless of it.
Without this exclusion, a
- // statically-declared provider plus a restrictive allowlist would reject
every dynamic config
- // update below, not just provider-related ones.
- val propsForClamping = new java.util.HashMap[String,
String](newProps.asJava)
- propsForClamping.keySet().removeIf(k => k.startsWith("config.providers"))
- KafkaConfig.clampDynamicConfigs(propsForClamping)
- propsForClamping.forEach((k, v) => newProps(k) = v)
+ KafkaConfig.clampDynamicConfigs(newProps.asJava)
Review Comment:
Thanks for the clarification! I now follow the idea of resolving each
dynamic layer with its own providers, and keep the static provider out of the
resolution.
There is one difference from the draft: I kept the `config.providers*` keys
in the new broker config, so `DescribeConfigs` still reports `config.providers`
after a dynamic update and
`DynamicBrokerReconfigurationTest#testUpdatesUsingConfigProvider` keeps
passing, keeping the original behavior for describe.
To do that without instantiating the providers again, I added
`KafkaConfig.fromResolvedProps`, which passes `configProviderProps =
{config.providers: ""}`, so no provider is instantiated and the allowlist is
not applied again to values that are already resolved.
--
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]