mumrah commented on a change in pull request #9100: URL: https://github.com/apache/kafka/pull/9100#discussion_r489703810
########## File path: core/src/main/scala/kafka/cluster/Partition.scala ########## @@ -1210,6 +1317,37 @@ class Partition(val topicPartition: TopicPartition, } } + private def sendAlterIsrRequest(newIsr: Set[Int]): Boolean = { + val newLeaderAndIsr = new LeaderAndIsr(localBrokerId, leaderEpoch, newIsr.toList, zkVersion) + alterIsrManager.enqueueIsrUpdate(AlterIsrItem(topicPartition, newLeaderAndIsr, result => { + inWriteLock(leaderIsrUpdateLock) { + result match { + case Left(error: Errors) => error match { + case Errors.UNKNOWN_TOPIC_OR_PARTITION => + debug(s"Controller failed to update ISR for $topicPartition since it doesn't know about this partition. Giving up.") + case Errors.FENCED_LEADER_EPOCH => + debug(s"Controller failed to update ISR for $topicPartition since we sent an old leader epoch. Giving up.") + case _ => + pendingInSyncReplicaIds = None Review comment: I think this has been a long-standing bad assumption on my part in this PR. I've been (mis)treating `pendingInSyncReplicaIds` as a mechanism for initiating a retry along with its other semantics. You're right though, explicitly re-sending the ISR is definitely better. ---------------------------------------------------------------- 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: us...@infra.apache.org