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/03 13:52:53 UTC

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

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



##########
File path: core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala
##########
@@ -78,7 +76,7 @@ class GroupMetadataManager(brokerId: Int,
   private val shuttingDown = new AtomicBoolean(false)
 
   /* number of partitions for the consumer metadata topic */
-  private val groupMetadataTopicPartitionCount = getGroupMetadataTopicPartitionCount
+  private var groupMetadataTopicPartitionCount: Int = _

Review comment:
       Wonder if this needs `@volatile`.  It is only set once, upon invoking `startup()`, at which time it changes from 0 to the partition count.  The only place this value is used is in `partitionFor()` where it is the denominator and will cause division-by-zero if the original value is read instead of the updated value.




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