tinaselenge commented on code in PR #17524:
URL: https://github.com/apache/kafka/pull/17524#discussion_r1850841250
##########
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:
This doesn't seem to be the case when I tested it by running new AdminClient
against an old broker. For example, if we remove this validation,
testDescribeClusterHandleUnsupportedVersionForIncludingFencedBrokers() test
fails. Also this helps Admin to handle the UnsupportedVersion exception
differently, otherwise we fall back to metadata request and it's not clear to
users why the request the failed.
--
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]