philipnee commented on code in PR #13550:
URL: https://github.com/apache/kafka/pull/13550#discussion_r1165959573


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java:
##########
@@ -153,43 +158,46 @@ private boolean allSubscriptionsEqual(Set<String> 
allTopics,
             List<TopicPartition> ownedPartitions = new ArrayList<>();
             consumerToOwnedPartitions.put(consumer, ownedPartitions);
 
-            // Only consider this consumer's owned partitions as valid if it 
is a member of the current highest
-            // generation, or it's generation is not present but we have not 
seen any known generation so far
-            if (memberData.generation.isPresent() && 
memberData.generation.get() >= maxGeneration
+            if (memberData.generation.isPresent() && 
memberData.generation.get() >= maxGeneration - 1
                 || !memberData.generation.isPresent() && maxGeneration == 
DEFAULT_GENERATION) {
 
-                // If the current member's generation is higher, all the 
previously owned partitions are invalid
-                if (memberData.generation.isPresent() && 
memberData.generation.get() > maxGeneration) {

Review Comment:
   we don't need this because the maxGeneration has already been computed 
previously, so we know the set of valid members.



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