You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/01 21:13:12 UTC

[GitHub] [kafka] mumrah commented on a change in pull request #10008: MINOR: Remove ZK dependency for coordinator topics' partition counts

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:
users@infra.apache.org