ibessonov commented on code in PR #6309: URL: https://github.com/apache/ignite-3/pull/6309#discussion_r2230385436
########## 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: If you can create a ticket then that would be awesome. > Why do we call it outside, btw? Lack of care for performance, I guess -- 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