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


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/ReadWriteTransactionImpl.java:
##########
@@ -159,18 +162,54 @@ public CompletableFuture<Void> finish(boolean commit, 
@Nullable HybridTimestamp
             return finishFuture;
         }
 
+        return finishInternal(commit, executionTimestamp, full, true);
+    }
+
+    private CompletableFuture<Void> finishInternal(
+            boolean commit,
+            @Nullable HybridTimestamp executionTimestamp,
+            boolean full,
+            boolean isComplete
+    ) {
         enlistPartitionLock.writeLock().lock();
 
         try {
             if (finishFuture == null) {
+                if (killed) {
+                    if (isComplete) {
+                        finishFuture = nullCompletedFuture();
+
+                        return failedFuture(new TransactionException(
+                                TX_ALREADY_FINISHED_ERR,
+                                format("Transaction is killed [id={}, 
state={}].", id(), state())
+                        ));
+                    } else {
+                        return nullCompletedFuture();
+                    }
+                }
+
                 if (full) {
                     txManager.finishFull(observableTsTracker, id(), 
executionTimestamp, commit);
 
-                    finishFuture = nullCompletedFuture();
+                    if (isComplete) {
+                        finishFuture = nullCompletedFuture();
+                    } else {
+                        killed = true;

Review Comment:
   I do not have an answer for this question.
   Currently, this internal API is going to be used to finish long-running 
transactions, which can be noted in the transaction view. The view has all 
transactions, either explicit or implicit (full is here).
   On the other side, I do not think we have a way to roll back a full 
transaction.



-- 
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-unsubscr...@ignite.apache.org

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

Reply via email to