ijuma commented on a change in pull request #10584:
URL: https://github.com/apache/kafka/pull/10584#discussion_r649368540



##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java
##########
@@ -92,6 +93,15 @@ public MetadataRequest build(short version) {
             if (!data.allowAutoTopicCreation() && version < 4)
                 throw new UnsupportedVersionException("MetadataRequest 
versions older than 4 don't support the " +
                         "allowAutoTopicCreation field");
+            if (version >= 10) {
+                if (data.topics() != null) {
+                    data.topics().forEach(topic -> {
+                        if (topic.name() == null || topic.topicId() != 
Uuid.ZERO_UUID)
+                            throw new 
UnsupportedVersionException("MetadataRequest version " + version  +
+                                    " does not support null topic names or 
topic IDs.");

Review comment:
       Yeah, makes sense.

##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java
##########
@@ -92,6 +93,15 @@ public MetadataRequest build(short version) {
             if (!data.allowAutoTopicCreation() && version < 4)
                 throw new UnsupportedVersionException("MetadataRequest 
versions older than 4 don't support the " +
                         "allowAutoTopicCreation field");
+            if (version >= 10) {

Review comment:
       +1




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to