You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/07/10 00:37:58 UTC

[GitHub] [kafka] guozhangwang commented on a change in pull request #9005: KAFKA-10263: Do not assign standby for revoking stateless tasks

guozhangwang commented on a change in pull request #9005:
URL: https://github.com/apache/kafka/pull/9005#discussion_r452562468



##########
File path: streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignorTest.java
##########
@@ -1402,9 +1404,13 @@ public void shouldTriggerImmediateRebalanceOnTasksRevoked() {
         final Map<String, Assignment> assignment = partitionAssignor.assign(metadata, new GroupSubscription(subscriptions)).groupAssignment();
 
         // Verify at least one partition was revoked
-        assertThat(assignment.get(CONSUMER_1).partitions(), not(allTasks));
+        assertThat(assignment.get(CONSUMER_1).partitions(), not(allPartitions));
         assertThat(assignment.get(CONSUMER_2).partitions(), equalTo(emptyList()));
 
+        // Verify that stateless revoked tasks would not be assigned as standbys
+        assertThat(AssignmentInfo.decode(assignment.get(CONSUMER_2).userData()).activeTasks(), equalTo(emptyList()));
+        assertThat(AssignmentInfo.decode(assignment.get(CONSUMER_2).userData()).standbyTasks(), equalTo(emptyMap()));

Review comment:
       Verified that without the fix, this line will fail.

##########
File path: streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignorTest.java
##########
@@ -1402,9 +1404,13 @@ public void shouldTriggerImmediateRebalanceOnTasksRevoked() {
         final Map<String, Assignment> assignment = partitionAssignor.assign(metadata, new GroupSubscription(subscriptions)).groupAssignment();
 
         // Verify at least one partition was revoked
-        assertThat(assignment.get(CONSUMER_1).partitions(), not(allTasks));
+        assertThat(assignment.get(CONSUMER_1).partitions(), not(allPartitions));

Review comment:
       I found it was always true because we are comparing a list of tasks with a list of partitions ;)




----------------------------------------------------------------
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:
users@infra.apache.org