lucasbru commented on code in PR #23638:
URL: https://github.com/apache/kafka/pull/23638#discussion_r4641454084


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMember.java:
##########
@@ -385,14 +385,20 @@ public StreamsGroupDescribeResponseData.Member 
asStreamsGroupDescribeMember(
                 
.setWarmupTasks(taskIdsFromMap(targetAssignment.warmupTasks()));
         }
 
+        // The assignment includes both assigned tasks and tasks pending
+        // revocation because the member is still responsible for the latter 
until
+        // revocation is complete.
+        final TasksTupleWithEpochs assignedTasksWithPendingRevocation = 
tasksPendingRevocation.isEmpty() ?

Review Comment:
   Unlike partitions in the consumer case, tasks can change role in place. When 
an active task is demoted to standby, `CurrentAssignmentBuilder` grants the 
standby right away but keeps the active task pending revocation until the 
member acks. So with this merge, describe will list the same task as both 
active and standby for that member. Is that intended? It seems accurate to me, 
since the member still owns the active task until the ack, but it might 
surprise tools reading the output. Maybe worth a note in the comment here and a 
test for it.



##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMemberTest.java:
##########
@@ -421,6 +430,35 @@ public void testAsStreamsGroupDescribeMember() {
         assertEquals(expected, actual);
     }
 
+    @Test
+    public void 
testAsStreamsGroupDescribeMemberWithOnlyTasksPendingRevocation() {

Review Comment:
   In both unit tests the assigned and pending tasks are in different 
subtopologies for every role, so merging into the same subtopology entry is 
only covered for active tasks, in the integration test. The consumer fix has 
`testAsConsumerGroupDescribeMemberWithSameTopicPendingRevocation` for this. 
Could you add a similar case here, with assigned and pending standby/warmup 
tasks sharing a subtopology (and ideally the demoted-active-task overlap)?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to