chia7712 commented on code in PR #23453:
URL: https://github.com/apache/kafka/pull/23453#discussion_r4481704888


##########
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:
   The bug is caused by the fact that we remove “all” providers from the 
configs, so the resolution doesn’t work even though these dynamic configs do 
need them.
   
   Hence, the fix should remove only the static providers instead.



-- 
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]

Reply via email to