You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ascherbakoff (via GitHub)" <gi...@apache.org> on 2026/03/02 07:21:43 UTC

[PR] IGNITE-28019 Fix client tx rollback on local error [ignite-3]

ascherbakoff opened a new pull request, #7689:
URL: https://github.com/apache/ignite-3/pull/7689

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


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-28019 Fix client tx rollback on local error [ignite-3]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7689:
URL: https://github.com/apache/ignite-3/pull/7689#discussion_r2870909617


##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java:
##########
@@ -241,7 +241,18 @@ public CompletableFuture<Void> discardDirectMappings(boolean killed) {
             enlistPartitionLock.writeLock().unlock();
         }
 
-        return sendDiscardRequests().handle((r, e) -> {
+        // The transaction could not be yet rolled back on a coordinator. Make sure it's rolled back and client resource is cleaned up.
+        CompletableFuture<Void> rollbackFut = ch.serviceAsync(ClientOp.TX_ROLLBACK, w -> {
+            w.out().packLong(id);
+
+            if (!isReadOnly && w.clientChannel().protocolContext().isFeatureSupported(TX_DIRECT_MAPPING)) {

Review Comment:
   In `rollbackAndDiscardDirectMappings`, the decision to write the extra `int` (direct enlistments count) is guarded by `TX_DIRECT_MAPPING`. On the server side, `ClientTransactionRollbackRequest` expects this `cnt` field only when the `TX_PIGGYBACK` feature is enabled. If a server supports `TX_DIRECT_MAPPING` but not `TX_PIGGYBACK` (older protocol combinations), this will desynchronize the message stream and break the protocol. Use the same feature check as `rollbackAsync`/server handler (`TX_PIGGYBACK`) for whether to write the enlistments section (even if `cnt=0`).
   ```suggestion
               if (!isReadOnly && w.clientChannel().protocolContext().isFeatureSupported(TX_PIGGYBACK)) {
   ```



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-28019 Fix client tx rollback on local error [ignite-3]

Posted by "ascherbakoff (via GitHub)" <gi...@apache.org>.
ascherbakoff merged PR #7689:
URL: https://github.com/apache/ignite-3/pull/7689


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org