This is an automated email from the ASF dual-hosted git repository.

wernerdv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 80cf3e0ba1a IGNITE-29250 Remove unused pending versions collection 
from transaction commit (#13790)
80cf3e0ba1a is described below

commit 80cf3e0ba1a5c495fd27e5147c9649e631ef0e8c
Author: Dmitry Werner <[email protected]>
AuthorDate: Sat Nov 7 02:07:33 2026 +0800

    IGNITE-29250 Remove unused pending versions collection from transaction 
commit (#13790)
---
 .../distributed/dht/GridDhtTxLocalAdapter.java     | 18 -------
 .../cache/transactions/IgniteTxManager.java        | 62 ----------------------
 2 files changed, 80 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 99ccfc0b5cf..577640682d3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -94,9 +93,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
     /** */
     protected boolean explicitLock;
 
-    /** Versions of pending locks for entries of this tx. */
-    private Collection<GridCacheVersion> pendingVers;
-
     /** Flag indicating that originating node has near cache. */
     private boolean nearOnOriginatingNode;
 
@@ -247,20 +243,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
         return nearOnOriginatingNode;
     }
 
-    /**
-     * @return Versions for all pending locks that were in queue before tx 
locks were released.
-     */
-    Collection<GridCacheVersion> pendingVersions() {
-        return pendingVers == null ? Collections.emptyList() : pendingVers;
-    }
-
-    /**
-     * @param pendingVers Versions for all pending locks that were in queue 
before tx locsk were released.
-     */
-    public void pendingVersions(Collection<GridCacheVersion> pendingVers) {
-        this.pendingVers = pendingVers;
-    }
-
     /**
      * Map explicit locks.
      */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 4ace36ac49d..d09fdc18d5f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -24,7 +24,6 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -1419,61 +1418,6 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
         }
     }
 
-    /**
-     * Collects versions for all pending locks for all entries within 
transaction
-     *
-     * @param dhtTxLoc Transaction being committed.
-     */
-    private void collectPendingVersions(GridDhtTxLocal dhtTxLoc) {
-        if (dhtTxLoc.needsCompletedVersions()) {
-            if (log.isDebugEnabled())
-                log.debug("Checking for pending locks with version less then 
tx version: " + dhtTxLoc);
-
-            Set<GridCacheVersion> vers = new LinkedHashSet<>();
-
-            collectPendingVersions(dhtTxLoc.readEntries(), 
dhtTxLoc.xidVersion(), vers);
-            collectPendingVersions(dhtTxLoc.writeEntries(), 
dhtTxLoc.xidVersion(), vers);
-
-            if (!vers.isEmpty())
-                dhtTxLoc.pendingVersions(vers);
-        }
-    }
-
-    /**
-     * Gets versions of all not acquired locks for collection of tx entries 
that are less than base version.
-     *
-     * @param entries Tx entries to process.
-     * @param baseVer Base version to compare with.
-     * @param vers Collection of versions that will be populated.
-     */
-    @SuppressWarnings("TypeMayBeWeakened")
-    private void collectPendingVersions(Iterable<IgniteTxEntry> entries,
-        GridCacheVersion baseVer, Set<GridCacheVersion> vers) {
-
-        // The locks are not released yet, so we can safely list pending 
candidates versions.
-        for (IgniteTxEntry txEntry : entries) {
-            GridCacheEntryEx cached = txEntry.cached();
-
-            try {
-                // If check should be faster than exception handling.
-                if (!cached.obsolete()) {
-                    for (GridCacheMvccCandidate cand : 
cached.localCandidates()) {
-                        if (!cand.owner() && cand.version().compareTo(baseVer) 
< 0) {
-                            if (log.isDebugEnabled())
-                                log.debug("Adding candidate version to pending 
set: " + cand);
-
-                            vers.add(cand.version());
-                        }
-                    }
-                }
-            }
-            catch (GridCacheEntryRemovedException ignored) {
-                if (log.isDebugEnabled())
-                    log.debug("There are no pending locks for entry (entry was 
deleted in transaction): " + txEntry);
-            }
-        }
-    }
-
     /**
      * Go through all candidates for entries involved in transaction and find 
their min
      * version. We know that these candidates will commit after this 
transaction, and
@@ -1557,12 +1501,6 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
             // 2. Must process completed entries before unlocking!
             processCompletedEntries(tx);
 
-            if (tx instanceof GridDhtTxLocal) {
-                GridDhtTxLocal dhtTxLoc = (GridDhtTxLocal)tx;
-
-                collectPendingVersions(dhtTxLoc);
-            }
-
             // 3. Unlock write resources.
             unlockMultiple(tx, tx.writeEntries());
 

Reply via email to