xtern commented on code in PR #1501:
URL: https://github.com/apache/ignite-3/pull/1501#discussion_r1086681785
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -428,7 +431,8 @@ private CompletableFuture<AsyncSqlCursor<List<Object>>>
querySingle0(
InternalTransaction implicitTx =
implicitTxRequired ? txManager.begin() : null;
BaseQueryContext enrichedContext =
- implicitTxRequired ?
ctx.toBuilder().transaction(implicitTx).build() : ctx;
+ implicitTxRequired ?
ctx.toBuilder().transaction(implicitTx)
+
.transactionId(distributedSqlDisabled ? null : implicitTx.id()).build() : ctx;
Review Comment:
As I understand, you suggest to set `transactionId` mandatory.
But such change will require to change condition order in scan nodes.
```
if (readOnlyTx) {
pub = physTable.scan(...
} else if (context().transactionId() != null) {
pub = physTable.scan(...
} else {
// TODO IGNITE-17952 This block should be removed.
// Workaround to make RW scan work from tx coordinator.
pub = physTable.scan(partId, context().transaction());
}
```
to something like this
```
if (readOnlyTx) {
pub = physTable.scan(...
} else if (context.transaction() != null) {
// TODO IGNITE-17952 This block should be removed.
// Workaround to make RW scan work from tx coordinator.
pub = physTable.scan(partId, context().transaction());
} else {
pub = physTable.scan(...
}
```
otherwise, we will try to do an RW scan on the local host because
DISTRIBUTED_TRAIT is currently disabled and we send all plan fragments to the
local host.
Is it ok?
--
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]