You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/07/04 11:17:23 UTC

[GitHub] [ignite-3] sanpwc commented on a diff in pull request #918: IGNITE-16760

sanpwc commented on code in PR #918:
URL: https://github.com/apache/ignite-3/pull/918#discussion_r912901102


##########
modules/metastorage-server/src/test/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorageTest.java:
##########
@@ -2043,6 +2043,43 @@ public void rangeCursor() {
         }
     }
 
+    @Test
+    public void rangeCursorSkippingTombstones() {
+        byte[] key1 = key(1);
+        byte[] val1 = keyValue(1, 1);
+
+        byte[] key2 = key(2);
+        byte[] val2 = keyValue(2, 2);
+
+        assertEquals(0, storage.revision());
+        assertEquals(0, storage.updateCounter());
+
+        storage.put(key1, val1);
+
+        assertEquals(1, storage.revision());
+        assertEquals(1, storage.updateCounter());
+
+        storage.remove(key1);
+
+        assertEquals(2, storage.revision());
+        assertEquals(2, storage.updateCounter());
+
+        storage.put(key2, val2);
+
+        assertEquals(3, storage.revision());
+        assertEquals(3, storage.updateCounter());
+
+        // Range that includes tombstones.
+        Cursor<Entry> cur = storage.range(key1, null, true);
+
+        assertEquals(2, cur.stream().count());

Review Comment:
   I'd rather add extra check not only for size, but for actual returned data set. Otherwise given test will pass if, for example, only tombstone is returned as a result for `storage.range(key1, null, false);`



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