ibessonov commented on code in PR #7999:
URL: https://github.com/apache/ignite-3/pull/7999#discussion_r3116830060
##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java:
##########
@@ -247,8 +251,14 @@ public CompletableFuture<Void>
rollbackAndDiscardDirectMappings(boolean killed)
if (finishFut != null) {
return finishFut;
} else {
- finishFut = new CompletableFuture<>();
+ if (implicitRollbackFut == null) {
Review Comment:
I believe that `} else if (implicitRollbackFut == null) {` would be more
convenient. Not as nested. I have the same comment for other similar changes in
this file.
##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxFinishReplicaRequestHandler.java:
##########
@@ -224,12 +224,22 @@ private CompletableFuture<TransactionResult>
finishAndCleanup(
.map(entry -> new EnlistedPartitionGroup(entry.getKey(),
entry.getValue().tableIds()))
.collect(toList());
return finishTransaction(enlistedPartitionGroups, txId, commit,
commitTimestamp)
- .thenCompose(txResult -> {
+ .thenApply(txResult -> {
boolean actualCommit = txResult.transactionState() ==
COMMITTED;
HybridTimestamp actualCommitTs =
txResult.commitTimestamp();
- return txManager.cleanup(replicationGroupId,
enlistedPartitions, actualCommit, actualCommitTs, txId)
- .thenApply(v -> txResult);
+ try {
+ txManager.cleanup(replicationGroupId,
enlistedPartitions, actualCommit, actualCommitTs, txId)
+ .thenApply(v -> txResult).whenComplete((r, e)
-> {
Review Comment:
```suggestion
.whenComplete((r, e) -> {
```
--
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]