ignite-2.0 - Do not call primaryByKey() in cache entry synchronized block - 
Fixes #1824


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f2996710
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f2996710
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f2996710

Branch: refs/heads/ignite-5024
Commit: f2996710da39063723eda8aa0793d16362a0613f
Parents: 2d7fc51
Author: Dmitriy Govorukhin <[email protected]>
Authored: Mon Apr 24 10:37:44 2017 +0300
Committer: Alexey Goncharuk <[email protected]>
Committed: Mon Apr 24 10:38:01 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/distributed/near/GridNearCacheEntry.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f2996710/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index a23ab4c..fa098df 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -146,6 +146,8 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
                 GridCacheVersion enqueueVer = null;
 
                 try {
+                    ClusterNode primaryNode = 
cctx.affinity().primaryByKey(key, topVer);
+
                     synchronized (this) {
                         checkObsolete();
 
@@ -164,8 +166,6 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
                                 }
                             }
 
-                            ClusterNode primaryNode = 
cctx.affinity().primaryByKey(key, topVer);
-
                             if (primaryNode == null)
                                 this.topVer = AffinityTopologyVersion.NONE;
                             else

Reply via email to