XianReallyHot-ZZH commented on PR #13762:
URL: https://github.com/apache/ignite/pull/13762#issuecomment-6824065882
@chesnokoff thanks for taking a look!
You're right that the original SQL error text is still visible in the
message — the goal of the PR is not about the message text. What's missing on
master is the structured exception: for a general map-node failure,
`GridReduceQueryExecutor.fail()` creates `new CacheException(mapperFailedMsg)`
with no cause at all (the cancel/retry branches do have typed causes), so a
client that needs to handle the failure programmatically has no option but to
string-parse `errMsg=`. The PR keeps the outer `CacheException` and its message
exactly as on master — no message format changes — and only adds a typed
`IgniteSQLException` as a cause, so that `X.cause(e, IgniteSQLException.class)`
works on the client. That is the non-breaking form of what the old ticket title
asks for ("SqlException must be thrown instead of CacheException" — actually
throwing it would break existing `catch (CacheException)` code).
On the rolling-upgrade concern — agreed, that risk is real, so the new
`statusCode` field is gated through the existing feature-gating mechanism for
optional wire fields (`@Order(introducedBy =
"QUERY_FAIL_RESPONSE_ERROR_CODE_FEATURE")` + `CoreFeatureRegistry`), and the
`wire-compatibility-check` baseline is updated in the PR. To be honest, for H2
runtime errors the code carried today is still the generic `UNKNOWN` (richer
codes would be future work), so the wire field is mostly groundwork rather than
the main value of the change.
Given that, if you feel the wire-format part is not worth the risk, I'm
happy to narrow the PR: drop the `statusCode` field entirely and reconstruct
the `IgniteSQLException` cause on the reducer locally from the existing
`errMsg` string — zero wire changes. WDYT?
--
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]