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 573D9200CB0 for ; Thu, 8 Jun 2017 15:13:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 562CC160BE5; 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 12D46160BEB for ; Thu, 8 Jun 2017 15:13:36 +0200 (CEST) Received: (qmail 98340 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 98235 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 F0F6FE04AA; 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:41 -0000 Message-Id: In-Reply-To: <461cd2a8567b4c45ad64bfb14083569b@git.apache.org> References: <461cd2a8567b4c45ad64bfb14083569b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/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/cc528344 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cc528344 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cc528344 Branch: refs/heads/ignite-5267-merge-ea Commit: cc528344169ab89453ad376a3ee8ff2b56a7513f Parents: c67dc6f Author: Ilya Lantukh Authored: Fri Apr 28 15:48:30 2017 +0300 Committer: Ilya Lantukh Committed: Fri Apr 28 15:48:30 2017 +0300 ---------------------------------------------------------------------- .../dht/GridDhtPartitionTopologyImpl.java | 68 ++++++++++---------- .../GridDhtPartitionsExchangeFuture.java | 13 ++-- 2 files changed, 38 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/cc528344/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 898cb55..6d776d2 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 @@ -987,7 +987,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh HashSet affIds = affAssignment.getIds(p); for (UUID nodeId : diffIds) { -// assert !affIds.contains(nodeId); + assert !affIds.contains(nodeId); if (!affIds.contains(nodeId) && hasState(p, nodeId, OWNING, MOVING, RENTING)) { ClusterNode n = cctx.discovery().node(nodeId); @@ -1018,44 +1018,46 @@ 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 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); -// } -// } -// } + diffFromAffinity.clear(); - Collection affNodes = F.nodeIds(cctx.discovery().cacheAffinityNodes(cctx.cacheId(), affAssignment.topologyVersion())); + for (Map.Entry e : node2part.entrySet()) { + UUID nodeId = e.getKey(); - for (Map.Entry> e : diffFromAffinity.entrySet()) { - int p = e.getKey(); + for (Map.Entry e0 : e.getValue().entrySet()) { + int p0 = e0.getKey(); - Iterator iter = e.getValue().iterator(); + GridDhtPartitionState state = e0.getValue(); - while (iter.hasNext()) { - UUID nodeId = iter.next(); + Set ids = diffFromAffinity.get(p0); - if (!affNodes.contains(nodeId) || affAssignment.getIds(p).contains(nodeId)) - iter.remove(); + 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); + } } } +// 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 +1435,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh AffinityTopologyVersion affVer = cctx.affinity().affinityTopologyVersion(); - if (diffFromAffinityVer.compareTo(affVer) <= 0 && false) { + if (exchId == null) { AffinityAssignment affAssignment = cctx.affinity().assignment(affVer); int diffFromAffinitySize = 0; @@ -1484,8 +1486,6 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh } } - diffFromAffinityVer = affVer; - if (diffFromAffinitySize > 0) U.error(log, "??? S diffFromAffinitySize=" + diffFromAffinitySize + " [exchId=" + exchId + ",cacheId=" + cctx.cacheId() + ",cacheName=" + cctx.name() + "]"); } http://git-wip-us.apache.org/repos/asf/ignite/blob/cc528344/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 328f730..9eb7e50 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 @@ -1216,18 +1216,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter