kfaraz opened a new pull request, #20505: URL: https://github.com/apache/druid/pull/20505
### Description Follow up to #19091 as considered in https://github.com/apache/druid/pull/19091#issuecomment-4018690224. The changes in #19091 have shown that tasks often need to wait for their priors to finish publishing as we often see logs like: ``` Task[xyz] needs to wait before publishing as other taskGroups[abc, def] are currently publishing to partition[KafkaTopicPartition{partition=1, topic='null', multiTopicPartition=false}]. ``` Before this patch, if publish from streaming task A is slow, a later generation task B keeps trying to publish repeatedly until eventually failing once the number of retries is exhausted. It is difficult to fix the number of retries since publish times may vary across supervisors and over time. It is also pointless to retry if we already know that a prior task is yet to finish publishing. This patch tries to address these problems by blocking the task action of the later task B until A is complete. ### Changes - Add `TaskActionClient.submitAsync` which returns a `ListenableFuture` - Update API `/druid/indexer/v1/action` in `OverlordResource` to be async by employing the new `submitAsync()` method - Update task actions `segmentTransactionalAppend` and `segmentTransactionalReplace` to implement `performAsync()` - Update `LocalTaskActionClient.submitAsync()` to use `performAsync()` when the task action supports it - The segment publish is now attempted only when the task is ready to publish - The API response is sent only once the publish attempt is done - For non-streaming tasks, publish is attempted right away <hr> <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. --> This PR has: - [ ] been self-reviewed. - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.) - [ ] added documentation for new or modified features or behaviors. - [ ] a release note entry in the PR description. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md) - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [ ] added integration tests. - [ ] been tested in a test Druid cluster. -- 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]
