tinaselenge commented on code in PR #17524:
URL: https://github.com/apache/kafka/pull/17524#discussion_r1858444833
##########
clients/src/main/java/org/apache/kafka/common/requests/DescribeClusterRequest.java:
##########
@@ -51,6 +52,13 @@ public String toString() {
public DescribeClusterRequest(DescribeClusterRequestData data, short
version) {
super(ApiKeys.DESCRIBE_CLUSTER, version);
this.data = data;
+ validateVersionForIncludingFencedBrokers(version,
data.includeFencedBrokers());
+ }
+
+ private void validateVersionForIncludingFencedBrokers(short version,
boolean includeFencedBrokers) {
+ if (version < 2 && includeFencedBrokers) {
+ throw new UnsupportedVersionException("Including fenced broker
endpoints is not supported with version " + version);
+ }
Review Comment:
I agree that checking the option instead of the error message is much better
solution here. I made an update to add an error level log, instead of
validating describe request and throwing a specific error for
includeFencedBrokers option.
In terms of the integration test, I'm going to look into to it a little
more. KRaftClusterTest.scala you pointed, seems like more cluster level tests.
Since this is testing Admin specific option, it should probably be added to
AdminIntegrationTest but I'm currently not sure how to set the test cluster's
version or it's supported API version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]