vldpyatkov commented on code in PR #2751:
URL: https://github.com/apache/ignite-3/pull/2751#discussion_r1379139996


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -1437,6 +1450,47 @@ private CompletableFuture<Void> finishAndCleanup(
             UUID txId,
             String txCoordinatorId
     ) {
+        TxMeta txMeta = txStateStorage.get(txId);
+
+        // Check that a transaction has already been finished.
+        boolean transactionAlreadyFinished = txMeta != null && 
isFinalState(txMeta.txState());
+
+        // Check locksReleased flag. If it is already set, do nothing and 
return a successful result.
+        // Even if the outcome is different (the transaction was aborted, but 
we want to commit it),
+        // we return 'success' to be in alignment with common transaction 
handling.
+        if (transactionAlreadyFinished) {
+            if (txMeta.locksReleased()) {
+                return completedFuture(null);
+            }
+            // If the locks were not released, we are likely to be in a 
recovery mode and retrying the finish request.
+            // In this case we want to check the expected outcome and the 
actual one.
+            if (commit && txMeta.txState() == ABORTED) {

Review Comment:
   Do you mean we will send a cleanup request with the commit flag == false, 
although the transaction state is committed?



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