showuon commented on a change in pull request #10985:
URL: https://github.com/apache/kafka/pull/10985#discussion_r668516397



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
##########
@@ -218,70 +253,87 @@ private boolean allSubscriptionsEqual(Set<String> 
allTopics,
                 allRevokedPartitions.addAll(ownedPartitions.subList(minQuota, 
ownedPartitions.size()));
                 // this consumer is potential maxQuota candidate since we're 
still under the number of expected members
                 // with more than the minQuota partitions. Note, if the number 
of expected members with more than
-                // the minQuota partitions is 0, it means minQuota == 
maxQuota, so they won't be put into unfilledMembers
-                if (numMembersAssignedOverMinQuota < 
expectedNumMembersAssignedOverMinQuota) {
-                    unfilledMembers.add(consumer);
+                // the minQuota partitions is 0, it means minQuota == 
maxQuota, and there are no potentially unfilled
+                if (currentNumMembersWithOverMinQuotaPartitions < 
expectedNumMembersWithOverMinQuotaPartitions) {
+                    unfilledMembersWithExactlyMinQuotaPartitions.add(consumer);
                 }
             }
         }
 
         List<TopicPartition> unassignedPartitions = 
getUnassignedPartitions(totalPartitionsCount, partitionsPerTopic, 
assignedPartitions);
-        assignedPartitions = null;
 
         if (log.isDebugEnabled()) {
             log.debug("After reassigning previously owned partitions, unfilled 
members: {}, unassigned partitions: {}, " +
-                "current assignment: {}", unfilledMembers, 
unassignedPartitions, assignment);
+                "current assignment: {}", 
unfilledMembersWithUnderMinQuotaPartitions, unassignedPartitions, assignment);
         }
 
-        Collections.sort(unfilledMembers);
+        Collections.sort(unfilledMembersWithUnderMinQuotaPartitions);

Review comment:
       @ableegoldman , I reviewed it again, and found we forgot to sort the 
`unfilledMembersWithExactlyMinQuotaPartitions` list here, to have deterministic 
result.




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