lianetm commented on code in PR #17777:
URL: https://github.com/apache/kafka/pull/17777#discussion_r1843978697


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:
##########
@@ -851,6 +851,11 @@ void maybeReconcile() {
                 revokedPartitions
         );
 
+        // Mark partitions as pending revocation to stop fetching from the 
partitions (no new
+        // fetches sent out, and no in-flight fetches responses processed).
+        System.out.println("revokedPartitions = " + revokedPartitions);
+        markPendingRevocationToPauseFetching(revokedPartitions);

Review Comment:
   makes sense.



##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManagerTest.java:
##########
@@ -1456,6 +1457,7 @@ public void 
testReconcilePartitionsRevokedWithSuccessfulAutoCommitNoCallbacks()
 
         // Complete commit request
         commitResult.complete(null);
+        verify(subscriptionState, times(2)).markPendingRevocation(Set.of(new 
TopicPartition("topic1", 0)));

Review Comment:
   could we extend this test to ensure that the markPending happens before the 
commit is triggered? (Maybe using InOrder like I'm doing here)
   
   
https://github.com/apache/kafka/blob/64d020a44b49ac53b866ac88e360ba961a2730a1/clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerHeartbeatRequestManagerTest.java#L434-L436
 



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