dajac commented on code in PR #21495:
URL: https://github.com/apache/kafka/pull/21495#discussion_r2818068401


##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/PlaintextConsumerSubscriptionTest.java:
##########
@@ -462,6 +462,92 @@ public void 
testRe2JPatternSubscriptionAndTopicSubscription() throws Interrupted
     }
     
 
+    /**
+     * Verifies that with async reconciliation, the assignment does not change
+     * in the background without a call to poll(). Validating fix in 
KAFKA-20106.
+     *
+     * When a new topic matching the subscribed pattern is created, the 
reconciliation may
+     * complete in the background, but the assignment should only be updated 
on the next poll().
+     * Without the fix, this test will fail because the assignment will change 
without polling.
+     *
+     * Note: For this bug to manifest, two conditions must be met:
+     * 1. Auto-commit must be disabled: if auto-commit is enabled the full 
reconciliation
+     *    that updates assignment is only triggered from consumer.poll
+     * 2. No ConsumerRebalanceListener callbacks - if callbacks are provided 
they run within
+     *    a call to consumer.poll, so the assignment update requires a call to 
consumer.poll
+     */
+    @ClusterTest
+    public void testAsyncConsumerAssignmentDoesNotChangeWithoutPoll() throws 
InterruptedException {

Review Comment:
   There is an internal config to tweak it if I remember correctly.



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