ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: 5578
Date Sun, 30 Jul 2017 19:08:17 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5578 2b0ded7e7 -> 0337a2ea3


5578


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

Branch: refs/heads/ignite-5578
Commit: 0337a2ea3bf28c88a35ce022cf84d432d5260a96
Parents: 2b0ded7
Author: sboikov <sboikov@gridgain.com>
Authored: Sun Jul 30 20:44:43 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Sun Jul 30 22:08:06 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/affinity/GridAffinityProcessor.java  | 8 ++++----
 .../processors/cache/CacheAffinitySharedManager.java         | 7 +++++--
 .../ignite/internal/processors/cache/ExchangeContext.java    | 4 ++--
 .../ignite/internal/processors/cache/GridCacheAdapter.java   | 6 ++++--
 .../dht/preloader/GridDhtPartitionsExchangeFuture.java       | 6 +++---
 5 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0337a2ea/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
index 4ee0502..9c9fb8f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
@@ -184,7 +184,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
         assert cacheName != null;
 
         if (aff == null) {
-            aff = affinityCache(cacheName, ctx.discovery().topologyVersionEx());
+            aff = affinityCache(cacheName, ctx.cache().context().exchange().readyAffinityVersion());
 
             if (aff == null)
                 throw new IgniteCheckedException("Failed to get cache affinity (cache was
not started " +
@@ -303,7 +303,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
         if (key == null)
             return null;
 
-        AffinityInfo affInfo = affinityCache(cacheName, ctx.discovery().topologyVersionEx());
+        AffinityInfo affInfo = affinityCache(cacheName, ctx.cache().context().exchange().readyAffinityVersion());
 
         if (affInfo == null)
             return null;
@@ -329,7 +329,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
      */
     private <K> Map<ClusterNode, Collection<K>> keysToNodes(@Nullable final
String cacheName,
         Collection<? extends K> keys) throws IgniteCheckedException {
-        return keysToNodes(cacheName, keys, ctx.discovery().topologyVersionEx());
+        return keysToNodes(cacheName, keys, ctx.cache().context().exchange().readyAffinityVersion());
     }
 
     /**
@@ -974,7 +974,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
          * @throws IgniteCheckedException If failed.
          */
         private AffinityInfo cache() throws IgniteCheckedException {
-            AffinityInfo aff = affinityCache(cacheName, ctx.discovery().topologyVersionEx());
+            AffinityInfo aff = affinityCache(cacheName, ctx.cache().context().exchange().readyAffinityVersion());
 
             if (aff == null)
                 throw new IgniteException("Failed to find cache (cache was not started "
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/0337a2ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index 1192e9d..83503dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -1833,7 +1833,10 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                     if (grpAdded) {
                         AffinityAssignment aff = cache.aff.cachedAffinity(cache.aff.lastVersion());
 
-                        assert evts.topologyVersion().equals(aff.topologyVersion());
+                        assert evts.topologyVersion().equals(aff.topologyVersion()) : "Unexpected
version [" +
+                            "grp=" + cache.aff.cacheOrGroupName() +
+                            ", evts=" + evts.topologyVersion() +
+                            ", aff=" + cache.aff.lastVersion() + ']';
 
                         Map<UUID, GridDhtPartitionMap> map = affinityFullMap(aff);
 
@@ -1890,7 +1893,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
         throws IgniteCheckedException
     {
         if (addedOnExchnage) {
-            if (aff.lastVersion().equals(AffinityTopologyVersion.NONE)) {
+            if (!aff.lastVersion().equals(evts.topologyVersion())) {
                 List<List<ClusterNode>> newAff = aff.calculate(evts.topologyVersion(),
                     evts.lastEvent(),
                     evts.discoveryCache());

http://git-wip-us.apache.org/repos/asf/ignite/blob/0337a2ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
index 1a5fbb4..bdab2e6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
@@ -53,10 +53,10 @@ public class ExchangeContext {
     /**
      * @param fut Exchange future.
      */
-    public ExchangeContext(GridDhtPartitionsExchangeFuture fut) {
+    public ExchangeContext(boolean crd, GridDhtPartitionsExchangeFuture fut) {
         int protocolVer = exchangeProtocolVersion(fut.discoCache().minimumNodeVersion());
 
-        if (compatibilityNode) {
+        if (compatibilityNode || (crd && fut.localJoinExchange())) {
             fetchAffOnJoin = true;
 
             merge = false;

http://git-wip-us.apache.org/repos/asf/ignite/blob/0337a2ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index fabc7ab..7df73fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -3328,8 +3328,10 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
         try {
             KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
 
-            GridCacheEntryEx e = entry0(cacheKey, ctx.discovery().topologyVersionEx(),
-                false, false);
+            GridCacheEntryEx e = entry0(cacheKey,
+                ctx.shared().exchange().readyAffinityVersion(),
+                false,
+                false);
 
             if (e == null)
                 return false;

http://git-wip-us.apache.org/repos/asf/ignite/blob/0337a2ea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 285bb28..73e0831 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -497,8 +497,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
         assert discoEvt != null : this;
         assert exchId.nodeId().equals(discoEvt.eventNode().id()) : this;
 
-        exchCtx = new ExchangeContext(this);
-
         try {
             AffinityTopologyVersion topVer = initialVersion();
 
@@ -510,6 +508,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
 
             boolean crdNode = crd != null && crd.isLocal();
 
+            exchCtx = new ExchangeContext(crdNode, this);
+
             assert state == null : state;
 
             if (crdNode)
@@ -1211,7 +1211,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
     /**
      * @return {@code True} if exchange for local node join.
      */
-    boolean localJoinExchange() {
+    public boolean localJoinExchange() {
         return discoEvt.type() == EVT_NODE_JOINED && discoEvt.eventNode().isLocal();
     }
 


Mime
View raw message