chia7712 commented on code in PR #18685: URL: https://github.com/apache/kafka/pull/18685#discussion_r1985095404
########## core/src/main/scala/kafka/server/metadata/KRaftMetadataCache.scala: ########## @@ -522,10 +522,14 @@ class KRaftMetadataCache( if (kraftVersionLevel > 0) { finalizedFeatures.put(KRaftVersion.FEATURE_NAME, kraftVersionLevel) } + var metadataVersion = MetadataVersion.MINIMUM_VERSION + if (!image.features().metadataVersion().isEmpty) { + metadataVersion = image.features().metadataVersionOrThrow() + } new FinalizedFeatures( - image.features().metadataVersionOrThrow(), + metadataVersion, finalizedFeatures, - image.highestOffsetAndEpoch().offset) + image.highestOffsetAndEpoch().epoch()) Review Comment: > Within the same KRaft leader's life time (i.e. the same epoch), multiple rounds of feature updates could have happened. It would be incorrect to have the same FinalizedFeaturesEpoch after each round of update. @junrao Excuse me, the `offset` keeps increasing due to `NoOpRecord`, and this offset is returned to Admin via `FeatureMetadata#finalizedFeaturesEpoch`, which is used by the feature command. This means users see an increased `finalizedFeaturesEpoch` even though no feature has changed. Is this expected? -- 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