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


##########
core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala:
##########
@@ -137,6 +139,7 @@ class BrokerMetadataPublisher(
     manifest: LoaderManifest
   ): Unit = {
     val highestOffsetAndEpoch = newImage.highestOffsetAndEpoch()
+    val currentMetadataVersion = metadataCache.metadataVersion()

Review Comment:
   There's no need to access metadataCache here. That would incur a performance 
penalty because you're dealing with volatiles. Instead, you can just look at 
`delta.image().features().metadataVersion()` (or something like that, I didn't 
check field names)
   
   `delta.image` is the previous metadata image (that the delta is built on top 
of)



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