ignite-6467 Result of updateRebalanceVersion was incorrect when diffFromAffinityVer did not match current affinity version.
@@ -433,7 +433,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
}
- updateRebalanceVersion(affAssignment);
+ updateRebalanceVersion(affVer, affAssignment);
return needRefresh;
}
@@ -762,7 +762,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
if (node2part != null && node2part.valid())
changed |= checkEvictions(updateSeq, aff);
- updateRebalanceVersion(aff.assignment());
+ updateRebalanceVersion(aff.topologyVersion(), aff.assignment());
consistencyCheck();
@@ -1535,7 +1535,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
if (exchangeVer == null)
changed |= checkEvictions(updateSeq, aff);
- updateRebalanceVersion(aff.assignment());
+ updateRebalanceVersion(aff.topologyVersion(), aff.assignment());
}
if (partSizes != null)
@@ -1803,7 +1803,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
if (exchId == null)
changed |= checkEvictions(updateSeq, aff);
- updateRebalanceVersion(aff.assignment());
+ updateRebalanceVersion(aff.topologyVersion(), aff.assignment());
}
consistencyCheck();
@@ -1850,10 +1850,13 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
else
diffFromAffinityVer = readyTopVer;
+
+ if (!updateRebalanceVer)
+ updateRebalanceVersion(assignment.topologyVersion(), assignment.assignment());
}
if (updateRebalanceVer)
- updateRebalanceVersion(assignment.assignment());
+ updateRebalanceVersion(assignment.topologyVersion(), assignment.assignment());
}
finally {
lock.writeLock().unlock();
@@ -2748,9 +2751,13 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
/**
+ * @param affVer Affinity version.
* @param aff Affinity assignments.
*/
- private void updateRebalanceVersion(List<List<ClusterNode>> aff) {
+ private void updateRebalanceVersion(AffinityTopologyVersion affVer, List<List<ClusterNode>> aff) {
+ if (!grp.isReplicated() && !affVer.equals(diffFromAffinityVer))
+ return;
+
if (!rebalancedTopVer.equals(readyTopVer)) {
if (node2part == null || !node2part.valid())
return;
