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

Throw a separate exception when a query is terminated because of OOM protection #14999

Open
vrajat opened this issue Feb 5, 2025 · 1 comment

Comments

@vrajat
Copy link
Collaborator

vrajat commented Feb 5, 2025

If OOM protection is turned on and the accountant terminates a query, EarlyTerminationException is thrown. It is not possible to know if a query was terminated due to user interruption, response generated or OOM termination. Since OOM termination is due to the system's decision it is useful to have a separate exception and error code.

A pre-requiste is a fix for #14950 to pass on the error code from an error in the server.

OOM Cancellation in Broker

  "exceptions": [
    {
      "message": "QueryCancellationError:\norg.apache.pinot.spi.exception.QueryCancelledException: Cancelled while building data table\n\tat org.apache.pinot.core.query.scheduler.QueryScheduler.serializeResponse(QueryScheduler.java:227)\n\tat org.apache.pinot.core.query.scheduler.QueryScheduler.processQueryAndSerialize(QueryScheduler.java:156)\n\tat org.apache.pinot.core.query.scheduler.QueryScheduler.lambda$createQueryFutureTask$0(QueryScheduler.java:124)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)\n...\nCaused by: org.apache.pinot.spi.exception.EarlyTerminationException: Interrupted while merging records\n\tat org.apache.pinot.spi.trace.Tracing$ThreadAccountantOps.sampleAndCheckInterruption(Tracing.java:350)\n\tat org.apache.pinot.spi.trace.Tracing$ThreadAccountantOps.sampleAndCheckInterruptionPeriodically(Tracing.java:366)\n\tat org.apache.pinot.core.query.selection.SelectionOperatorUtils.getDataTableFromRows(SelectionOperatorUtils.java:391)\n\tat org.apache.pinot.core.operator.blocks.results.SelectionResultsBlock.getDataTable(SelectionResultsBlock.java:84)",
      "errorCode": 503
    },

OOM cancellation in server for MSE

Error Code: 200

QueryExecutionError:
Received error query execution result block: {200=QueryExecutionError:
Query execution error on: Server_100.81.71.117_7052 org.apache.pinot.spi.exception.EarlyTerminationException: Interrupted while processing next block}
org.apache.pinot.query.service.dispatch.QueryDispatcher.runReducer(QueryDispatcher.java:472)
org.apache.pinot.query.service.dispatch.QueryDispatcher.submitAndReduce(QueryDispatcher.java:135)
org.apache.pinot.broker.requesthandler.MultiStageBrokerRequestHandler.handleRequest(MultiStageBrokerRequestHandler.java:265)
org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleRequest(BaseBrokerRequestHandler.java:168)

OOM cancellation in server for SSE:

"exceptions": [
    {
      "message": "QueryExecutionError:\nQuery execution error on: Server_100.81.71.117_7050 org.apache.pinot.spi.exception.EarlyTerminationException: Interrupted while processing next block",
      "errorCode": 200
    },
@vrajat
Copy link
Collaborator Author

vrajat commented Feb 6, 2025

cc @jasperjiaguo @vvivekiyer for your opinion

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

No branches or pull requests

2 participants