junrao commented on code in PR #20844:
URL: https://github.com/apache/kafka/pull/20844#discussion_r2542981720
##########
docs/upgrade.html:
##########
@@ -137,11 +137,14 @@ <h5><a id="upgrade_420_notable"
href="#upgrade_420_notable">Notable changes in 4
<li>
LIST-type configurations now enforce stricter validation:
<ul>
- <li>Null values are no longer accepted for most LIST-type
configurations, except those that explicitly
- allow a null default value or where a null value has a
well-defined semantic meaning.</li>
- <li>Duplicate entries within the same list are no longer
permitted.</li>
- <li>Empty lists are no longer allowed, except in
configurations where an empty list has a well-defined
- semantic meaning.</li>
+ <li>Null values are no longer accepted for most LIST-type
configurations. Exceptions apply only to
+ configurations that have null as their default value,
as users cannot explicitly assign null values
Review Comment:
What's the behavior in 4.1 if a user sets a config value to null
dynamically? I am wondering if it fails somewhere. ConfigRecord doesn't seem to
support a null value since it indicates a deletion of the config.
```
{
"apiKey": 4,
"type": "metadata",
"name": "ConfigRecord",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "ResourceType", "type": "int8", "versions": "0+",
"about": "The type of resource this configuration applies to." },
{ "name": "ResourceName", "type": "string", "versions": "0+",
"about": "The name of the resource this configuration applies to." },
{ "name": "Name", "type": "string", "versions": "0+",
"about": "The name of the configuration key." },
{ "name": "Value", "type": "string", "versions": "0+",
"nullableVersions": "0+",
"about": "The value of the configuration, or null if the it should be
deleted." }
]
}
```
##########
clients/src/test/java/org/apache/kafka/common/config/ConfigDefTest.java:
##########
@@ -813,4 +834,24 @@ public void testListValidatorIn() {
ConfigException exception7 = assertThrows(ConfigException.class, () ->
notAllowEmptyValidator.ensureValid("test.config", List.of("a", "a")));
assertEquals("Configuration 'test.config' values must not be
duplicated.", exception7.getMessage());
}
+
+ @Test
+ public void testParseValueWillRemoveDuplicatesInValidList() {
Review Comment:
parse => parsed
--
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]