cmccabe commented on a change in pull request #10572: URL: https://github.com/apache/kafka/pull/10572#discussion_r636526690
########## File path: metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java ########## @@ -387,6 +398,12 @@ public void replay(PartitionChangeRecord record) { String topicPart = topicInfo.name + "-" + record.partitionId() + " with topic ID " + record.topicId(); newPartitionInfo.maybeLogPartitionChange(log, topicPart, prevPartitionInfo); + if ((newPartitionInfo.leader != newPartitionInfo.preferredReplica()) && Review comment: Can we have a function like "hasPreferredLeader" on `PartitionControlInfo`, to make this simpler? -- 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