alievmirza commented on code in PR #1688:
URL: https://github.com/apache/ignite-3/pull/1688#discussion_r1127963680


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -486,11 +487,23 @@ private CompletableFuture<BinaryRow> 
processReadOnlySingleEntryAction(ReadOnlySi
                     format("Unknown single request [actionType={}]", 
request.requestType()));
         }
 
-        CompletableFuture<Void> safeReadFuture = isPrimary ? 
completedFuture(null) : safeTime.waitFor(request.readTimestamp());
+        CompletableFuture<Void> safeReadFuture = 
isPrimaryInTimestamp(isPrimary, readTimestamp) ? completedFuture(null)
+                : safeTime.waitFor(request.readTimestamp());
 
         return safeReadFuture.thenCompose(unused -> 
resolveRowByPkForReadOnly(searchRow, readTimestamp));
     }
 
+    /**
+     * Checks that the node is primary in a passed timestamp.
+     *
+     * @param isPrimary True is the node is primary, false otherwise.
+     * @param timestamp Timestamp to check.
+     * @return True if the timestamp is already come and node in primary, 
otherwise false.

Review Comment:
   ```suggestion
        * @return True if the timestamp is already passed in the reference 
system of the current node and node is primary, false otherwise.
   ```



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -486,11 +487,23 @@ private CompletableFuture<BinaryRow> 
processReadOnlySingleEntryAction(ReadOnlySi
                     format("Unknown single request [actionType={}]", 
request.requestType()));
         }
 
-        CompletableFuture<Void> safeReadFuture = isPrimary ? 
completedFuture(null) : safeTime.waitFor(request.readTimestamp());
+        CompletableFuture<Void> safeReadFuture = 
isPrimaryInTimestamp(isPrimary, readTimestamp) ? completedFuture(null)
+                : safeTime.waitFor(request.readTimestamp());
 
         return safeReadFuture.thenCompose(unused -> 
resolveRowByPkForReadOnly(searchRow, readTimestamp));
     }
 
+    /**
+     * Checks that the node is primary in a passed timestamp.
+     *
+     * @param isPrimary True is the node is primary, false otherwise.

Review Comment:
   ```suggestion
        * @param isPrimary True if the node is primary, false otherwise.
   ```



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -486,11 +487,23 @@ private CompletableFuture<BinaryRow> 
processReadOnlySingleEntryAction(ReadOnlySi
                     format("Unknown single request [actionType={}]", 
request.requestType()));
         }
 
-        CompletableFuture<Void> safeReadFuture = isPrimary ? 
completedFuture(null) : safeTime.waitFor(request.readTimestamp());
+        CompletableFuture<Void> safeReadFuture = 
isPrimaryInTimestamp(isPrimary, readTimestamp) ? completedFuture(null)
+                : safeTime.waitFor(request.readTimestamp());
 
         return safeReadFuture.thenCompose(unused -> 
resolveRowByPkForReadOnly(searchRow, readTimestamp));
     }
 
+    /**
+     * Checks that the node is primary in a passed timestamp.

Review Comment:
   ```suggestion
        * Checks that the node is primary and {@code timestamp} is already 
passed in the reference system of the current node.
   ```



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