jolshan commented on code in PR #13196:
URL: https://github.com/apache/kafka/pull/13196#discussion_r1107851690


##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -318,6 +358,25 @@ class Partition(val topicPartition: TopicPartition,
 
   def inSyncReplicaIds: Set[Int] = partitionState.isr
 
+  def maybeAddListener(listener: PartitionListener): Boolean = {
+    inReadLock(leaderIsrUpdateLock) {
+      // `log` is set to `None` when the partition is failed or deleted.
+      log match {
+        case Some(log) =>
+          listener.onHighWatermarkUpdated(topicPartition, log.highWatermark)
+          listeners.add(listener)

Review Comment:
   Sorry if I missed it, but why do we call onHighWatermarkUpdated 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.

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