[ 
https://issues.apache.org/jira/browse/KAFKA-10140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17143449#comment-17143449
 ] 

Chia-Ping Tsai commented on KAFKA-10140:
----------------------------------------

It seems to me users should be aware of the config they are trying to append or 
subtract. If the kind of config is NOT list, it is nice to produce quick 
failure. If we can't get the type of config, we should do what users want to do 
rather than obstruct users from doing anything.

For another, there are two minor we can address before truly resolving this one.

1. add comment to Admin#incrementalAlterConfigs to remind users that both 
APPEND and SUBTRACT don't work for plugin components' configs.
2. replace NoSuchElementException by InvalidConfigurationException. the later 
is what we should throw.

[~ijuma] WDYT?

> Incremental config api excludes plugin config changes
> -----------------------------------------------------
>
>                 Key: KAFKA-10140
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10140
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Jason Gustafson
>            Priority: Critical
>             Fix For: 2.6.0
>
>
> I was trying to alter the jmx metric filters using the incremental alter 
> config api and hit this error:
> ```
> java.util.NoSuchElementException: key not found: metrics.jmx.blacklist
>       at scala.collection.MapLike.default(MapLike.scala:235)
>       at scala.collection.MapLike.default$(MapLike.scala:234)
>       at scala.collection.AbstractMap.default(Map.scala:65)
>       at scala.collection.MapLike.apply(MapLike.scala:144)
>       at scala.collection.MapLike.apply$(MapLike.scala:143)
>       at scala.collection.AbstractMap.apply(Map.scala:65)
>       at kafka.server.AdminManager.listType$1(AdminManager.scala:681)
>       at 
> kafka.server.AdminManager.$anonfun$prepareIncrementalConfigs$1(AdminManager.scala:693)
>       at 
> kafka.server.AdminManager.prepareIncrementalConfigs(AdminManager.scala:687)
>       at 
> kafka.server.AdminManager.$anonfun$incrementalAlterConfigs$1(AdminManager.scala:618)
>       at 
> scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:273)
>       at scala.collection.immutable.Map$Map1.foreach(Map.scala:154)
>       at scala.collection.TraversableLike.map(TraversableLike.scala:273)
>       at scala.collection.TraversableLike.map$(TraversableLike.scala:266)
>       at scala.collection.AbstractTraversable.map(Traversable.scala:108)
>       at 
> kafka.server.AdminManager.incrementalAlterConfigs(AdminManager.scala:589)
>       at 
> kafka.server.KafkaApis.handleIncrementalAlterConfigsRequest(KafkaApis.scala:2698)
>       at kafka.server.KafkaApis.handle(KafkaApis.scala:188)
>       at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:78)
>       at java.base/java.lang.Thread.run(Thread.java:834)
> ```
> It looks like we are only allowing changes to the keys defined in 
> `KafkaConfig` through this API. This excludes config changes to any plugin 
> components such as `JmxReporter`. 
> Note that I was able to use the regular `alterConfig` API to change this 
> config.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to