mumrah commented on code in PR #12050: URL: https://github.com/apache/kafka/pull/12050#discussion_r852197868
########## core/src/main/scala/kafka/server/BrokerMetadataCheckpoint.scala: ########## @@ -102,11 +112,16 @@ class RawMetaProperties(val props: Properties = new Properties()) { } object MetaProperties { + def apply(clusterId: String, nodeId: Int): MetaProperties = { + MetaProperties(clusterId, nodeId, MetadataVersion.latest().version()) + } + def parse(properties: RawMetaProperties): MetaProperties = { properties.requireVersion(expectedVersion = 1) val clusterId = require(ClusterIdKey, properties.clusterId) val nodeId = require(NodeIdKey, properties.nodeId) - new MetaProperties(clusterId, nodeId) + val metadataVersion = properties.initialMetadataVersion.getOrElse(MetadataVersion.stable().version()) Review Comment: You're right, this should be V1. This covers the case of an existing meta.properties file that does not have the initial metadata.version specified. We're using this as a signal that a cluster was on a KRaft preview version previously. -- 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