dengziming commented on code in PR #12108: URL: https://github.com/apache/kafka/pull/12108#discussion_r868771983
########## core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala: ########## @@ -118,6 +118,11 @@ class BrokerMetadataPublisher(conf: KafkaConfig, */ var _firstPublish = true + /** + * This is updated after all components (e.g. LogManager) has finished publishing the new metadata delta + */ + var publishedOffset: Long = -1 Review Comment: Yes, this variable is accessed in multiple threads, making it AtomicLong can avoid some problems similar to phantom read, I changed it to an AtomicLong. -- 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