C0urante opened a new pull request, #16598: URL: https://github.com/apache/kafka/pull/16598
[Jira](https://issues.apache.org/jira/browse/KAFKA-16383) The flaky failures for this test appear to be due to a race condition. The current test steps are: 1. We produce 100 records to `test-topic-1` 2. We start the MM2 connectors 3. We wait for connector tasks to start (i.e., for there to be at least one task in the `RUNNING` state for each) 4. We produce 100 more records to `test-topic-1` The assumption is that the `MirrorSourceTask` instance will poll its consumer in between steps 3 and 4 and seek to the end offset of `test-topic-1`. However, it's possible that the task instance will have completed startup and be marked `RUNNING` by the Kafka Connect runtime, but that it has not been polled yet. If this takes place and the task is polled (or rather, the task first polls its consumer) after step 4, then it will ignore those records when it seeks to the end of the topic. As a fix, we wait for the task to replicate data from a "sentinel" topic first, before producing an additional 100 records to `test-topic-1`. This guarantees that the task has been able to poll its consumer and seek to the end of `test-topic-1`, and allows us to verify that the task should replicate exactly 100 records for that topic. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- 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]
