Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clientQueryId and its cancel operation #14823

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

albertobastos
Copy link

Adds the option to provide a "clientQueryId" as a QueryOption and eventually use it to cancel the running query.

}
String clientQueryId = extractClientQueryId(sqlNodeAndOptions);
if (StringUtils.isBlank(clientQueryId)) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) in general we don't recommend returning NULL as a coding practice

@siddharthteotia
Copy link
Contributor

Is ClientQueryID a new concept? Is it same as requestID ?

How does the support added here improve the existing Query Cancellation (which is also exposed to user IIRC) ?

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 17.70833% with 79 lines in your changes missing coverage. Please review.

Project coverage is 63.75%. Comparing base (59551e4) to head (c969abd).
Report is 1593 commits behind head on master.

Files with missing lines Patch % Lines
...oller/api/resources/PinotRunningQueryResource.java 0.00% 31 Missing ⚠️
...sthandler/BaseSingleStageBrokerRequestHandler.java 34.14% 20 Missing and 7 partials ⚠️
...pinot/broker/api/resources/PinotClientRequest.java 0.00% 16 Missing ⚠️
...common/response/broker/BrokerResponseNativeV2.java 0.00% 2 Missing ⚠️
...r/requesthandler/BrokerRequestHandlerDelegate.java 0.00% 1 Missing ⚠️
...requesthandler/MultiStageBrokerRequestHandler.java 0.00% 1 Missing ⚠️
...roker/requesthandler/TimeSeriesRequestHandler.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14823      +/-   ##
============================================
+ Coverage     61.75%   63.75%   +2.00%     
- Complexity      207     1611    +1404     
============================================
  Files          2436     2708     +272     
  Lines        133233   151316   +18083     
  Branches      20636    23355    +2719     
============================================
+ Hits          82274    96468   +14194     
- Misses        44911    47606    +2695     
- Partials       6048     7242    +1194     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.71% <17.70%> (+2.00%) ⬆️
java-21 63.62% <17.70%> (+2.00%) ⬆️
skip-bytebuffers-false 63.73% <17.70%> (+1.98%) ⬆️
skip-bytebuffers-true 63.60% <17.70%> (+35.87%) ⬆️
temurin 63.75% <17.70%> (+2.00%) ⬆️
unittests 63.74% <17.70%> (+2.00%) ⬆️
unittests1 56.34% <60.00%> (+9.45%) ⬆️
unittests2 34.05% <15.62%> (+6.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albertobastos
Copy link
Author

Is ClientQueryID a new concept? Is it same as requestID ?

How does the support added here improve the existing Query Cancellation (which is also exposed to user IIRC) ?

Hi Siddharth,

AFAIK, the current cancellation feature depends on the internal requestId generated by the broker itself. That request id is not returned until the query completes, so an external user requires first to ask for the active running queries, determine from the responded array the requestId assigned to the one he's interested in (just comparing the query body) and finally use the cancel operation to abort it. That's two back-and-forth trips between the user and the cluster.

With a client-provided requestId he can skip one step, going straight to the cancel operation using his own ID to abort the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants