ascherbakoff commented on code in PR #4700:
URL: https://github.com/apache/ignite-3/pull/4700#discussion_r1849927159


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -2735,24 +2738,20 @@ private CompletableFuture<CompletableFuture<?>> 
applyUpdateCommand(
                     );
                 }
 
-                CompletableFuture<UUID> fut = 
applyCmdWithExceptionHandling(cmd, new CompletableFuture<>())
-                        .thenApply(res -> cmd.txId());
+                CompletableFuture<UUID> repFut = 
applyCmdWithExceptionHandling(cmd).thenApply(res -> cmd.txId());
 
-                return completedFuture(fut);
+                return completedFuture(new ApplyResult(null, repFut));
             } else {
-                CompletableFuture<ApplyCommandResult<Object>> resultFuture = 
new CompletableFuture<>();
-
-                applyCmdWithExceptionHandling(cmd, resultFuture);
-
-                return resultFuture.thenCompose(res -> {
+                return applyCmdWithExceptionHandling(cmd).thenCompose(res -> {
                     UpdateCommandResult updateCommandResult = 
(UpdateCommandResult) res.getResult();
 
                     if (updateCommandResult != null && 
!updateCommandResult.isPrimaryReplicaMatch()) {
                         throw new PrimaryReplicaMissException(txId, 
cmd.leaseStartTime(), updateCommandResult.currentLeaseStartTime());
                     }
 
                     if (updateCommandResult != null && 
updateCommandResult.isPrimaryInPeersAndLearners()) {
-                        return safeTime.waitFor(((UpdateCommand) 
res.getCommand()).safeTime()).thenApply(ignored -> null);
+                        return safeTime.waitFor(((UpdateCommand) 
res.getCommand()).safeTime()).thenApply(ignored -> null)
+                                .thenApply(ret -> new 
ApplyResult(((UpdateCommand) res.getCommand()).safeTime(), null));

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

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

Reply via email to