Trogdor: Added commonClientConf and adminClientConf to workload specs#4757
Conversation
| SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, | ||
| SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, | ||
| SslConfigs.SSL_PROTOCOL_CONFIG, | ||
| SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG |
There was a problem hiding this comment.
Can you not use .withClientSslSupport().withClientSaslSupport()?
There was a problem hiding this comment.
I did not know about those methods. Let me look. Thanks!
…coding sasl and ssl related keys
|
Thanks, seems reasonable. Maybe we should have a clientConfig field in the Spec which describes all the configuration keys which are common to all clients (admin, producer, consumer). That might be simpler than trying to maintain whitelists of configuration keys that can bleed from one config to another. |
|
@cmccabe I think with |
|
I think it's wrong to copy configuration keys meant for the producer to the admin client or to the consumer. Although it's appealing as a quick hack that gets things to work, it quickly breaks down when things get even slightly more complicated. For example, what if someone wants to set a long request timeout for the admin client, but a short one for the producer? Perhaps the user wants to test producer timeouts, but not worry about topic creation timing out. But this is impossible with the current patch-- you haven't given the user any way to configure the AC separate from the producer. We already have other tests such as RoundTripWorkload which have both a producer and a consumer. Are we going to use "producer config" to configure both? Or make the user repeat configurations twice? Neither of these options are appealing. I think it's sensible to just separate configuration into common client configs, producer configs, and consumer configs. That should allow people to set whatever configurations they want, and also keep things simple. |
|
Wouldn't common client config have the same issue as you mentioned configuring request timeout differently say for producer and consumer? Or you mean producer or consumer configs will be able to overwrite whatever is in common client config? Plus, for your example, we will need to add admin client config to the specs. Also, how would people know what to put to common config and what not? I think it may make things confusing for users. Don't you think it is better in that case to add "adminClientConf' to producer and roundtrip specs? Which will mean that the user will need to specify security configs multiple times. |
Yes, I think the producer and consumer configs should override whatever is in the common client config.
Yes, I agree. But that's easy to do. And if the user doesn't specify the admin client config, it just defaults to being empty (doing nothing)
The things that are in the common config should be the things that are common to all clients, like connection settings and so forth. I don't think it's that hard for users. In fact, most users probably would just use the common config for everything, until they start doing something advanced.
The user won't have to specify the security configuration multiple times. As you described above, the user can just put that in the common configuration. |
|
@cmccabe Ok, I agree with common client config approach. I changed this PR to use "commonClientConf" in producer and roundtrip spec. Lets not add adminClientConfig yet until we actually need it? Or you think we need it now? |
|
It might be easier to add |
|
@cmccabe I added |
|
Thanks, @apovzner . LGTM Maybe add producer config and consumer config to |
|
@cmccabe I added |
|
It seems like RoundTripWorker is not using common client conf to set up producer and consumer configurations? |
|
@cmccabe you are right, I forgot to set common client props in producer and consumer configs in roundtrip worker. Just checked in the fix. |
|
Thanks, @apovzner. LGTM. We could also consider having a utility function to merge two config maps... that might be useful here |
rajinisivaram
left a comment
There was a problem hiding this comment.
@apovzner Thanks for the PR. Left a couple of minor comments, apart from that LGTM.
| } | ||
|
|
||
| protected Map<String, String> configOrEmptyMap(Map<String, String> config) { | ||
| return (config == null) ? new TreeMap<String, String>() : config; |
There was a problem hiding this comment.
Could just use Collections.emptyMap()?
| props.put(ProducerConfig.CLIENT_ID_CONFIG, "producer." + id); | ||
| props.put(ProducerConfig.ACKS_CONFIG, "all"); | ||
| props.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, 105000); | ||
| // user may over-write the defaults with common client config and consumer config |
There was a problem hiding this comment.
consumer => producer?
|
@apovzner Thanks for the update, merging to trunk. |
…apache#4757) Currently, WorkerUtils will be able to create topics when there is no security. To be able to work with secure kafka, WorkerUtils.createTopic() needs to be able to take security configs. This PR adds commonClientConf field to both producer bench and roundtrip workload specs so that users can specify security and other common configs once for producer/consumer and adminClient. Also added adminClientConf field to workload specs so that users can specify adminClient specific configs if they want to. For completeness, added consumerConf and producerConf to roundtrip workload spec. Reviewers: Ismael Juma <ismael@juma.me.uk>, Colin P. Mccabe <cmccabe@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
Currently, WorkerUtils will be able to create topics when there is no security. To be able to work with secure kafka, WorkerUtils.createTopic() needs to be able to take security configs. This PR adds commonClientConf field to both producer bench and roundtrip workload specs so that users can specify security and other common configs once for producer/consumer and adminClient. Also added adminClientConf field to workload specs so that users can specify adminClient specific configs if they want to. For completeness, added consumerConf and producerConf to roundtrip workload spec.
Committer Checklist (excluded from commit message)