-
Notifications
You must be signed in to change notification settings - Fork 14.6k
KAFKA-19624: Improving consistency of command-line arguments for consumer performance tests #20385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
…umer performance tests
@AndrewJSchofield can you please review this? |
ping @aheev, could you please fix the conflicts? |
# Conflicts: # tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java # tools/src/test/java/org/apache/kafka/tools/ConsumerPerformanceTest.java
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, left some comments below.
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
Show resolved
Hide resolved
This test seems to be flaky. It succeeds on my machine and fails sometimes. Also the changes are not even related to the test Just tested. Same issue on trunk too |
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this patch, some comments left
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Please add some tests for the variation combinations of new/old options to make sure the rules in the KIP are correctly implemented.
tests/kafkatest/services/performance/share_consumer_performance.py
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
Show resolved
Hide resolved
…nd `messages` traces from the tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update, some minor comments.
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
Outdated
Show resolved
Hide resolved
@@ -136,7 +174,9 @@ public void testConfigWithoutTopicAndInclude() { | |||
|
|||
@Test | |||
public void testClientIdOverride() throws IOException { | |||
File tempFile = Files.createFile(tempDir.resolve("test_consumer_config.conf")).toFile(); | |||
Path configPath = tempDir.resolve("test_consumer_config.conf"); | |||
Files.deleteIfExists(configPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required, tempDir will be cleanup automatically after junit test finished.
Same thing in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I was testing, a test ended abruptly and caused FileAlreadyExists
exceptions on next runs. Hence, I have added this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, we have multiple test files with the same name. We could give them distinct names—for example, by adding a random suffix or simply choosing different names. This is just my personal nit though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the file names to test_name_test_class.conf
tools/src/test/java/org/apache/kafka/tools/ConsumerPerformanceTest.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/ShareConsumerPerformanceTest.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/ShareConsumerPerformanceTest.java
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/ShareConsumerPerformanceTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
tools/src/test/java/org/apache/kafka/tools/ConsumerPerformanceTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates.
I see a NullPointerException
from kafka-consumer-perf-test.sh
if I fail to provide --bootstrap-server
. Since that's a required argument, I would expect an error message.
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from adding --command-property to both kafka-consumer-perf-test.sh and kafka-share-consumer-perf-test.sh, this looks good to me.
commandPropertiesOpt = parser.accepts("command-property", "Kafka consumer related configuration properties like client.id. " + | ||
"These configs take precedence over those passed via --command-config or --consumer.config.") | ||
.withRequiredArg() | ||
.describedAs("prop1=val1,prop2=val2...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think the code handles the format as described. For example, if I use --command-property client.id=c1,check.crcs=false
, then the client ID is "c1,check.crcs=false"
. The tricky part is that kafka-producer-perf-test
uses a different argument parsing library and it supports --command-property client.id=c1 bootstrap.servers=localhost:9092
with a space used as a separator. That's very non-standard but it's already there for that tool at least.
Personally, I think that the easiest is to support prop=val
only and permit multiple instances of --command-property
, so someone can do --command-property client.id=c1 --command-property check.crcs=false
. I didn't think the details would be subtle. wdyt?
The same comment applies to the share consumer perf test also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense as the option name implies a single prop. I will add the change, test it and ask for review
What do you mean by e2e test? |
Since you have modified the e2e test file FYI: https://github.com/apache/kafka/blob/trunk/tests/README.md |
I will run them after andrew's comments are resolved |
@aheev Please resolve conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Once we have a green build, I'm ready to merge this.
Shouldn't we wait for this? I am trying to run the tests, but running into some issues
|
# Conflicts: # tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
Yes, we should. I'll wait then. |
After a lot of struggle I managed to run the test by using a different JDK(will file a ticket for this later). Here are the results @m1a2st . Three tests failed, all of which are related to producer-perf |
Thanks, Could you file a ticket to trace this issue? |
# Conflicts: # tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java
|
This test seems to be flaky and not related to the changes. It succeeded in a couple of runs in my local. @AndrewJSchofield should we trigger a CI re-run?
|
@aheev I would merge latest changes into this branch. I find the test fails on your branch, and passes on trunk. I can't see that this PR would cause the tests to fail, so I'd update the branch and let the CI run again. |
@@ -115,7 +115,7 @@ def start_cmd(self, node): | |||
for key, value in self.args(node.version).items(): | |||
cmd += " --%s %s" % (key, value) | |||
|
|||
cmd += " --consumer.config %s" % ConsumerPerformanceService.CONFIG_FILE | |||
cmd += " --command-config %s" % ConsumerPerformanceService.CONFIG_FILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this break e2e testing with older versions? (See #20471)
@@ -100,7 +100,7 @@ def start_cmd(self, node): | |||
for key, value in self.args().items(): | |||
cmd += " --%s %s" % (key, value) | |||
|
|||
cmd += " --consumer.config %s" % ShareConsumerPerformanceService.CONFIG_FILE | |||
cmd += " --command-config %s" % ShareConsumerPerformanceService.CONFIG_FILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. The shared consumer is very new, so maybe it’s not a big deal. I’m not sure though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Share consumer was in 4.1 and we are now in 4.2.
resolves https://issues.apache.org/jira/browse/KAFKA-19624
Reviewers: @brandboat, @AndrewJSchofield, @m1a2st