tkalkirill commented on code in PR #1952:
URL: https://github.com/apache/ignite-3/pull/1952#discussion_r1173496601
##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandlerTest.java:
##########
@@ -104,6 +118,56 @@ void testBuildIndex() {
verify(indexes, times(2)).addIndexToWaitIfAbsent(indexId);
}
+ @Test
+ void testVacuum() {
+ PartitionDataStorage partitionStorage = createPartitionDataStorage();
+
+ StorageUpdateHandler storageUpdateHandler =
createStorageUpdateHandler(partitionStorage,
mock(TableIndexStoragesSupplier.class));
+
+ HybridTimestamp lowWatermark = new HybridTimestamp(100, 100);
+
+ assertFalse(storageUpdateHandler.vacuum(lowWatermark));
+ verify(partitionStorage).pollForVacuum(lowWatermark);
+ // Let's check that StorageUpdateHandler#vacuumBatch returns true.
+ clearInvocations(partitionStorage);
+
+ BinaryRowAndRowId binaryRowAndRowId = new
BinaryRowAndRowId(mock(BinaryRow.class), new RowId(PARTITION_ID));
+
+
when(partitionStorage.scanVersions(any(RowId.class))).thenReturn(CursorUtils.emptyCursor());
+
when(partitionStorage.pollForVacuum(lowWatermark)).thenReturn(binaryRowAndRowId);
+
+ assertTrue(storageUpdateHandler.vacuum(lowWatermark));
+ verify(partitionStorage).pollForVacuum(lowWatermark);
+ }
+
+ @Test
+ void testExecuteBatchGc() {
+ PartitionDataStorage partitionStorage = createPartitionDataStorage();
+
+ StorageUpdateHandler storageUpdateHandler =
createStorageUpdateHandler(partitionStorage,
mock(TableIndexStoragesSupplier.class));
+
+ // Let's check that if lwm is {@code null} then nothing will happen.
+ storageUpdateHandler.executeBatchGc(null);
Review Comment:
For example, when we start the node for the first time and have not yet
assigned the first low watermark.
--
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]