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

IGNITE-14865 Improve error handling in SQL module. #2345

Merged
merged 36 commits into from Aug 9, 2023

Conversation

xtern
Copy link
Contributor

@xtern xtern commented Jul 24, 2023

https://issues.apache.org/jira/browse/IGNITE-14865

We have two main entry points in the SQL module for all public API

  • AsyncSqlCursorImpl#requestNextAsync
  • SqlQueryProcessor#querySingleAsync

requestNextAsync converts internal exceptions to public by itself.

querySingleAsync, cannot translate internal exceptions because SessionImpl#execAsync (and others) handles an internal SessionNotFoundException that currently has no public equivalent (or at least separate sql code).

So for querySingleAsync exception mapping is made in 3 places
(right after SessionNotFoundException handling):

  • SessionImpl#executeAsync
  • SessionImpl#executeBatchAsync
  • JdbcConnectionContext#doInSession

We also have a RemoteFragmentExecutionException which must have a valid traceId and error code, so we convert the internal exception to public and sending traceId and error code in ExchangeServiceImpl#sendError. Those. in this case the exception is converted twice. First time on the remote host, and then the resulting RemoteFragmentExecutionException converts into a SqlException with specified error code.

@xtern xtern closed this Jul 24, 2023
@xtern xtern reopened this Jul 24, 2023
@xtern xtern force-pushed the ignite-14865 branch 4 times, most recently from 6f15d97 to aa72941 Compare July 27, 2023 09:51
@xtern xtern changed the title IGNITE-14865 IGNITE-14865 Improve error handling in SQL module. Jul 27, 2023
@xtern xtern force-pushed the ignite-14865 branch 5 times, most recently from 6c5d9c4 to 4c7ce41 Compare July 28, 2023 07:47
@xtern xtern marked this pull request as ready for review July 28, 2023 10:01
@xtern xtern force-pushed the ignite-14865 branch 3 times, most recently from 4ed156f to ccfd549 Compare July 28, 2023 13:48
@xtern xtern force-pushed the ignite-14865 branch 3 times, most recently from 21ce4ab to d8060b4 Compare July 31, 2023 16:16
@xtern xtern force-pushed the ignite-14865 branch 4 times, most recently from 6f3cab9 to 49b30e4 Compare August 3, 2023 11:46
@xtern xtern merged commit f4c33ff into apache:main Aug 9, 2023
1 check passed
@xtern xtern deleted the ignite-14865 branch August 9, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants