Cyrill commented on code in PR #6711:
URL: https://github.com/apache/ignite-3/pull/6711#discussion_r2416278401
##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageCleanupTest.java:
##########
@@ -970,4 +974,117 @@ void testCleanupBeforeUpdateError() {
verify(indexUpdateHandler, never()).tryRemoveFromIndexes(any(), any(),
any(), any());
}
+ @Test
+ void testSimpleDeleteOperation() {
+ UUID txUuid = UUID.randomUUID();
+ TablePartitionId partitionId = new TablePartitionId(333, PARTITION_ID);
+
+ BinaryRow row1 = binaryRow(new TestKey(1, "foo1"), new TestValue(2,
"bar"));
+ UUID rowId = UUID.randomUUID();
+ HybridTimestamp commitTs = CLOCK.now();
+
+ storageUpdateHandler.handleUpdate(txUuid, rowId, partitionId, row1,
true, null, null, null, null);
+ storageUpdateHandler.switchWriteIntents(txUuid, true, commitTs, null);
+
+ ReadResult committedResult = storage.read(new RowId(PARTITION_ID,
rowId), HybridTimestamp.MAX_VALUE);
+ assertFalse(committedResult.isWriteIntent());
+ assertEquals(row1, committedResult.binaryRow());
+
+ UUID deleteTx = UUID.randomUUID();
+
+ storageUpdateHandler.handleUpdate(deleteTx, rowId, partitionId, null,
true, null, null, null, null);
+
+ ReadResult deleteResult = storage.read(new RowId(PARTITION_ID, rowId),
HybridTimestamp.MAX_VALUE);
+ assertTrue(deleteResult.isWriteIntent());
+ assertNull(deleteResult.binaryRow());
Review Comment:
You can switch it further and check no data in the storage after the deletion
--
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]