jsancio commented on a change in pull request #11216:
URL: https://github.com/apache/kafka/pull/11216#discussion_r689937435



##########
File path: core/src/test/scala/integration/kafka/server/KRaftClusterTest.scala
##########
@@ -410,6 +421,32 @@ class KRaftClusterTest {
     }
   }
 
+  private def checkReplicaManager(cluster: KafkaClusterTestKit, 
expectedHosting: List[(Int, List[Boolean])]): Unit = {
+    for ((brokerId, partitionsIsHosted) <- expectedHosting) {
+      val broker = cluster.brokers().get(brokerId)
+      // lock and unlock so we can read the replica manager

Review comment:
       I think we need to do this because `var replicaManager` in 
`BrokerServer` is set in a different thread by `KafkaClusterTestKit`. If my 
understanding of Java Memory Model is correct we need to lock/synchronize so 
that we force a memory barrier.




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