yashmayya commented on code in PR #20099:
URL: https://github.com/apache/pinot/pull/20099#discussion_r4602967791
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -905,7 +905,9 @@ private BrokerResponse query(QueryEnvironment.CompiledQuery
query, long requestI
// Short-circuit: if all leaf stages are empty (all segments pruned or
table has no data),
// run only the broker reduce stage locally. No server dispatch is
attempted.
boolean allLeafStagesEmpty = dispatchableSubPlan.isAllLeafStagesEmpty();
- int estimatedNumQueryThreads =
getEstimatedNumQueryThreads(dispatchableSubPlan);
+ // A query estimated above the throttler limit takes the whole limit, so
it runs alone instead of never
+ int estimatedNumQueryThreads =
+ Math.min(getEstimatedNumQueryThreads(dispatchableSubPlan),
_queryThrottler.getMaxPermits());
Review Comment:
This finding is correct, but the effect is limited:
- **The trigger is rare.** The pool shrinks only when a broker starts to
serve its first table, a server is removed from the cluster, or the limit is
lowered. Restarts do not change the pool. The shrink must also occur while an
oversize query waits, and that wait is at most one query timeout.
- **The stall is bounded.** The stuck query times out (10 s by default) and
then the queue moves again. No restart or manual step is necessary.
- **The stall is not new.** As you noted, master has the same stall for an
estimate between the new and the old pool size. This PR adds the queries above
the old pool, which master always rejected.
- **Throttling is off by default.** The stall applies only with the limit
set and the `WAIT` strategy.
The fix is to move the cap into `MultiStageQueryThrottler#tryAcquire`, as
you and gortiz described. That change belongs in a follow-up PR.
--
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]