ibessonov commented on code in PR #6309:
URL: https://github.com/apache/ignite-3/pull/6309#discussion_r2235346913


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -891,27 +891,37 @@ private CompletableFuture<List<BinaryRow>> 
retrieveExactEntriesUntilCursorEmpty(
                         )
                 ).cursor();
 
-        var resolutionFuts = new 
ArrayList<CompletableFuture<TimedBinaryRow>>(count);
+        var rows = new ArrayList<BinaryRow>(count);
 
-        while (resolutionFuts.size() < count && cursor.hasNext()) {
+        var resolutionFuts = new 
ArrayList<CompletableFuture<TimedBinaryRow>>();
+
+        while ((rows.size() + resolutionFuts.size()) < count && 
cursor.hasNext()) {
             ReadResult readResult = cursor.next();
-            HybridTimestamp newestCommitTimestamp = 
readResult.newestCommitTimestamp();
 
-            TimedBinaryRow candidate;
-            if (newestCommitTimestamp == null || !readResult.isWriteIntent()) {
-                candidate = null;
+            BinaryRow row = readResult.binaryRow();
+            UUID retrievedResultTxId = readResult.transactionId();
+
+            if (!readResult.isWriteIntent() || (readTimestamp == null && 
txId.equals(retrievedResultTxId))) {
+                if (row != null) {
+                    rows.add(row);
+                }
             } else {
-                BinaryRow committedRow = 
cursor.committed(newestCommitTimestamp);
+                HybridTimestamp newestCommitTimestamp = 
readResult.newestCommitTimestamp();
 
-                candidate = committedRow == null ? null : new 
TimedBinaryRow(committedRow, newestCommitTimestamp);
-            }
+                TimedBinaryRow candidate;
+                if (newestCommitTimestamp == null) {
+                    candidate = null;
+                } else {
+                    BinaryRow committedRow = 
cursor.committed(newestCommitTimestamp);

Review Comment:
   I'm too afraid to respond =)
   Probably? Let's not do it here, there may be some consequences



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