Repository: ignite
Updated Branches:
  refs/heads/ignite-5578 a6f06d958 -> 3488f9262


ignite-5578


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

Branch: refs/heads/ignite-5578
Commit: 3488f926249ac3453d810a945c5b10fa3821d51b
Parents: a6f06d9
Author: sboikov <[email protected]>
Authored: Fri Jul 28 13:48:13 2017 +0300
Committer: sboikov <[email protected]>
Committed: Fri Jul 28 14:13:50 2017 +0300

----------------------------------------------------------------------
 .../GridCachePartitionExchangeManager.java      |  2 +-
 .../dht/GridDhtPartitionTopologyImpl.java       | 35 +++++++++++++++++---
 .../dht/preloader/GridDhtPartitionMap.java      |  2 +-
 3 files changed, 32 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3488f926/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index ca4eb44..d4d9dbe 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -935,7 +935,7 @@ public class GridCachePartitionExchangeManager<K, V> 
extends GridCacheSharedMana
 
             // No need to send to nodes which did not finish their first 
exchange.
             AffinityTopologyVersion rmtTopVer =
-                lastFut != null ? lastFut.initialVersion() : 
AffinityTopologyVersion.NONE;
+                lastFut != null ? (lastFut.isDone() ? 
lastFut.topologyVersion() : lastFut.initialVersion()) : 
AffinityTopologyVersion.NONE;
 
             Collection<ClusterNode> rmts = CU.remoteNodes(cctx, rmtTopVer);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3488f926/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index 02790c7..531aa51 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -455,10 +455,17 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
 
                     ExchangeDiscoveryEvents evts = exchFut.context().events();
 
+                    if (affReady) {
+                        assert 
grp.affinity().lastVersion().equals(evts.topologyVersion());
+
+                        lastTopChangeVer = readyTopVer = 
evts.topologyVersion();
+                    }
+
                     for (DiscoveryEvent evt : evts.events()) {
                         if ((evt.type() == EVT_NODE_FAILED || evt.type() == 
EVT_NODE_LEFT) && !CU.clientNode(evt.eventNode()))
                             removeNode(evt.eventNode().id());
                     }
+
                     ClusterNode oldest = 
discoCache.oldestAliveServerNodeWithCache();
 
                     if (log.isDebugEnabled()) {
@@ -1163,7 +1170,7 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
 
             if (exchangeResVer != null) {
                 // Ignore if exchange already finished or new exchange started.
-                if (readyTopVer.compareTo(exchangeResVer) >= 0 || 
lastTopChangeVer.compareTo(exchangeResVer) > 0) {
+                if (readyTopVer.compareTo(exchangeResVer) > 0 || 
lastTopChangeVer.compareTo(exchangeResVer) > 0) {
                     if (log.isDebugEnabled()) {
                         log.debug("Stale exchange id for full partition map 
update (will ignore) [" +
                             "lastTopChange=" + lastTopChangeVer +
@@ -1188,6 +1195,11 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
                         ", msgVer=" + msgTopVer + ']');
                 }
 
+                U.warn(log, "Stale version for full partition map update 
message (will ignore) [" +
+                    "lastTopChange=" + lastTopChangeVer +
+                    ", readTopVer=" + readyTopVer +
+                    ", msgVer=" + msgTopVer + ']');
+
                 return false;
             }
 
@@ -1463,9 +1475,17 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
 
             if (!force) {
                 if (lastTopChangeVer != null && exchId != null && 
lastTopChangeVer.compareTo(exchId.topologyVersion()) > 0) {
-                    if (log.isDebugEnabled())
-                        log.debug("Stale exchange id for single partition map 
update (will ignore) [lastExch=" +
-                            lastTopChangeVer + ", exch=" + 
exchId.topologyVersion() + ']');
+                    if (log.isDebugEnabled()) {
+                        log.debug("Stale exchange id for single partition map 
update (will ignore) [" +
+                            "lastTopChange=" + lastTopChangeVer +
+                            ", readTopVer=" + readyTopVer +
+                            ", exch=" + exchId.topologyVersion() + ']');
+                    }
+
+                    U.warn(log, "Stale exchange id for single partition map 
update (will ignore) [" +
+                        "lastTopChange=" + lastTopChangeVer +
+                        ", readTopVer=" + readyTopVer +
+                        ", exch=" + exchId.topologyVersion() + ']');
 
                     return false;
                 }
@@ -1482,9 +1502,14 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
                     parts.updateSequence(cur.updateSequence(), 
cur.topologyVersion());
             }
             else  if (isStaleUpdate(cur, parts)) {
-                if (log.isDebugEnabled())
+                if (log.isDebugEnabled()) {
                     log.debug("Stale update for single partition map update 
(will ignore) [exchId=" + exchId +
                         ", curMap=" + cur + ", newMap=" + parts + ']');
+                }
+
+                U.warn(log, "Stale update for single partition map update 
(will ignore) [exchId=" + exchId +
+                    ", curMap=" + cur +
+                    ", newMap=" + parts + ']');
 
                 return false;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3488f926/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
index 735ca1e..410caf6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
@@ -254,7 +254,7 @@ public class GridDhtPartitionMap implements 
Comparable<GridDhtPartitionMap>, Ext
             i++;
         }
 
-        assert i == size;
+        assert i == size : "Invalid size [size1=" + size + ", size2=" + i + 
']';
 
         if (top != null) {
             out.writeLong(topologyVersion().topologyVersion());

Reply via email to