KAFKA-5588: Remove deprecated new-consumer option for tools#5097
KAFKA-5588: Remove deprecated new-consumer option for tools#5097ijuma merged 8 commits intoapache:trunkfrom
Conversation
viktorsomogyi
left a comment
There was a problem hiding this comment.
Reviewed where do we use the new-consumer option. It seems that inside the ducktapes we still use them. Do you think those usages should be removed from there too?
kafka/tests/kafkatest/services/kafka/kafka.py
Line 587 in d99f4a0
kafka/tests/kafkatest/services/kafka/kafka.py
Line 614 in d99f4a0
|
@viktorsomogyi I was thinking the same thing but first waiting for a review by some committer. |
vahidhashemian
left a comment
There was a problem hiding this comment.
Thank you for the patch.
Would it be possible to also add a test case for both ConsumerGroupCommand and ConsoleConsumer that verifies using the --new-consumer option causes an error?
I think the upgrade document also needs to be updated to mention this change.
|
@vahidhashemian thanks for the feedback. |
|
@ppatierno, do you think for |
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the PR. Please search the *.py code too as it has a few mentions of --new-consumer.
|
@viktorsomogyi @ijuma related to the Python files as far as I can see the |
|
@ppatierno Sounds good. |
|
@vahidhashemian thanks for the suggestions, I didn't notice that @viktorsomogyi @ijuma I updated the Python tests as proposed. |
vahidhashemian
left a comment
There was a problem hiding this comment.
Thanks for addressing my comment. LGTM.
viktorsomogyi
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments too.
|
@vahidhashemian @viktorsomogyi thanks for your review and for accepting the changes.
|
| def testDeleteWithUnrecognizedNewConsumerOption() { | ||
| val cgcArgs = Array("--new-consumer", "--bootstrap-server", brokerList, "--delete", "--group", group) | ||
| getConsumerGroupService(cgcArgs) | ||
| fail("Expected an error due to presence of unrecognized --new-consumer option") |
There was a problem hiding this comment.
This is not needed given the expected exception annotation. Same for other similar cases.
There was a problem hiding this comment.
Do we really need tests for checking unrecognized option "--new-consumer" ?
maybe one round of manual testing should be sufficient. maintaining these tests in repo may not be worth.
| result.keySet.contains(group) && result.get(group).contains(Errors.COORDINATOR_NOT_AVAILABLE)) | ||
| } | ||
|
|
||
| @Test(expected = classOf[joptsimple.OptionException]) |
There was a problem hiding this comment.
Nit: why are we not importing OptionException?
|
|
||
| // Override exit procedure to throw an exception instead of exiting, so we can catch the exit | ||
| // properly for this test case | ||
| Exit.setExitProcedure((_, message) => throw new IllegalArgumentException(message.orNull)) |
There was a problem hiding this comment.
This comment seems redundant given the code.
There was a problem hiding this comment.
Yeah, I am going to remove it from all the other places in the same test scala class
docs/upgrade.html
Outdated
| <li><a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-176%3A+Remove+deprecated+new-consumer+option+for+tools">KIP-176</a> removes | ||
| the <code>--new-consumer</code> option for all consumer based tools as <code>kafka-console-consumer</code>, <code>kafka-consumer-perf-test</code> | ||
| and <code>kafka-consumer-groups</code>. The new consumer is automatically used if the bootstrap servers list is provided on the command line | ||
| otherwise, providing the zookeeper connection instead, the old one is used. |
There was a problem hiding this comment.
We should make it clear that we haven't changed the behaviour, -new-consumer was already a no-op.
|
@ijuma thanks for the review. I addressed the change requests. |
| val hideHeader = options.has(hideHeaderOpt) | ||
| val recordFetchTimeoutMs = options.valueOf(recordFetchTimeoutOpt).longValue() | ||
| val bootstrapServers = options.valueOf(bootstrapServersOpt) | ||
| val zkConnectionStr = options.valueOf(zkConnectOpt) |
There was a problem hiding this comment.
They are used in the added unit tests in ConsumerPerformanceTest.scala.
There was a problem hiding this comment.
Yes exactly. They are there just for testing that without the - - new-consumer option all depends on the bootstrap servers list and zookeeper connection string and that the provided value to the configuration are what we expect.
There was a problem hiding this comment.
I see. This is a bit odd and I'd rather not do that. I will push a commit with minor fixes.
| */ | ||
| package unit.kafka.admin | ||
|
|
||
| import joptsimple.OptionException |
There was a problem hiding this comment.
With this import, joptsimple. can be dropped from the expected exception class of the first method below.
Also, no need for the fail statement there (similar to @ijuma's earlier comment). Not your code, but it would be great to clean them up :)
There was a problem hiding this comment.
Yes it makes sense. I have done the same for the testConfigUsingNewConsumerUnrecognizedOption in the ConsumerPerformanceTest class.
ijuma
left a comment
There was a problem hiding this comment.
LGTM. I agree that we probably don't want to keep the tests for --new-consumer for long, but we can include them for now and remove them in one or two release cycles.
|
Test failure is unrelated, merging to trunk. |
…grained-acl-create-topics * apache-github/trunk: KAFKA-5588: Remove deprecated --new-consumer tools option (apache#5097) MINOR: Fix for the location of the trogdor.sh executable file in the documentation. (apache#5040) KAFKA-6997: Exclude test-sources.jar when $INCLUDE_TEST_JARS is FALSE MINOR: docs should point to latest version (apache#5132) KAFKA-6981: Move the error handling configuration properties into the ConnectorConfig and SinkConnectorConfig classes (KIP-298) [KAFKA-6730] Simplify State Store Recovery (apache#5013) MINOR: Rename package `internal` to `internals` for consistency (apache#5137) KAFKA-6704: InvalidStateStoreException from IQ when StreamThread closes store (apache#4801) MINOR: Add missing configs for resilience settings MINOR: Add regression tests for KTable mapValues and filter (apache#5134) KAFKA-6750: Add listener name to authentication context (KIP-282) (apache#4829) KAFKA-3665: Enable TLS hostname verification by default (KIP-294) (apache#4956) KAFKA-6938: Add documentation for accessing Headers on Kafka Streams Processor API (apache#5128) KAFKA-6813: return to double-counting for count topology names (apache#5075) KAFKA-5919; Adding checks on "version" field for tools using it MINOR: Remove deprecated KafkaStreams constructors in docs (apache#5118)
…refix * apache-github/trunk: KAFKA-6726: Fine Grained ACL for CreateTopics (KIP-277) (apache#4795) KAFKA-5588: Remove deprecated --new-consumer tools option (apache#5097) MINOR: Fix for the location of the trogdor.sh executable file in the documentation. (apache#5040) KAFKA-6997: Exclude test-sources.jar when $INCLUDE_TEST_JARS is FALSE MINOR: docs should point to latest version (apache#5132) KAFKA-6981: Move the error handling configuration properties into the ConnectorConfig and SinkConnectorConfig classes (KIP-298) [KAFKA-6730] Simplify State Store Recovery (apache#5013) MINOR: Rename package `internal` to `internals` for consistency (apache#5137) KAFKA-6704: InvalidStateStoreException from IQ when StreamThread closes store (apache#4801) MINOR: Add missing configs for resilience settings MINOR: Add regression tests for KTable mapValues and filter (apache#5134) KAFKA-6750: Add listener name to authentication context (KIP-282) (apache#4829) KAFKA-3665: Enable TLS hostname verification by default (KIP-294) (apache#4956) KAFKA-6938: Add documentation for accessing Headers on Kafka Streams Processor API (apache#5128) KAFKA-6813: return to double-counting for count topology names (apache#5075) KAFKA-5919; Adding checks on "version" field for tools using it MINOR: Remove deprecated KafkaStreams constructors in docs (apache#5118)
Reviewers: Viktor Somogyi <viktorsomogyi@gmail.com>, Vahid Hashemian <vahidhashemian@us.ibm.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Removed the deprecated "--new-consumer" option for all consumer based tools.
This option was already deprecated in the previous version so it can be removed in the coming new 2.0.0 major version.
Committer Checklist (excluded from commit message)