cmccabe commented on a change in pull request #10753:
URL: https://github.com/apache/kafka/pull/10753#discussion_r669911056



##########
File path: metadata/src/main/java/org/apache/kafka/image/TopicDelta.java
##########
@@ -103,7 +103,8 @@ public TopicImage apply() {
         for (Entry<Integer, PartitionRegistration> entry : 
partitionChanges.entrySet()) {
             if (entry.getValue().leader == brokerId) {
                 PartitionRegistration prevPartition = 
image.partitions().get(entry.getKey());
-                if (prevPartition == null || prevPartition.leader != brokerId) 
{
+                if (prevPartition == null ||
+                        prevPartition.leaderEpoch != 
entry.getValue().leaderEpoch) {

Review comment:
       Good point. Thinking about it more, we can just check for partition 
epoch here, since LE can't change without PE changing.




-- 
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