timothy-e commented on code in PR #18791:
URL: https://github.com/apache/pinot/pull/18791#discussion_r3460880342
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java:
##########
@@ -212,36 +242,64 @@ public QueryResult submitAndReduce(RequestContext
context, DispatchableSubPlan d
}
long requestId = context.getRequestId();
Set<QueryServerInstance> servers = new HashSet<>();
- // Tracks servers where recordStatsForQuerySubmission was actually called,
so the finally block only
- // decrements servers that were incremented — guarding against a partial
failure in submit().
Set<QueryServerInstance> incrementedServers = new HashSet<>();
- try {
- submit(requestId, dispatchableSubPlan, timeoutMs, servers, queryOptions);
- // The SSE engine increments before `submit`, but here we increment
after because `submit` populates
- // the list of servers. Getting the list of servers before calling
`submit` would expose
- // implementation details of `submit`.
- if (statsManager != null) {
- for (QueryServerInstance server : servers) {
- statsManager.recordStatsForQuerySubmission(requestId,
server.getInstanceId());
- incrementedServers.add(server);
+ long submitTimeMs = _clock.getAsLong();
+ QueryResult result = null;
+ CancelOutcome cancelOutcome = CancelOutcome.NONE;
+
+ AdaptiveRoutingStageClassification classification = null;
+ Consumer<QueryServerInstance> preDispatchHook = null;
+ if (statsManager != null) {
+ classification =
AdaptiveRoutingStageClassification.classify(dispatchableSubPlan);
Review Comment:
Integrating this with the stream mode is best left for a follow up PR,
because it will expand the scope and require a lot more testing than what I've
already done.
Explicitly turning it off would require reverting some of the changes added
in the streaming PR, which also feels weird to do in this PR.
Since the current state is "streaming stats doesn't track latency for MSE
adaptive routing," I think it makes sense to leave it as is and create a github
issue to support it.
--
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]