Fixed update sequence.

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

Branch: refs/heads/ignite-6181-1
Commit: 85fd8ce91f1e5827600aa32645552039e5a2298a
Parents: d31c43c
Author: Ilya Lantukh <ilant...@gridgain.com>
Authored: Fri Aug 25 21:23:19 2017 +0300
Committer: Ilya Lantukh <ilant...@gridgain.com>
Committed: Fri Aug 25 21:23:19 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtPartitionTopologyImpl.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd8ce9/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 87b3670..a881130 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
@@ -1910,6 +1910,14 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
                 }
             }
 
+            long seqVal = 0;
+
+            if (updateSeq) {
+                seqVal = this.updateSeq.incrementAndGet();
+
+                node2part = new GridDhtPartitionFullMap(node2part, seqVal);
+            }
+
             for (Map.Entry<UUID, GridDhtPartitionMap> e : 
node2part.entrySet()) {
                 GridDhtPartitionMap partMap = e.getValue();
 
@@ -1925,16 +1933,14 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
                         result.add(e.getKey());
                     }
 
-                    partMap.updateSequence(partMap.updateSequence() + 1, 
partMap.topologyVersion());
+                    if (updateSeq)
+                        partMap.updateSequence(seqVal, 
partMap.topologyVersion());
 
                     U.warn(log, "Partition has been scheduled for rebalancing 
due to outdated update counter " +
                         "[nodeId=" + e.getKey() + ", cacheOrGroupName=" + 
grp.cacheOrGroupName() +
                         ", partId=" + p + ", haveHistory=" + haveHistory + 
"]");
                 }
             }
-
-            if (updateSeq)
-                node2part = new GridDhtPartitionFullMap(node2part, 
this.updateSeq.incrementAndGet());
         }
         finally {
             lock.writeLock().unlock();

Reply via email to