-
Notifications
You must be signed in to change notification settings - Fork 14k
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
MINOR: disable JmxTool in kafkatest console-consumer by default #7785
Conversation
@hachikuji can you take another look please? is this what you were thinking? |
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, left a couple minor suggestions.
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.
@brianbushree Thanks, left a couple minor comments. Just to confirm, have you verified system tests are still passing with these changes? No need to check them all, maybe just make sure some test case which uses has_partitions_assigned
(for example) still works.
looks like I overlooked implementing proper default values with regard to inferring currently we initialize the self.jmx_object_names = ["kafka.consumer:type=consumer-coordinator-metrics,client-id=%s" % self.client_id]
self.jmx_attributes = ["assigned-partitions"] if unfortunately this means using seems like we have two options:
@hachikuji what do you think? did I miss any other options? |
I think the only reason we use the jmx tool by default is for the purpose of |
Ya I agree completely. It makes sense to disable this by default since it seems there are only a few usages and makes this PR much more complicated. I'll remove this function and some of the associated logic. |
b5e36b3
to
a3677b9
Compare
@@ -102,6 +100,10 @@ def __init__(self, context, num_nodes, kafka, topic, group_id="test-consumer-gro | |||
for node in self.nodes: | |||
node.version = version | |||
|
|||
self.jmx_tool = JmxTool(context, num_nodes=num_nodes, | |||
jmx_object_names=jmx_object_names, jmx_attributes=(jmx_attributes or []), | |||
root=ConsoleConsumer.PERSISTENT_ROOT) |
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.
@mumrah to your earlier point, I've tried to avoid special casing by always initializing a JmxTool
regardless of whether it'll be used
@hachikuji however, now that this is in place, it seems like we should maybe just stick with mixin approach since we're always initializing this object anyways? (this way we can also avoid some of the clean_node
changes required here)
with that being said, I do like the consumer.jmx_tool
namespace isolation
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.
@brianbushree I don't mind going back to the mixin if you think that's better. I'll leave it up to you.
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 think this mixin approach is better for two reasons here:
- it should minimize this PR
- seems less like a one-off approach since we already use the mixin everywhere
I'm going to refactor this PR accordingly.
These are the tests that seem to rely on this jmx functionality in the consumer:
I've tested these locally and they are passing (I also tested |
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.
Do not initialize `JmxTool` by default when running console consumer. In order to support this, we remove `has_partitions_assigned` and its only usage in an assertion inside `ProduceConsumeValidateTest`, which did not seem to contribute much to the validation. Reviewers: David Arthur <[email protected]>, Jason Gustafson <[email protected]>
what/why the throttling_test was broken by this PR (#7785) since it depends on the consumer having partitions-assigned before starting the producer this PR provides the ability to wait for partitions to be assigned in the console consumer before considering it started. caveat this does not support starting up the JmxTool inside the console-consumer for custom metrics while using this wait_until_partitions_assigned flag since the code assumes one JmxTool running per node. I think a proper fix for this would be to make JmxTool its own standalone single-node service alternatives we could use the EndToEnd test suite which uses the verifiable producer/consumer under the hood but I found that there were more changes necessary to get this working unfortunately (specifically doesn't seem like this test suite plays nicely with the ProducerPerformanceService) Reviewers: Mathew Wong <[email protected]>, Bill Bejeck <bbejeck.com>
what/why the throttling_test was broken by this PR (#7785) since it depends on the consumer having partitions-assigned before starting the producer this PR provides the ability to wait for partitions to be assigned in the console consumer before considering it started. caveat this does not support starting up the JmxTool inside the console-consumer for custom metrics while using this wait_until_partitions_assigned flag since the code assumes one JmxTool running per node. I think a proper fix for this would be to make JmxTool its own standalone single-node service alternatives we could use the EndToEnd test suite which uses the verifiable producer/consumer under the hood but I found that there were more changes necessary to get this working unfortunately (specifically doesn't seem like this test suite plays nicely with the ProducerPerformanceService) Reviewers: Mathew Wong <[email protected]>, Bill Bejeck <bbejeck.com>
…he#7785) Do not initialize `JmxTool` by default when running console consumer. In order to support this, we remove `has_partitions_assigned` and its only usage in an assertion inside `ProduceConsumeValidateTest`, which did not seem to contribute much to the validation. Reviewers: David Arthur <[email protected]>, Jason Gustafson <[email protected]>
) what/why the throttling_test was broken by this PR (apache#7785) since it depends on the consumer having partitions-assigned before starting the producer this PR provides the ability to wait for partitions to be assigned in the console consumer before considering it started. caveat this does not support starting up the JmxTool inside the console-consumer for custom metrics while using this wait_until_partitions_assigned flag since the code assumes one JmxTool running per node. I think a proper fix for this would be to make JmxTool its own standalone single-node service alternatives we could use the EndToEnd test suite which uses the verifiable producer/consumer under the hood but I found that there were more changes necessary to get this working unfortunately (specifically doesn't seem like this test suite plays nicely with the ProducerPerformanceService) Reviewers: Mathew Wong <[email protected]>, Bill Bejeck <bbejeck.com>
what
Provide the ability to optionally enable the JmxTool inside the kafkatest console-consumer
why
For tests that don't use these JMX metrics, we should allow users to disable this metrics collection.
Committer Checklist (excluded from commit message)