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


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/AddWriteLinkingWiInvokeClosure.java:
##########
@@ -83,22 +83,28 @@ protected RowVersion insertFirstRowVersion() {
     }
 
     @Override
-    protected RowVersion insertAnotherRowVersion(VersionChain oldRow, 
@Nullable RowVersion existingWriteIntent) {
-        boolean replacingExistingWriteIntent = oldRow.isUncommitted();
+    protected RowVersion insertAnotherRowVersion(VersionChain chain, @Nullable 
RowVersion existingWriteIntent) {
+        boolean replacingExistingWriteIntent = chain.isUncommitted();
         assert replacingExistingWriteIntent == (existingWriteIntent != null);
 
-        WiLinkableRowVersion newVersion = 
insertRowVersion(oldRow.newestCommittedLink());
+        WiLinkableRowVersion newVersion = 
insertWiLinkableRowVersion(chain.newestCommittedLink());
 
         long wiListHeadLink = persistentStorage.lockWriteIntentListHead();
         long newWiListHeadLink = wiListHeadLink;
 
         try {
-            WriteIntentLinks newWiLinks = 
newWiLinksForReplacement(existingWriteIntent, replacingExistingWriteIntent, 
wiListHeadLink);
+            WriteIntentLinks newWiLinks = 
newWiLinksForReplacement(existingWriteIntent, wiListHeadLink);
 
             updateWiListLinks(newVersion.link(), newWiLinks);
 
-            if (!replacingExistingWriteIntent) {
-                // Add our new version to the head of the WI list.
+            // We do not zero out links in the replaced write intent as no one 
will be able to use them to traverse WI list

Review Comment:
   If links from other list node to the removed node are removed, but the node 
itself keeps links to them, it seems that formally this break the links 
consistency invariant. In the comment, I tried to explain why this is not an 
issue



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