showuon commented on code in PR #17524:
URL: https://github.com/apache/kafka/pull/17524#discussion_r1867451720
##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -2554,6 +2557,12 @@ boolean handleUnsupportedVersionException(final
UnsupportedVersionException exce
return false;
}
+ // If unsupportedVersion exception was caused by the option to
include fenced brokers (only supported for version 1+)
Review Comment:
supported for version 2+?
##########
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:
Hmm... it's quite complicated to have a integration test to test with lower
describeCluster version. I think it's fine sine we already have unit test to
cover it. Thanks.
--
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]