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

amashenkov 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 29b0526  IGNITE-11587: Fix wrong RemoteTx type detection. This closes 
#6315.
29b0526 is described below

commit 29b0526add4a283862a56f3ea88b4aac9ae145ef
Author: amashenkov <[email protected]>
AuthorDate: Tue Mar 26 19:54:28 2019 +0300

    IGNITE-11587: Fix wrong RemoteTx type detection. This closes #6315.
---
 .../cache/transactions/IgniteTxRemoteSingleStateImpl.java  |  5 -----
 .../cache/transactions/IgniteTxRemoteStateAdapter.java     | 14 ++++++++++++++
 .../cache/transactions/IgniteTxRemoteStateImpl.java        | 10 ----------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
index ee917a6..6bbc4ce 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
@@ -142,9 +142,4 @@ public class IgniteTxRemoteSingleStateImpl extends 
IgniteTxRemoteStateAdapter {
 
         return null;
     }
-
-    /** {@inheritDoc} */
-    @Override public boolean mvccEnabled() {
-        return entry != null && entry.context().mvccEnabled();
-    }
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
index e145e95..675bad5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
@@ -39,6 +39,9 @@ public abstract class IgniteTxRemoteStateAdapter implements 
IgniteTxRemoteState
     /** Cache ids used for mvcc caching. See {@link MvccCachingManager}. */
     private GridIntList mvccCachingCacheIds = new GridIntList();
 
+    /** */
+    protected boolean mvccEnabled;
+
     /** {@inheritDoc} */
     @Override public boolean implicitSingle() {
         return false;
@@ -84,6 +87,12 @@ public abstract class IgniteTxRemoteStateAdapter implements 
IgniteTxRemoteState
 
         int cacheId = cctx.cacheId();
 
+        boolean mvccTx = tx.mvccSnapshot() != null;
+
+        assert activeCacheIds.isEmpty() || mvccEnabled == mvccTx;
+
+        mvccEnabled = mvccTx;
+
         // Check if we can enlist new cache to transaction.
         if (!activeCacheIds.contains(cacheId)) {
             activeCacheIds.add(cacheId);
@@ -126,6 +135,11 @@ public abstract class IgniteTxRemoteStateAdapter 
implements IgniteTxRemoteState
     }
 
     /** {@inheritDoc} */
+    @Override public boolean mvccEnabled() {
+        return mvccEnabled;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean useMvccCaching(int cacheId) {
         return mvccCachingCacheIds.contains(cacheId);
     }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
index e160ed7..61d256f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
@@ -209,14 +209,4 @@ public class IgniteTxRemoteStateImpl extends 
IgniteTxRemoteStateAdapter {
 
         return null;
     }
-
-    /** {@inheritDoc} */
-    @Override public boolean mvccEnabled() {
-        for (IgniteTxEntry e : writeMap.values()) {
-            if (e.context().mvccEnabled())
-                return true;
-        }
-
-        return false;
-    }
 }

Reply via email to