-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Map BadQueryRequestException to QueryException.QUERY_VALIDATION_ERROR #14917
Changes from 17 commits
aa2f562
0114c7a
89de614
1d8ac33
d1257f2
781733d
bf47aac
ec7cec1
e0e1b09
713c197
d51a37e
beb88e0
520bf69
c3397d8
1bce9ff
4f13fb0
d2e85cb
b8a42e8
c3b0b48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.apache.pinot.common.exception; | ||
|
||
import org.apache.pinot.common.response.ProcessingException; | ||
|
||
|
||
/** | ||
* Exception to contain info about QueryException errors. | ||
* Throwable version of {@link org.apache.pinot.common.response.broker.QueryProcessingException} | ||
*/ | ||
public class QueryInfoException extends RuntimeException { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this class?QueryException is more of QueryExceptionUtil. It isn't throwable and rather a collection of static Can't you use static QueryException.QUERY_VALIDATION_ERROR (or other from that family) directly?Because they are basically Can't you use QueryProcessingException instead?QueryProcessingException isn't throwable. It's named exception but it's really a QueryExceptionContainer used on broker side. |
||
private ProcessingException _processingException; | ||
|
||
public QueryInfoException(String message) { | ||
super(message); | ||
} | ||
|
||
public QueryInfoException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public QueryInfoException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public ProcessingException getProcessingException() { | ||
return _processingException; | ||
} | ||
|
||
public void setProcessingException(ProcessingException processingException) { | ||
_processingException = processingException; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
import org.apache.pinot.core.operator.combine.merger.ResultsBlockMerger; | ||
import org.apache.pinot.core.query.request.context.QueryContext; | ||
import org.apache.pinot.core.query.scheduler.resources.ResourceManager; | ||
import org.apache.pinot.spi.exception.BadQueryRequestException; | ||
import org.apache.pinot.spi.exception.EarlyTerminationException; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
@@ -111,7 +112,11 @@ protected void processSegments() { | |
@Override | ||
protected void onProcessSegmentsException(Throwable t) { | ||
_processingException.compareAndSet(null, t); | ||
_blockingQueue.offer(new ExceptionResultsBlock(t)); | ||
if (t instanceof BadQueryRequestException) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In ServerQueryExecutorV1Impl, we are setting Either way I see this change only being made in BaseSingleBlockCombineOperator. What about GroupByCombineOperator and BaseStreamingCombineOperator? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It does. Without this change, generic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah just noticed these implement the same interface. Will update them as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All patched. |
||
_blockingQueue.offer(new ExceptionResultsBlock(QueryException.QUERY_VALIDATION_ERROR, t)); | ||
} else { | ||
_blockingQueue.offer(new ExceptionResultsBlock(t)); | ||
} | ||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update broker metrics - BrokerMeter.QUERY_VALIDATION_EXCEPTIONS ?
We should also update this in SingleStageBrokerRequestHandler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For
SingleStageBrokerRequestHandler
, this is not needed becauseBadQueryRequestException
thrown byServerQueryExecutorV1Impl
is stored in BrokerResponseNative object. It's directly parsed in PinotClientRequest::getPinotQueryResponse.For this
MultiStageBrokerRequestHandler
, this was needed because query was handled by_queryDispatcher.submitAndReduce
which may throw an exception. The Java exception needs to be caught on the broker request handler level.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diagrams for these two error reporting scenarios. Many middle steps are omitted and only relevant steps are shown 👇🏼
MultiStage query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metric incremented now. Resolved