ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject ignite git commit: IGNITE-2796 NPE during rebalancing
Date Tue, 15 Mar 2016 17:00:46 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2796 [created] 8958402b0


IGNITE-2796 NPE during rebalancing


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

Branch: refs/heads/ignite-2796
Commit: 8958402b0709e6e2ea364045c9a1a31e50452650
Parents: 18de768
Author: Anton Vinogradov <av@apache.org>
Authored: Tue Mar 15 20:00:21 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Tue Mar 15 20:00:21 2016 +0300

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPartitionDemander.java | 29 ++++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8958402b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 273b603..0cf974f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -841,6 +841,8 @@ public class GridDhtPartitionDemander {
          */
         private void appendPartitions(UUID nodeId, Collection<Integer> parts) {
             synchronized (this) {
+                assert parts != null : "Partitions are null [cache=" + cctx.name() + ", fromNode="
+ nodeId + "]";
+
                 remaining.put(nodeId, new T2<>(U.currentTimeMillis(), parts));
             }
         }
@@ -972,22 +974,25 @@ public class GridDhtPartitionDemander {
                     preloadEvent(p, EVT_CACHE_REBALANCE_PART_LOADED,
                         exchFut.discoveryEvent());
 
-                Collection<Integer> parts = remaining.get(nodeId).get2();
+                T2<Long, Collection<Integer>> t = remaining.get(nodeId);
 
-                if (parts != null) {
-                    boolean rmvd = parts.remove(p);
+                assert t != null : "Remaining not found [cache=" + cctx.name() + ", fromNode="
+ nodeId +
+                    ", part=" + p + "]";
 
-                    assert rmvd : "Partition already done [cache=" + cctx.name() + ", fromNode="
+ nodeId +
-                        ", part=" + p + ", left=" + parts + "]";
+                Collection<Integer> parts = t.get2();
 
-                    if (parts.isEmpty()) {
-                        U.log(log, "Completed " + ((remaining.size() == 1 ? "(final) " :
"") +
-                            "rebalancing [cache=" + cctx.name() +
-                            ", fromNode=" + nodeId + ", topology=" + topologyVersion() +
-                            ", time=" + (U.currentTimeMillis() - remaining.get(nodeId).get1())
+ " ms]"));
+                boolean rmvd = parts.remove(p);
 
-                        remaining.remove(nodeId);
-                    }
+                assert rmvd : "Partition already done [cache=" + cctx.name() + ", fromNode="
+ nodeId +
+                    ", part=" + p + ", left=" + parts + "]";
+
+                if (parts.isEmpty()) {
+                    U.log(log, "Completed " + ((remaining.size() == 1 ? "(final) " : "")
+
+                        "rebalancing [cache=" + cctx.name() +
+                        ", fromNode=" + nodeId + ", topology=" + topologyVersion() +
+                        ", time=" + (U.currentTimeMillis() - t.get1()) + " ms]"));
+
+                    remaining.remove(nodeId);
                 }
 
                 checkIsDone();


Mime
View raw message