MINOR: fix client_compatibility_features_test.py#10292
MINOR: fix client_compatibility_features_test.py#10292chia7712 merged 7 commits intoapache:trunkfrom
Conversation
|
oh, it tests raft also. will update code to fix that. |
| # this is supported by zkBroker currently | ||
| features["describe-acls-supported"] = False |
There was a problem hiding this comment.
Nice -- better than disabling the test for Raft-based quorums. Perhaps add to the comment to indicate that this check/disabling is only necessary due to the fact that we are in early access mode with KIP-500 and we should remove the special casing when that his fully implemented? Aside from that, LGTM -- thank you for the PR!
|
This needs to be cherry-picked to 2.8. |
|
@vvcephei Do you have free time to take a look at this PR? This issue happens in 2.8 also so it would be nice to be included by 2.8.0 :) |
cmccabe
left a comment
There was a problem hiding this comment.
Wait, can you explain why we need this change now and we didn't need it before?
And if we always want to use the development version of the features test, it seems like this doesn't do that in the KIP-500 case, right?
|
I broke this with https://github.com/apache/kafka/pull/10105/files#diff-84e14a0909d232b70f0a957ded161cd077d4dc1d069bbaab8e1bacc8dd2e0572L84-R85. The test used to always use the ZooKeeper node, and I changed it to use the Kafka node not realizing that the two distribution versions would be different. We want it to always use at least version 2.7, which we can get by using either the ZooKeeper node for the Zookeeper case or the Kafka node for the Raft case. |
|
@rondagostino : thanks for the explanation. It's a bit weird to use the devel version of the tool when ZK is enabled, and the old version when it's not. I think this will lead to some odd issues down the road. @chia7712 : Can we just use a separate node for the client, unconditionally? Then that separate node can always have the devel software. Or, I suppose, we could change the path that the compat tool is invoked via (maybe that's annoying, though...) |
The code as amended in this PR will use the devel version when ZooKeeper is enabled (which is the way it always was except after I changed/broke it) and then, when Zookeeper is not enabled -- which is a new case -- it will use the Kafka version, which by definition will be >= 2.8. |
We don't have a I could see a situation where we add functionality to |
| # Run the compatibility test on the first Kafka node. | ||
| node = self.kafka.nodes[0] | ||
| if self.zk: | ||
| # kafka nodes are set to older version so resolved script path is linked to older assembly. | ||
| # run the compatibility test on the first zk node to get script path linked to latest(dev) assembly. | ||
| node = self.zk.nodes[0] | ||
| else: | ||
| node = self.kafka.nodes[0] |
There was a problem hiding this comment.
We can use the dev version of the tool on the Kafka node via code like this:
node = self.kafka.nodes[0]
cmd = ("%s org.apache.kafka.tools.ClientCompatibilityTest "
"--bootstrap-server %s "
"--num-cluster-nodes %d "
"--topic %s " % (self.dev_script_path,
self.kafka.bootstrap_servers(),
len(self.kafka.nodes),
list(self.topics.keys())[0]))
And then further down we can define the DEV script path like this:
# Always use the latest version of org.apache.kafka.tools.ClientCompatibilityTest
# so store away the path to the DEV version before we set the Kafka version
self.dev_script_path = self.kafka.path.script("kafka-run-class.sh", self.kafka.nodes[0])
self.kafka.set_version(KafkaVersion(broker_version))
I tested this locally and it solves the problem.
|
@cmccabe @rondagostino thanks for all your comments (and nice explanation)! I have update code according to reviews. please take a look. |
| self.dev_script_path = self.kafka.path.script("kafka-run-class.sh", self.kafka.nodes[0]) | ||
|
|
||
| def invoke_compatibility_program(self, features): | ||
| # Run the compatibility test on the first Kafka node. |
There was a problem hiding this comment.
nit: no need to remove this comment. Otherwise LGTM -- thank you again!
|
Thanks, @chia7712 ! |
Reviewers: Colin Patrick McCabe <cmccabe@confluent.io>, Ron Dagostino <rdagostino@confluent.io>
|
push to trunk and 2.8 |
Conflicts: * build.gradle: keep `dependencySubstitution` Confluent addition in `resolutionStrategy` and take upstream changes. Commits: * apache-github/trunk: KAFKA-12503: inform threads to resize their cache instead of doing so for them (apache#10356) KAFKA-10697: Remove ProduceResponse.responses (apache#10332) MINOR: Exclude KIP-500.md from rat check (apache#10354) MINOR: Move `configurations.all` to be a child of `allprojects` (apache#10349) MINOR: Remove use of `NoSuchElementException` in `KafkaMetadataLog` (apache#10344) MINOR: Start the broker-to-controller channel for request forwarding (apache#10340) KAFKA-12382: add a README for KIP-500 (apache#10227) MINOR: Fix BaseHashTable sizing (apache#10334) KAFKA-10357: Add setup method to internal topics (apache#10317) MINOR: remove redundant null check when testing specified type (apache#10314) KAFKA-12293: Remove JCenter from buildscript and delete buildscript.gradle KAFKA-12491: Make rocksdb an `api` dependency for `streams` (apache#10341) KAFKA-12454: Add ERROR logging on kafka-log-dirs when given brokerIds do not exist in current kafka cluster (apache#10304) KAFKA-12459; Use property testing library for raft event simulation tests (apache#10323) MINOR: fix failing ZooKeeper system tests (apache#10297) MINOR: fix client_compatibility_features_test.py (apache#10292)
related to #10105
kafka nodes are set to older version so resolved script path is linked to older assembly. the 0.10.x versions do not have
org.apache.kafka.tools.ClientCompatibilityTestso the test gets failed.Committer Checklist (excluded from commit message)