ptupitsyn commented on code in PR #7844:
URL: https://github.com/apache/ignite-3/pull/7844#discussion_r3116303082


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/tx/ClientTransactionRollbackRequest.java:
##########
@@ -50,37 +55,56 @@ public static CompletableFuture<ResponseWriter> process(
             ClientResourceRegistry resources,
             ClientHandlerMetricSource metrics,
             IgniteTablesInternal igniteTables,
+            Map<Long, Long> reqToTxMap,
             boolean enableDirectMapping,
             boolean sendRemoteWritesFlag
     )
             throws IgniteInternalCheckedException {
         long resourceId = in.unpackLong();
 
-        InternalTransaction tx = 
resources.remove(resourceId).get(InternalTransaction.class);
+        InternalTransaction tx;
 
-        if (enableDirectMapping && !tx.isReadOnly()) {
-            // Attempt to merge server and client transactions.
-            int cnt = in.unpackInt(); // Number of direct enlistments.
-            for (int i = 0; i < cnt; i++) {
-                int tableId = in.unpackInt();
-                int partId = in.unpackInt();
-                String consistentId = in.unpackString();
-                long token = in.unpackLong();
+        if (!enableDirectMapping) {
+            tx = resources.remove(resourceId).get(InternalTransaction.class);
+        } else if (resourceId < 0) {
+            // Direct mapping was enabled, but the user does not know the 
resourceId, so he sent the first req id.
+            long reqId = -resourceId;
+            var actualResourceId = reqToTxMap.get(reqId);
 
-                TableViewInternal table = igniteTables.cachedTable(tableId);
+            // Is it ok to reuse this error??

Review Comment:
   I think it is ok, let's remove the comment.



-- 
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]

Reply via email to