vldpyatkov commented on code in PR #5146:
URL: https://github.com/apache/ignite-3/pull/5146#discussion_r1939198425
##########
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 believe it is better to create an additional ticket about it.
I am going to forbid killing a full transaction in the current patch.
--
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]