You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2023/05/18 08:22:25 UTC

[GitHub] [ignite-3] zstan commented on a diff in pull request #2079: IGNITE-19278 Multiple partition scan requests return an unexpected number of rows.

zstan commented on code in PR #2079:
URL: https://github.com/apache/ignite-3/pull/2079#discussion_r1197543877


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTableScanTest.java:
##########
@@ -336,6 +337,36 @@ public void testGetAndDeleteDuringPureTableScan() throws Exception {
         );
     }
 
+    /**
+     * Ensures that multiple consecutive scan requests with different requested rows amount
+     * return the expected total number of requested rows.
+     *
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testCompositeScanRequest() throws Exception {
+        int[][] demandPairs = {{3, 1}, {1, 3}};
+
+        for (int[] input : demandPairs) {
+            List<BinaryRow> scannedRows = new ArrayList<>();
+            Publisher<BinaryRow> publisher = internalTable.scan(0, null, null, null, null, 0, null);
+            CompletableFuture<Void> scanned = new CompletableFuture<>();
+
+            Subscription subscription = subscribeToPublisher(scannedRows, publisher, scanned);
+
+            subscription.request(input[0]);
+            subscription.request(input[1]);
+
+            int total = input[0] + input[1];
+            waitForCondition(() -> scannedRows.size() == total, 10_000);
+            assertEquals(total, scannedRows.size(), "input=" + Arrays.toString(input));
+
+            // Close the publisher.
+            subscription.request(1_000);

Review Comment:
   why do we need such request ? can we just cancel it here ?



-- 
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-unsubscribe@ignite.apache.org

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