rpuch commented on code in PR #1464:
URL: https://github.com/apache/ignite-3/pull/1464#discussion_r1056082288
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvPartitionStorage.java:
##########
@@ -204,7 +215,18 @@ public void commitWrite(RowId rowId, HybridTimestamp
timestamp) {
return versionChain;
}
- return VersionChain.forCommitted(timestamp, versionChain);
+ VersionChain committedVersionChain =
VersionChain.forCommitted(timestamp, versionChain);
+
+ if (committedVersionChain.next != null) {
+ // Avoid creating tombstones for tombstones.
+ if (committedVersionChain.row == null &&
committedVersionChain.next.row == null) {
+ return committedVersionChain.next;
+ }
+
+ gcQueue.add(new IgniteBiTuple<>(committedVersionChain, rowId));
Review Comment:
Continuing the example. We now have 2 identical entries in the GC queue.
When the watermark is high enough, GC grabs first of them, nullifies the
pointer to the version it shadows, but this changes nothing from the point of
view of the user, because this entry is not included in the chain. So GC
vacuumed something, but in reality it did not. This might cause confusing
failures in tests.
Why don't we just add synchronization to make sure it behaves as predictable
as possible? This is a test storage, after all. If we must have a trade-off
between performance and simplicity/predictability, we should choose the latter.
--
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]