FrankChen021 opened a new pull request, #19824:
URL: https://github.com/apache/druid/pull/19824
### Description
This fixes the embedded Kafka startup race exposed by
`KafkaIndexFaultToleranceTest.test_supervisorRecords_afterHistoricalRestart`
in #19808.
`Admin.createTopics(...).all().get()` confirms that the topic metadata
operation completed, but it does not guarantee
that every partition leader is already ready to serve requests.
`StreamIndexFaultToleranceTest` creates a topic and
immediately starts its supervisor and publishes records. If the initial
partition leaders are still becoming
available, the first batch can fail to reach Kafka and the test waits for an
`ingest/rows/published` event that never
arrives.
This PR:
- verifies a latest-offset lookup through every initial partition leader
before `createTopicWithPartitions` returns;
- adds regression coverage that publishes 1,000 non-transactional records
immediately after topic creation and
verifies all records reached the three partitions.
This complements #19817: that PR covers readiness after increasing an
existing topic's partition count and surfaces
asynchronous producer failures; this PR covers readiness immediately after
initial topic creation.
There is no end-user behavior change. The affected helper is used only by
embedded tests.
### Tests
- `KafkaResourceTest` passed with the immediate non-transactional publish
regression.
-
`KafkaIndexFaultToleranceTest#test_supervisorRecords_afterHistoricalRestart`
passed twice in focused embedded-test
reactor runs.
- `git diff --check` passed.
Created by GPT-5.6-Sol.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]