Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 295B1200CC8 for ; Thu, 8 Jun 2017 15:13:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 281B7160BD5; Thu, 8 Jun 2017 13:13:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 05C51160BEA for ; Thu, 8 Jun 2017 15:13:36 +0200 (CEST) Received: (qmail 98247 invoked by uid 500); 8 Jun 2017 13:13:36 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 98134 invoked by uid 99); 8 Jun 2017 13:13:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jun 2017 13:13:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EDEE7E041D; Thu, 8 Jun 2017 13:13:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agoncharuk@apache.org To: commits@ignite.apache.org Date: Thu, 08 Jun 2017 13:13:40 -0000 Message-Id: In-Reply-To: <461cd2a8567b4c45ad64bfb14083569b@git.apache.org> References: <461cd2a8567b4c45ad64bfb14083569b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/18] ignite git commit: ignite-5068 : WIP. archived-at: Thu, 08 Jun 2017 13:13:38 -0000 ignite-5068 : WIP. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c67dc6f8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c67dc6f8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c67dc6f8 Branch: refs/heads/ignite-5267-merge-ea Commit: c67dc6f81c3c69fd58c3440fd8ab524edbd18d8d Parents: a011f57 Author: Ilya Lantukh Authored: Fri Apr 28 14:06:01 2017 +0300 Committer: Ilya Lantukh Committed: Fri Apr 28 14:06:01 2017 +0300 ---------------------------------------------------------------------- .../affinity/GridAffinityAssignmentCache.java | 2 - .../dht/GridDhtPartitionTopologyImpl.java | 67 ++++++++++---------- .../GridDhtPartitionsExchangeFuture.java | 16 +++++ 3 files changed, 50 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/c67dc6f8/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java index 9570e62..2399493 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java @@ -199,8 +199,6 @@ public class GridAffinityAssignmentCache { } } - ctx.cache().context().cacheContext(cacheId).topology().onAffinityInitialized(assignment); - onHistoryAdded(assignment); } http://git-wip-us.apache.org/repos/asf/ignite/blob/c67dc6f8/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 11f4e83..898cb55 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 @@ -959,7 +959,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh List nodes = null; - if (topVer.compareTo(diffFromAffinityVer) != 0) { + if (!topVer.equals(diffFromAffinityVer)) { System.out.println("??? node2part [topVer=" + topVer + ", diffVer=" + diffFromAffinityVer + "]"); nodes = new ArrayList<>(); @@ -1018,44 +1018,44 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh if (node2part == null) return; - for (Map.Entry e : node2part.entrySet()) { - UUID nodeId = e.getKey(); +// for (Map.Entry e : node2part.entrySet()) { +// UUID nodeId = e.getKey(); +// +// for (Map.Entry e0 : e.getValue().entrySet()) { +// int p0 = e0.getKey(); +// +// GridDhtPartitionState state = e0.getValue(); +// +// Set ids = diffFromAffinity.get(p0); +// +// if ((state == MOVING || state == OWNING || state == RENTING) && !affAssignment.getIds(p0).contains(nodeId)) { +// if (ids == null) +// diffFromAffinity.put(p0, ids = U.newHashSet(3)); +// +// ids.add(nodeId); +// } +// else { +// if (ids != null) +// ids.remove(nodeId); +// } +// } +// } - for (Map.Entry e0 : e.getValue().entrySet()) { - int p0 = e0.getKey(); + Collection affNodes = F.nodeIds(cctx.discovery().cacheAffinityNodes(cctx.cacheId(), affAssignment.topologyVersion())); - GridDhtPartitionState state = e0.getValue(); + for (Map.Entry> e : diffFromAffinity.entrySet()) { + int p = e.getKey(); - Set ids = diffFromAffinity.get(p0); + Iterator iter = e.getValue().iterator(); - if ((state == MOVING || state == OWNING || state == RENTING) && !affAssignment.getIds(p0).contains(nodeId)) { - if (ids == null) - diffFromAffinity.put(p0, ids = U.newHashSet(3)); + while (iter.hasNext()) { + UUID nodeId = iter.next(); - ids.add(nodeId); - } - else { - if (ids != null) - ids.remove(nodeId); - } + if (!affNodes.contains(nodeId) || affAssignment.getIds(p).contains(nodeId)) + iter.remove(); } } -// Collection affNodes = F.nodeIds(cctx.discovery().cacheAffinityNodes(cctx.cacheId(), affAssignment.topologyVersion())); -// -// for (Map.Entry> e : diffFromAffinity.entrySet()) { -// int p = e.getKey(); -// -// Iterator iter = e.getValue().iterator(); -// -// while (iter.hasNext()) { -// UUID nodeId = iter.next(); -// -// if (!affNodes.contains(nodeId) || affAssignment.getIds(p).contains(nodeId)) -// iter.remove(); -// } -// } - diffFromAffinityVer = affAssignment.topologyVersion(); } @@ -1433,7 +1433,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh AffinityTopologyVersion affVer = cctx.affinity().affinityTopologyVersion(); - if (diffFromAffinityVer.compareTo(affVer) <= 0) { + if (diffFromAffinityVer.compareTo(affVer) <= 0 && false) { AffinityAssignment affAssignment = cctx.affinity().assignment(affVer); int diffFromAffinitySize = 0; @@ -1518,7 +1518,8 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh lock.writeLock().lock(); try { - rebuildDiff(assignment); + if (assignment.topologyVersion().compareTo(diffFromAffinityVer) >= 0) + rebuildDiff(assignment); } finally { lock.writeLock().unlock(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c67dc6f8/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 f6827ab..328f730 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 @@ -1215,6 +1215,22 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter