cmccabe commented on code in PR #14290:
URL: https://github.com/apache/kafka/pull/14290#discussion_r1347691779


##########
generator/src/main/java/org/apache/kafka/message/FieldSpec.java:
##########
@@ -157,11 +157,6 @@ private void checkTagInvariants() {
                     this.taggedVersions + ", which is not open-ended.  
taggedVersions must " +
                     "be either none, or an open-ended range (that ends with a 
plus sign).");
             }
-            if 
(!this.taggedVersions.intersect(this.versions).equals(this.taggedVersions)) {
-                throw new RuntimeException("Field " + name + " specifies 
taggedVersions " +
-                    this.taggedVersions + ", and versions " + this.versions + 
".  " +
-                    "taggedVersions must be a subset of versions.");
-            }

Review Comment:
   Yes, this is a good point. I am OK with changing the code so that tagged 
fields can have an "end version". It would be good to know that all v1 
PartitionChangeRecords must specify a storage directory array if they specify a 
replica array.
   
   However, that isn't quite what the code above is enforcing ... the code 
above is enforcing that "taggedVersions must be a subset of versions" which 
does seem like an invariant we still want. I think the code that throws an 
exception if taggedVersions has an end version is somewhere else...



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to