junrao commented on PR #20960:
URL: https://github.com/apache/kafka/pull/20960#issuecomment-3582470948

   It seems there is some inconsistency in handling the null config value in 
`admin.incrementalAlterConfigs`. In BootstrapControllersIntegrationTest, I 
changed `new ConfigEntry("my.custom.config", "foo")` to `new 
ConfigEntry("my.custom.config", null)` in testIncrementalAlterConfigs(). When I 
ran testIncrementalAlterConfigs() which uses bootstrap broker, the 
incrementalAlterConfigs request failed with the following. 
   
   ```
   java.util.concurrent.ExecutionException: 
org.apache.kafka.common.errors.InvalidRequestException: Null value not 
supported for : my.custom.config
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
        at 
org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:173)
        at 
org.apache.kafka.server.BootstrapControllersIntegrationTest.testIncrementalAlterConfigs(BootstrapControllersIntegrationTest.java:239)
        at 
org.apache.kafka.server.BootstrapControllersIntegrationTest.testIncrementalAlterConfigs(BootstrapControllersIntegrationTest.java:225)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.Optional.ifPresent(Optional.java:178)
        at 
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
   ```
   
   When I ran testIncrementalAlterConfigsByControllers() which uses bootstrap 
controller, the incrementalAlterConfigs request succeeded. I got a different 
error. The null value is ignored in the describe request, probably treating it 
as a delete.
   
   ```
   org.opentest4j.AssertionFailedError: Expected entry for my.custom.config to 
come from DYNAMIC_BROKER_CONFIG. Instead, the entry was: 
ConfigEntry(name=my.custom.config, value=Redacted, 
source=DYNAMIC_DEFAULT_BROKER_CONFIG, isSensitive=true, isReadOnly=true, 
synonyms=[], type=UNKNOWN, documentation=null) ==> 
   Expected :DYNAMIC_BROKER_CONFIG
   Actual   :DYNAMIC_DEFAULT_BROKER_CONFIG
   ```
   
   It seems that ConfigAdminManager (which is used only in the broker) has a 
check that rejects null config values in the Set operation. However, if the 
request is sent to the controller directly, there is no similar check. It would 
be useful to make the behavior consistent.


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