m1a2st commented on code in PR #21005:
URL: https://github.com/apache/kafka/pull/21005#discussion_r2598896453
##########
core/src/main/scala/kafka/server/ControllerApis.scala:
##########
@@ -792,6 +782,32 @@ class ControllerApis(
}
}
+ private def addConfigChangesOrHandleDuplicate(
+ configResource: ConfigResource,
+ resource: IncrementalAlterConfigsRequestData.AlterConfigsResource,
+ duplicateResources: util.HashSet[ConfigResource],
+ configChanges: util.HashMap[ConfigResource, util.Map[String,
Entry[AlterConfigOp.OpType, String]]],
+ response: IncrementalAlterConfigsResponseData
+ ): Unit = {
+ if (!duplicateResources.contains(configResource)) {
Review Comment:
The old logic worked in three steps:
1. The first occurrence of a configResource is added to the map.
2. The second occurrence of the same configResource is removed from the map,
added to duplicateValue, and written to the response.
3. The third and any subsequent occurrences of that configResource are
ignored entirely.
Given this behavior, I think we cannot rely solely on a map to implement
this logic.
--
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]