KAFKA-19625: Consistency of command-line arguments for verifiable producer/consumer#20390
Conversation
671c683 to
3ed893b
Compare
3ed893b to
211e9c5
Compare
| cmd += " --repeating-keys %s " % str(self.repeating_keys) | ||
|
|
||
| cmd += " --producer.config %s" % VerifiableProducer.CONFIG_FILE | ||
| cmd += " --command.config %s" % VerifiableProducer.CONFIG_FILE |
|
|
||
| boolean useAutoCommit = res.getBoolean("useAutoCommit"); | ||
| String configFile = res.getString("consumer.config"); | ||
| String commandConfigFile = res.getString("command-config"); |
There was a problem hiding this comment.
Since you used the destination of commandConfigFile on line 623, I would expect you to refer to the string by that name here, unless I'm missing something.
| .action(store()) | ||
| .required(false) | ||
| .type(String.class) | ||
| .metavar("CONFIG-FILE") |
There was a problem hiding this comment.
The names of the metavars use a mixture of - and _ as separators. Please could you choose one or the other (I have a slight preference for -), and then apply to the delinquent arguments.
| .type(String.class) | ||
| .metavar("CONFIG-FILE") | ||
| .dest("commandConfigFile") | ||
| .help("Producer config properties file."); |
There was a problem hiding this comment.
Given that we are trying in this KIP to get away from specific names for producer/config config, maybe this could be "Config properties file..
| .type(String.class) | ||
| .metavar("CONFIG-FILE") | ||
| .dest("commandConfigFile") | ||
| .help("Consumer config properties file."); |
There was a problem hiding this comment.
Given that we are trying in this KIP to get away from specific names for producer/config config, maybe this could be "Config properties file..
| throw new ArgumentParserException("Options --consumer.config and --command-config are mutually exclusive.", parser); | ||
| } | ||
| if (configFile != null) { | ||
| try { |
There was a problem hiding this comment.
Please add a deprecation message here like System.out.println("Option --consumer.config has been deprecated and will be removed in a future version. Use --command-config instead.");.
There was a problem hiding this comment.
I'm really sorry—I just woke up, so I made a lot of silly typo errors. :( I’ve already addressed all the comments. Thanks for your review.
There was a problem hiding this comment.
Ah, not quite. The deprecation message should be printed if the user specified the old --consumer.config and we'd like to encourage them to use --command-config. So, I think the System.out.println you added ought to be added just after if (configFile != null) on line 642.
AndrewJSchofield
left a comment
There was a problem hiding this comment.
Thanks for the changes.
| throw new ArgumentParserException("Options --consumer.config and --command-config are mutually exclusive.", parser); | ||
| } | ||
| if (configFile != null) { | ||
| try { |
There was a problem hiding this comment.
Ah, not quite. The deprecation message should be printed if the user specified the old --consumer.config and we'd like to encourage them to use --command-config. So, I think the System.out.println you added ought to be added just after if (configFile != null) on line 642.
|
@AndrewJSchofield Thanks for your comments, I have already fixed them, please take a look. |
AndrewJSchofield
left a comment
There was a problem hiding this comment.
Thanks for the updates. Just a couple of remaining comments.
| .type(String.class) | ||
| .metavar("CONFIG-FILE") | ||
| .dest("commandConfigFile") | ||
| .help("Config properties file."); |
There was a problem hiding this comment.
I suggest adding (config options shared with command line parameters will be overridden) to the help string. That's still true.
| .type(String.class) | ||
| .metavar("CONFIG-FILE") | ||
| .dest("commandConfigFile") | ||
| .help("Config properties file."); |
There was a problem hiding this comment.
And here (config options shared with command line parameters will be overridden).
chia7712
left a comment
There was a problem hiding this comment.
@JimmyWang6 Could you please file minor patch to fix the broken e2e? we could generate the command line according to the kafka version.
| cmd += " --repeating-keys %s " % str(self.repeating_keys) | ||
|
|
||
| cmd += " --producer.config %s" % VerifiableProducer.CONFIG_FILE | ||
| cmd += " --command-config %s" % VerifiableProducer.CONFIG_FILE |
There was a problem hiding this comment.
this change could break the compatibility_test_new_broker_test.py, since the VerifiableProducer is running under old kafka.
There was a problem hiding this comment.
upgrade_test.py will also fail with these changes.
cc @JimmyWang6
| cmd += " --max-messages %s" % str(self.max_messages) | ||
|
|
||
| cmd += " --consumer.config %s" % VerifiableConsumer.CONFIG_FILE | ||
| cmd += " --command-config %s" % VerifiableConsumer.CONFIG_FILE |
There was a problem hiding this comment.
this breaks consumer_protocol_migration_test.py
| } | ||
| if (commandConfigFile != null) { | ||
| try { | ||
| consumerProps.putAll(Utils.loadProps(res.getString(commandConfigFile))); |
There was a problem hiding this comment.
this should be
consumerProps.putAll(Utils.loadProps(commandConfigFile)); ?
…test.py (#20471) #20390 Replace the -`-producer.config` for the verifiable producer and `--consumer.config` option by `--command-config` for the verifiable consumer. However, for e2e tests targeting older broker versions, the original configuration should still be used. Fix the following tests: `consumer_protocol_migration_test.py`、`compatibility_test_new_broker_test.py` and `upgrade_test.py`. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
…ducer/consumer (apache#20390) As described in [jira](https://issues.apache.org/jira/browse/KAFKA-19625), this PR implements replace `consumer.config` and `producer.config` with `command-config` for kafka-verifiable-producer.sh and kafka-verifiable-consumer.sh. Reviewers: Andrew Schofield <aschofield@confluent.io>
…test.py (apache#20471) apache#20390 Replace the -`-producer.config` for the verifiable producer and `--consumer.config` option by `--command-config` for the verifiable consumer. However, for e2e tests targeting older broker versions, the original configuration should still be used. Fix the following tests: `consumer_protocol_migration_test.py`、`compatibility_test_new_broker_test.py` and `upgrade_test.py`. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
As described in
jira, this PR
implements replace
consumer.configandproducer.configwithcommand-configfor kafka-verifiable-producer.sh andkafka-verifiable-consumer.sh.
Reviewers: Andrew Schofield aschofield@confluent.io