# ignite-506 minor

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

Branch: refs/heads/ignite-45-ipc-debug
Commit: a15d689b30e52d78acacc0f916d6b17cab2662a5
Parents: 4ba0dda
Author: sboikov <sboi...@gridgain.com>
Authored: Tue Mar 24 18:00:42 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Tue Mar 24 18:00:42 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a15d689b/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 278251d..529d756 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
@@ -93,18 +93,7 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
     @Override public boolean valid(AffinityTopologyVersion topVer) {
         assert topVer.topologyVersion() > 0 : "Topology version is invalid: " 
+ topVer;
 
-        long topVer0 = this.topVer;
-
-        if (topVer0 < 0)
-            return false;
-
-        if (topVer.topologyVersion() != topVer0) {
-            this.topVer = -1L;
-
-            return false;
-        }
-
-        return true;
+        return this.topVer == topVer.topologyVersion();
     }
 
     /**
@@ -593,6 +582,7 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
      * @param nodeId Primary node ID.
      */
     private void primaryNode(UUID nodeId) {
+        assert Thread.holdsLock(this);
         assert nodeId != null;
 
         AffinityTopologyVersion topVer = cctx.discovery().topologyVersionEx();
@@ -605,7 +595,8 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
             return;
         }
 
-        this.topVer = topVer.topologyVersion();
+        if (topVer.topologyVersion() > this.topVer)
+            this.topVer = topVer.topologyVersion();
     }
 
     /** {@inheritDoc} */

Reply via email to