rondagostino commented on a change in pull request #10003: URL: https://github.com/apache/kafka/pull/10003#discussion_r568730408
########## File path: core/src/main/scala/kafka/server/ReplicaManager.scala ########## @@ -257,6 +264,37 @@ class ReplicaManager(val config: KafkaConfig, } } + // Changes are initially deferred when using a Raft-based metadata quorum, and they may flip-flop to not + // being deferred and being deferred again thereafter as the broker (re)acquires/loses its lease. + // Changes are never deferred when using ZooKeeper. When true, this indicates that we should transition + // online partitions to the deferred state if we see a metadata update for that partition. + @volatile private var deferringMetadataChanges: Boolean = !config.requiresZookeeper Review comment: Good point. The same thread will be both managing this value and submitting metadata changes, so it can remember if it has already started deferring changes if it needs to do so; plus everything here related to deferral happens within the lock anyway. I removed `@volatile`. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org