korlov42 commented on code in PR #4977:
URL: https://github.com/apache/ignite-3/pull/4977#discussion_r1905040519
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/Query.java:
##########
@@ -60,6 +60,7 @@ class Query {
volatile @Nullable SqlOperationContext operationContext = null;
volatile @Nullable QueryPlan plan = null;
volatile @Nullable QueryTransactionWrapper usedTransaction = null;
+ volatile @Nullable Throwable error = null;
Review Comment:
it might be better to use AtomicRef here, so that the root cause is not
overridden accidentally
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/Program.java:
##########
@@ -76,6 +76,8 @@ CompletableFuture<ResultT> run(Query query) {
try {
if (errorHandler.test(query, th)) {
+ query.error = null;
Review Comment:
state recovery should be done in
`org.apache.ignite.internal.sql.engine.exec.fsm.QueryExecutionProgram#errorHandler`
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -445,6 +446,7 @@ private AsyncDataCursor<InternalSqlRow>
executeExecutablePlan(
if (txWrapper == null) {
Review Comment:
I would prefer to replace this IF with
```
QueryTransactionWrapper txWrapper =
txContext.getOrStartSqlManaged(((ExplainablePlan) plan).type() !=
SqlQueryType.DML, true);
operationContext.notifyTxUsed(txWrapper);
```
Changes in
`org.apache.ignite.internal.sql.engine.exec.fsm.QueryInfo#deriveTxId` can be
reverted
--
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]