Cyrill commented on code in PR #2856:
URL: https://github.com/apache/ignite-3/pull/2856#discussion_r1422900267


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -516,13 +522,32 @@ private CompletableFuture<Void> 
processTxRecoveryAction(TxRecoveryMessage reques
         boolean transactionAlreadyFinished = txMeta != null && 
isFinalState(txMeta.txState());
 
         if (transactionAlreadyFinished) {
-            return nullCompletedFuture();
+            if (txMeta.locksReleased()) {
+                // Locks released - nothing to do.
+                return nullCompletedFuture();
+            }
+            // Locks were not released - send cleanup.
+            if (txMeta.enlistedPartitions().isEmpty()) {
+                // No enlisted partitions, send cleanup only back to the 
initiator.
+                return txManager.cleanup(nodeConsistentId, txId);
+            } else {
+                // If enlisted partitions exist, we can do the cleanup.
+                return (CompletableFuture<Void>) durableCleanup(txId, txMeta);
+            }
         }
 
         LOG.info("Orphan transaction has to be aborted [tx={}].", txId);
 
-        // TODO: IGNITE-20735 Implement initiate recovery handling logic.
-        return nullCompletedFuture();
+        // If the transaction state is pending, then the transaction should be 
rolled back,
+        // meaning that the state is changed to aborted and a corresponding 
cleanup request
+        // is sent in a common durable manner to a partition that have 
initiated recovery.
+        return txManager.finish(

Review Comment:
   As discussed, no extra action needed.



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