OmniaGM commented on code in PR #14881: URL: https://github.com/apache/kafka/pull/14881#discussion_r1420552612
########## core/src/main/scala/kafka/server/ReplicaManager.scala: ########## @@ -2666,8 +2648,8 @@ class ReplicaManager(val config: KafkaConfig, // is unavailable. This is required to ensure that we include the partition's // high watermark in the checkpoint file (see KAFKA-1647). val state = info.partition.toLeaderAndIsrPartitionState(tp, isNew) - val isNewLeaderEpoch = partition.makeFollower(state, offsetCheckpoints, Some(info.topicId)) - + val isNewLeaderEpoch = partition.makeFollower(state, offsetCheckpoints, Some(info.topicId), partitionDirectoryId) + maybeUpdateTopicAssignment(partition, partitionDirectoryId) Review Comment: this already happening as `applyLocalFollowersDelta` and `applyLocalLeadersDelta` are only invoked `ReplicaManager.applyDelta` when `localChanges.followers` or `localChanges.leaders` aren't empty. https://github.com/apache/kafka/blob/4325f9c6a3c3458485f0f7f3e718a63d63e72087/core/src/main/scala/kafka/server/ReplicaManager.scala#L2574 ########## core/src/main/scala/kafka/server/ReplicaManager.scala: ########## @@ -2666,8 +2648,8 @@ class ReplicaManager(val config: KafkaConfig, // is unavailable. This is required to ensure that we include the partition's // high watermark in the checkpoint file (see KAFKA-1647). val state = info.partition.toLeaderAndIsrPartitionState(tp, isNew) - val isNewLeaderEpoch = partition.makeFollower(state, offsetCheckpoints, Some(info.topicId)) - + val isNewLeaderEpoch = partition.makeFollower(state, offsetCheckpoints, Some(info.topicId), partitionDirectoryId) + maybeUpdateTopicAssignment(partition, partitionDirectoryId) Review Comment: this already happening as `applyLocalFollowersDelta` and `applyLocalLeadersDelta` are only invoked `ReplicaManager.applyDelta` when `localChanges.followers` or `localChanges.leaders` aren't empty. https://github.com/apache/kafka/blob/4325f9c6a3c3458485f0f7f3e718a63d63e72087/core/src/main/scala/kafka/server/ReplicaManager.scala#L2573 -- 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