ascherbakoff commented on code in PR #7052:
URL: https://github.com/apache/ignite-3/pull/7052#discussion_r2580569845
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TransactionInflights.java:
##########
@@ -418,9 +475,13 @@ void cancelWaitingInflights(ReplicationGroupId groupId,
long enlistmentConsisten
}
@Override
- public void onInflightsRemoved() {
+ void onInflightsRemoved(@Nullable Throwable t) {
Review Comment:
🆗
##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java:
##########
@@ -221,13 +221,27 @@ public CompletableFuture<Void> commitAsync() {
boolean enabled =
ch.protocolContext().isFeatureSupported(TX_PIGGYBACK);
CompletableFuture<Void> finishFut = enabled ?
ch.inflights().finishFuture(txId()) : nullCompletedFuture();
- CompletableFuture<Void> mainFinishFut = finishFut.thenCompose(ignored
-> ch.serviceAsync(ClientOp.TX_COMMIT, w -> {
- w.out().packLong(id);
+ CompletableFuture<Void> mainFinishFut = finishFut.handle((ignored, e)
-> {
+ if (e != null) {
+ ch.serviceAsync(ClientOp.TX_ROLLBACK, w -> {
+ w.out().packLong(id);
- if (!isReadOnly && enabled) {
- packEnlisted(w);
+ if (!isReadOnly && enabled) {
+ packEnlisted(w);
+ }
+ }, r -> null);
+
+ return CompletableFuture.<Void>failedFuture(e);
}
- }, r -> null));
+
+ return ch.serviceAsync(ClientOp.TX_COMMIT, w -> {
+ w.out().packLong(id);
+
+ if (!isReadOnly && enabled) {
+ packEnlisted(w);
+ }
+ }, r -> (Void) null);
+ }).thenCompose(x -> x);
Review Comment:
🆗
--
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]