cmccabe commented on code in PR #13407: URL: https://github.com/apache/kafka/pull/13407#discussion_r1173081897
########## metadata/src/main/java/org/apache/kafka/image/FeaturesImage.java: ########## @@ -37,19 +39,30 @@ * This class is thread-safe. */ public final class FeaturesImage { - public static final FeaturesImage EMPTY = new FeaturesImage(Collections.emptyMap(), MetadataVersion.MINIMUM_KRAFT_VERSION); + public static final FeaturesImage EMPTY = new FeaturesImage( + Collections.emptyMap(), + MetadataVersion.MINIMUM_KRAFT_VERSION, + ZkMigrationState.NONE + ); private final Map<String, Short> finalizedVersions; private final MetadataVersion metadataVersion; - public FeaturesImage(Map<String, Short> finalizedVersions, MetadataVersion metadataVersion) { + private final ZkMigrationState zkMigrationState; + + public FeaturesImage( + Map<String, Short> finalizedVersions, + MetadataVersion metadataVersion, + ZkMigrationState zkMigrationState + ) { this.finalizedVersions = Collections.unmodifiableMap(finalizedVersions); this.metadataVersion = metadataVersion; + this.zkMigrationState = zkMigrationState; } public boolean isEmpty() { - return finalizedVersions.isEmpty(); + return finalizedVersions.isEmpty() && zkMigrationState.equals(ZkMigrationState.NONE); Review Comment: I think we should also check that `metadataVersion` is equal to `MetadataVersion.MINIMUM_KRAFT_VERSION` here. This is an existing bug, oops! Also let's add a unit test -- 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