showuon commented on code in PR #12748:
URL: https://github.com/apache/kafka/pull/12748#discussion_r1035598438


##########
clients/src/test/java/org/apache/kafka/clients/consumer/StickyAssignorTest.java:
##########
@@ -272,6 +284,73 @@ public void testSchemaBackwardCompatibility() {
         assertTrue(isFullyBalanced(assignment));
     }
 
+    @Test
+    public void testMemberDataWithInconsistentData() {
+        Map<String, Integer> partitionsPerTopic = new HashMap<>();
+        partitionsPerTopic.put(topic, 2);
+        List<TopicPartition> ownedPartitionsInUserdata = partitions(tp1);
+        List<TopicPartition> ownedPartitionsInSubscription = partitions(tp0);
+
+        assignor.onAssignment(new 
ConsumerPartitionAssignor.Assignment(ownedPartitionsInUserdata), new 
ConsumerGroupMetadata(groupId, generationId, consumer1, Optional.empty()));
+        ByteBuffer userDataWithHigherGenerationId = 
assignor.subscriptionUserData(new HashSet<>(topics(topic)));
+        // The owned partitions and generation id are provided in user data 
and different owned partition is provided in subscription without generation id
+        // If subscription provides no generation id, we'll honor the 
generation id in userData and owned partitions in subscription

Review Comment:
   You're right! Updated.



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