rpuch commented on code in PR #2566:
URL: https://github.com/apache/ignite-3/pull/2566#discussion_r1322937781


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -1469,22 +1478,41 @@ private <T> CompletableFuture<T> appendTxCommand(UUID 
txId, RequestType cmdType,
         }
 
         if (!fut.isDone()) {
-            op.get().whenComplete((v, th) -> {
-                if (full) { // Fast unlock.
-                    releaseTxLocks(txId);
-                }
+            validateAtTsIfRwRead(txId, cmdType)
+                    .thenCompose(unused -> op.get())
+                    // Write actions do ts-dependent validations after taking 
locks. If it turned out that nothing has to be written,
+                    // then no lock is taken and, hence, no ts-dependent 
validations are invoked. But, as such validations
+                    // must be invoked for any write, we do it here.
+                    .thenCompose(actionResult -> 
validateAtTsIfWriteDidNotDoTsValidation(actionResult, txId, cmdType))
+                    .whenComplete((v, th) -> {
+                        if (full) { // Fast unlock.
+                            releaseTxLocks(txId);
+                        }
 
-                if (th != null) {
-                    fut.completeExceptionally(th);
-                } else {
-                    fut.complete(v);
-                }
-            });
+                        if (th != null) {
+                            fut.completeExceptionally(th);
+                        } else {
+                            fut.complete(v);
+                        }
+                    });
         }
 
         return fut;
     }
 
+    private CompletableFuture<Void> validateAtTsIfRwRead(UUID txId, 
RequestType cmdType) {
+        return cmdType.isRwRead() ? chooseOpTsAndValidateAtIt(txId) : 
completedFuture(null);

Review Comment:
   The method has gone



-- 
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]

Reply via email to