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


##########
metadata/src/test/java/org/apache/kafka/controller/PartitionChangeBuilderTest.java:
##########
@@ -49,12 +51,15 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.params.provider.Arguments.arguments;
+import static org.mockito.Mockito.when;
 
 
 @Timeout(value = 40)
 public class PartitionChangeBuilderTest {
     private static Stream<Arguments> partitionChangeRecordVersions() {
-        return IntStream.range(PartitionChangeRecord.LOWEST_SUPPORTED_VERSION, 
PartitionChangeRecord.HIGHEST_SUPPORTED_VERSION + 1).mapToObj(version -> 
Arguments.of((short) version));
+        return IntStream.range(PartitionChangeRecord.LOWEST_SUPPORTED_VERSION, 
PartitionChangeRecord.HIGHEST_SUPPORTED_VERSION + 1)
+                .filter(v -> v != 
PartitionChangeRecord.HIGHEST_SUPPORTED_VERSION) // TODO test latest record 
version in KAFKA-15514

Review Comment:
   Good catch, I forgot this. Removed and fixed failing tests.



##########
metadata/src/main/java/org/apache/kafka/metadata/PartitionRegistration.java:
##########
@@ -122,8 +132,13 @@ public PartitionRegistration build() {
                 throw new IllegalStateException("You must set last known 
elr.");
             }
 
+            if (directories == null) {
+                directories = DirectoryId.unassignedArray(replicas.length);
+            }

Review Comment:
   Good point. I've moved this to the underlying constructor to deal with both 
cases.



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