KAFKA-8265: Initial implementation for ConnectorClientConfigPolicy to enable overrides (KIP-458)#6624
Conversation
There was a problem hiding this comment.
By not including these prefixes, might some of these collide where the values are distinct? Also, we need to be careful that we don't pass non-producer properties to the ProducerConfig, or else it will log them as a warning. Won't excluding the prefixes here make it more difficult to prevent those warnings?
There was a problem hiding this comment.
These are the configs that are passed to policy implementation. So, I'm not sure I completely understand your concern here.
There was a problem hiding this comment.
I guess what seems strange is that we're removing the prefixes for the client overrides, but otherwise this is the raw connector configuration, at which point some of the overrides might conflict with some of the connector-specific configs. Also, some of the producer overrides might conflict with some of the admin overrides. Isn't the point of having the client override prefixes is to make sure we have no conflicts, and aren't we losing that here?
There was a problem hiding this comment.
But we are returning just the client configs here not the complete connector configs. So, there are no conflicts here.
There was a problem hiding this comment.
Seems like there's a fair amount of boilerplate here, amongst all of the policy unit tests. How about a base class that defines an validateWithPolicy(clientConfig) (or something similar), so that it's more clear what each test is checking.
rhauch
left a comment
There was a problem hiding this comment.
Nice work. A few more comments, and I resolved most of the questions/conversations.
There was a problem hiding this comment.
Missing a period between sentences, and have an extra > character.
Also seems like we should mention that custom implementations are allowed.
There was a problem hiding this comment.
That was not clear from the KIP or the interface docs, because the request provides a map of values but it's always a singleton. If I were implementing a policy, I would not have expected one property at a time. Plus, this provides no way for the implementation to actually check any combination of values, should that ever be required (we don't use that in the built-in implementations).
I'm not sure what can be done at this point, given the use of PVE to pass the message. It would have been much better to pass in a component with which the implementation could have recorded errors for one or more configuration properties.
There was a problem hiding this comment.
We need unit tests for this.
rhauch
left a comment
There was a problem hiding this comment.
One minor correction, but otherwise looks good.
…rides KIP-458 - Connector Client config override policy KIP-458 - Connector Client config override policy Fix checkstyle
Fix review comments Fix review comments
…olicy/ConnectorClientConfigOverridePolicy.java Co-Authored-By: Randall Hauch <rhauch@gmail.com>
|
I rebased on the latest |
|
One job passed and the other looked like it was going to pass and then it ran into what looks like a gradle bug:
Will go ahead and merge since @rhauch approved. |
| } | ||
|
|
||
| public static ConfigDef configDef() { | ||
| return CONFIG; |
There was a problem hiding this comment.
That's a good point @ijuma. What do you think about returning a copy like
public static ConfigDef configDef() {return new ConfigDef(CONFIG); }
… enable overrides (KIP-458) (apache#6624) Implementation to enable policy for Connector Client config overrides. This is implemented per the KIP-458. Reviewers: Randall Hauch <rhauch@gmail.com>
Implementation to enable policy for Connector Client config overrides. This is implemented per the KIP-458.
Committer Checklist (excluded from commit message)