rpuch commented on code in PR #1464:
URL: https://github.com/apache/ignite-3/pull/1464#discussion_r1055287006


##########
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:
   That is true, comparator should remove this '2 entries' problem. But there 
is still '2 writes to the queue' problem.
   
   Imagine that:
   
   1. `map.compute()` makes first attempt, adds an entry to the queue
   2. GC thread calls `pollForVacuum()` and removes this entry
   3. `map.compute()` makes a second attempt and adds a second entry (equal to 
the first one) for the second time
   4. GC thread polls again, so it sees the same (actually, a different, but 
equal) entry for the second time
   
   Is this possible? Is this valid?



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

Reply via email to