Skip to content

[Backport] Dart: Async queries to realtime servers.#18278

Merged
capistrant merged 1 commit intoapache:34.0.0from
capistrant:backport-18241-to-34.0.0
Jul 18, 2025
Merged

[Backport] Dart: Async queries to realtime servers.#18278
capistrant merged 1 commit intoapache:34.0.0from
capistrant:backport-18241-to-34.0.0

Conversation

@capistrant
Copy link
Copy Markdown
Contributor

Backport of #18241 to 34.0.0.

* Dart: Async queries to realtime servers.

Prior to this patch, queries from MSQ workers to data servers would
be initiated in the processing pool, and would block the processing
pool until results started coming in. This patch addresses it with
the strategy:

1) Update DataServerClient to return a future that resolves when the
   response starts being written.

2) Split DataServerQueryHandler into DartDataServerQueryHandler and
   IndexerDataServerQueryHandler. The Dart version doesn't do retries
   and doesn't follow segments to other data servers. It just returns
   the async future from DataServerClient. The Indexer (tasks) version
   retains the prior logic and isn't really async. I didn't attempt to
   asyncify its retry logic in this patch.

3) Add ReturnOrAwait.awaitAllFutures, which allows processors to wait
   for a future to resolve.

4) Update ScanQueryFrameProcessor and GroupByPreShuffleFrameProcessor
   to give up the processing thread when waiting for a data server query
   to come back.

Additionally, to simplify DataServerClient, cancellations are now
issued without using a scheduled executor. There should be no need for
this, because the service client is async.

* Fix tests and checkstyle.

* Fix exception checking.
@github-actions github-actions Bot added Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Jul 17, 2025
@capistrant
Copy link
Copy Markdown
Contributor Author

the flaked IT is a known issue and needs fix in master and backport to 34

@capistrant capistrant merged commit cd89f70 into apache:34.0.0 Jul 18, 2025
135 of 138 checks passed
@capistrant capistrant added this to the 34.0.0 milestone Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 Backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants