KAFKA-9046: Use top-level worker configs for connector admin clients#7525
KAFKA-9046: Use top-level worker configs for connector admin clients#7525C0urante wants to merge 4 commits intoapache:trunkfrom
Conversation
| connConfig.put("metadata.max.age.ms", "10000"); | ||
|
|
||
| Map<String, String> expectedConfigs = new HashMap<>(); | ||
| expectedConfigs.putAll(props); |
There was a problem hiding this comment.
The admin configs after overrides will contain both "admin.metadata.max.age.ms", and "metadata.max.age.ms", with different values. I feel like that might be confusing to debug. Could we include just the configs that don't start with "admin." prefix so they would not be overridden?
There was a problem hiding this comment.
Part of this test is to ensure that overrides happen as expected; leaving out to-be-overridden configs would leave that case uncovered. If anything, it might make sense to expand the tests here to make sure that three distinct sources of configs for the admin client are recognized and handled with the expected precedence. In ascending order, that would be: from the worker config with no prefix, from the worker config with a (stripped) prefix of admin., and from the connector config with a (stripped) prefix of admin.override..
There was a problem hiding this comment.
Or are you suggesting changes in the actual Worker class as opposed to this test class?
There was a problem hiding this comment.
Oh, yeah, the comment was not about the test, just happen to realize this when looking at the testcase. Could we have something like originalsWithoutPrefix on AbstractConfig and use it to pre-populate adminProps with just original configs not containing override ones? Or even just calling originalsWithPrefix without stripping the prefix and removing those keys from adminProps
There was a problem hiding this comment.
Yeah, that should be fine. Probably not worth it to alter the AbstractConfig since that's public API but engaging in some effort to make sure that both admin.foo and foo aren't present in the props given to the admin client seems like a good idea.
|
Thanks, @ncliang. I've incorporated your suggestion of not including |
| Map<String, String> expectedConfigs = new HashMap<>(); | ||
| expectedConfigs.putAll(props); | ||
| expectedConfigs.remove("admin.client.id"); | ||
| expectedConfigs.remove("admin.metadata.max.age.ms"); |
There was a problem hiding this comment.
nit: these 2 are added by the testcase just a few lines above. You can construct expectedConfigs from workerProps directly.
|
Thanks for the discussion, @rhauch and @kkonstantine. Adding a check to prevent producer and consumer properties from being passed to the admin client seems safe enough, so I've added one in my latest commit. LMK what you think. |
|
Just to be thoroughly transparent, in AK 2.2 the In AK 2.3 this changed to compute the admin properties just from the This change reverts the behavior so that the worker config properties (minus any After merging, this should be backported to the |
|
@rhauch the only failure on the JDK8/Scala 2.11 branch appears to be unrelated: |
[Jira](https://issues.apache.org/jira/browse/KAFKA-9046) The changes here are meant to find a healthy compromise between the pre- and post-KIP-458 functionality of Connect workers when configuring admin clients for use with DLQs. Before KIP-458, admin clients were configured using the top-level worker configs; after KIP-458, they are configured using worker configs with a prefix of `admin.` and then optionally overridden by connector configs with a prefix of `admin.override.`. The behavior proposed here is to use, in ascending order of precedence, the top-level worker configs, worker configs prefixed with `admin.`, and connector configs prefixed with `admin.override.`; essentially, use the pre-KIP-458 behavior by default but allow it to be overridden by the post-KIP-458 behavior. Author: Chris Egerton <chrise@confluent.io> Reviewers: Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>, Nigel Liang <nigel@nigelliang.com> Closes #7525 from C0urante/kafka-9046 (cherry picked from commit 38d243b) Signed-off-by: Manikumar Reddy <manikumar@confluent.io>
[Jira](https://issues.apache.org/jira/browse/KAFKA-9046) The changes here are meant to find a healthy compromise between the pre- and post-KIP-458 functionality of Connect workers when configuring admin clients for use with DLQs. Before KIP-458, admin clients were configured using the top-level worker configs; after KIP-458, they are configured using worker configs with a prefix of `admin.` and then optionally overridden by connector configs with a prefix of `admin.override.`. The behavior proposed here is to use, in ascending order of precedence, the top-level worker configs, worker configs prefixed with `admin.`, and connector configs prefixed with `admin.override.`; essentially, use the pre-KIP-458 behavior by default but allow it to be overridden by the post-KIP-458 behavior. Author: Chris Egerton <chrise@confluent.io> Reviewers: Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>, Nigel Liang <nigel@nigelliang.com> Closes #7525 from C0urante/kafka-9046 (cherry picked from commit 38d243b) Signed-off-by: Manikumar Reddy <manikumar@confluent.io>
|
Merged the PR to trunk, 2.4, 2.3 branches |
|
Thanks, @omkreddy! |
Jira
The changes here are meant to find a healthy compromise between the pre- and post-KIP-458 functionality of Connect workers when configuring admin clients for use with DLQs. Before KIP-458, admin clients were configured using the top-level worker configs; after KIP-458, they are configured using worker configs with a prefix of
admin.and then optionally overridden by connector configs with a prefix ofadmin.override.. The behavior proposed here is to use, in ascending order of precedence, the top-level worker configs, worker configs prefixed withadmin., and connector configs prefixed withadmin.override.; essentially, use the pre-KIP-458 behavior by default but allow it to be overridden by the post-KIP-458 behavior.Committer Checklist (excluded from commit message)