lianetm commented on code in PR #21495:
URL: https://github.com/apache/kafka/pull/21495#discussion_r2817645107
##########
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:
this test did the job of showing the friction we had at the API level, same
KS experienced (fails without the fix, passes with it), but it takes waiting
for regex resolution which has a min of 10s.
Honestly, I couldn't think of a faster way to test this "assignment change
without poll"
@squah-confluent is there maybe a trick/config I may be missing to get a
regex resolved faster for this test?
--
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]