apoorvmittal10 commented on code in PR #17796:
URL: https://github.com/apache/kafka/pull/17796#discussion_r1866757255


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -2455,6 +2455,8 @@ class ReplicaManager(val config: KafkaConfig,
           if (metadataCache.hasAliveBroker(newLeaderBrokerId)) {
             // Only change partition state when the leader is available
             if (partition.makeFollower(partitionState, 
highWatermarkCheckpoints, topicIds(partitionState.topicName))) {
+              // Invoke the follower transition listeners for the partition.
+              partition.invokeLeaderToFollowerListeners()

Review Comment:
   Thanks for that, I have removed it and validated in tests as well.



##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -82,6 +82,11 @@ trait PartitionListener {
    * that the partition was deleted but only that this broker does not host a 
replica of it any more.
    */
   def onDeleted(partition: TopicPartition): Unit = {}
+
+  /**
+   * Called when the Partition on this broker is transitioned to follower from 
leader.
+   */
+  def onLeaderToFollower(partition: TopicPartition): Unit = {}

Review Comment:
   Done.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to