Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5EB2A17DE4 for ; Wed, 8 Apr 2015 14:02:34 +0000 (UTC) Received: (qmail 94145 invoked by uid 500); 8 Apr 2015 14:02:34 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 94082 invoked by uid 500); 8 Apr 2015 14:02:34 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 93990 invoked by uid 99); 8 Apr 2015 14:02:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 14:02:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Apr 2015 14:02:33 +0000 Received: (qmail 92221 invoked by uid 99); 8 Apr 2015 14:02:10 -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; Wed, 08 Apr 2015 14:02:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 56B2FE2F54; Wed, 8 Apr 2015 14:02:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 08 Apr 2015 14:02:39 -0000 Message-Id: <8e00e080212447df90faf5171cbaf3b8@git.apache.org> In-Reply-To: <7fed2b8568994458a66afac1f57e2fc4@git.apache.org> References: <7fed2b8568994458a66afac1f57e2fc4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [30/50] incubator-ignite git commit: IGNITE-180 - Fixed awaitPartitionMap for dynamically started cache. X-Virus-Checked: Checked by ClamAV on apache.org IGNITE-180 - Fixed awaitPartitionMap for dynamically started cache. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fd011e28 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fd011e28 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fd011e28 Branch: refs/heads/ignite-635 Commit: fd011e282fd818ff3cab1bda94fd236207bb8779 Parents: beedb17 Author: Alexey Goncharuk Authored: Tue Apr 7 17:09:51 2015 -0700 Committer: Alexey Goncharuk Committed: Tue Apr 7 17:09:51 2015 -0700 ---------------------------------------------------------------------- .../dht/GridClientPartitionTopology.java | 6 ++--- .../dht/GridDhtPartitionTopologyImpl.java | 6 ++--- .../cache/IgniteDynamicCacheStartSelfTest.java | 23 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fd011e28/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java index 4640192..331de4e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java @@ -220,21 +220,21 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { // If this is the oldest node. if (oldest.id().equals(loc.id()) || exchFut.isCacheAdded(cacheId)) { if (node2part == null) { - node2part = new GridDhtPartitionFullMap(loc.id(), loc.order(), updateSeq); + node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); if (log.isDebugEnabled()) log.debug("Created brand new full topology map on oldest node [exchId=" + exchId + ", fullMap=" + fullMapString() + ']'); } else if (!node2part.valid()) { - node2part = new GridDhtPartitionFullMap(loc.id(), loc.order(), updateSeq, node2part, false); + node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); if (log.isDebugEnabled()) log.debug("Created new full topology map on oldest node [exchId=" + exchId + ", fullMap=" + node2part + ']'); } else if (!node2part.nodeId().equals(loc.id())) { - node2part = new GridDhtPartitionFullMap(loc.id(), loc.order(), updateSeq, node2part, false); + node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); if (log.isDebugEnabled()) log.debug("Copied old map into new map on oldest node (previous oldest node left) [exchId=" + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fd011e28/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 30b4c80..073e0e7 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 @@ -249,21 +249,21 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { // If this is the oldest node. if (oldest.id().equals(loc.id()) || exchFut.isCacheAdded(cctx.cacheId())) { if (node2part == null) { - node2part = new GridDhtPartitionFullMap(loc.id(), loc.order(), updateSeq); + node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); if (log.isDebugEnabled()) log.debug("Created brand new full topology map on oldest node [exchId=" + exchId + ", fullMap=" + fullMapString() + ']'); } else if (!node2part.valid()) { - node2part = new GridDhtPartitionFullMap(loc.id(), loc.order(), updateSeq, node2part, false); + node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); if (log.isDebugEnabled()) log.debug("Created new full topology map on oldest node [exchId=" + exchId + ", fullMap=" + node2part + ']'); } else if (!node2part.nodeId().equals(loc.id())) { - node2part = new GridDhtPartitionFullMap(loc.id(), loc.order(), updateSeq, node2part, false); + node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); if (log.isDebugEnabled()) log.debug("Copied old map into new map on oldest node (previous oldest node left) [exchId=" + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fd011e28/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java index b83924b25..32809e6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java @@ -997,4 +997,27 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest { daemon = false; } } + + /** + * @throws Exception If failed. + */ + public void testAwaitPartitionMapExchange() throws Exception { + try (IgniteCache ignored = grid(0).getOrCreateCache(new CacheConfiguration(DYNAMIC_CACHE_NAME))) { + awaitPartitionMapExchange(); + + startGrid(nodeCount()); + + awaitPartitionMapExchange(); + + startGrid(nodeCount() + 1); + + awaitPartitionMapExchange(); + + stopGrid(nodeCount() + 1); + + awaitPartitionMapExchange(); + + stopGrid(nodeCount()); + } + } }