mumrah commented on a change in pull request #10008:
URL: https://github.com/apache/kafka/pull/10008#discussion_r568142924



##########
File path: 
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala
##########
@@ -96,7 +108,20 @@ class TransactionStateManager(brokerId: Int,
   private[transaction] val transactionMetadataCache: mutable.Map[Int, 
TxnMetadataCacheEntry] = mutable.Map()
 
   /** number of partitions for the transaction log topic */
-  private val transactionTopicPartitionCount = 
getTransactionTopicPartitionCount
+  private var _transactionTopicPartitionCount: Option[Int] = Option.empty // 
lazy, once-only evaluation

Review comment:
       I think this should probably be `@volatile` since the reads are not 
synchronized. Maybe we can use `AtomicReference` or some future thing here?




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


Reply via email to