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 72AFC10F70 for ; Fri, 10 Apr 2015 07:16:06 +0000 (UTC) Received: (qmail 93535 invoked by uid 500); 10 Apr 2015 07:16:06 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 93506 invoked by uid 500); 10 Apr 2015 07:16:06 -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 93497 invoked by uid 99); 10 Apr 2015 07:16:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2015 07:16:06 +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; Fri, 10 Apr 2015 07:16:04 +0000 Received: (qmail 93051 invoked by uid 99); 10 Apr 2015 07:15:44 -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; Fri, 10 Apr 2015 07:15:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7AFD7DFF0B; Fri, 10 Apr 2015 07:15:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vkulichenko@apache.org To: commits@ignite.incubator.apache.org Date: Fri, 10 Apr 2015 07:15:44 -0000 Message-Id: <4f692de95f4649e8924bb8ae355e4822@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/5] incubator-ignite git commit: IGNITE-712 - Client disco fix X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-ignite Updated Branches: refs/heads/ignite-sprint-3 9e79a2d08 -> 2bc1c17b9 IGNITE-712 - Client disco fix Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/06746ea0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/06746ea0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/06746ea0 Branch: refs/heads/ignite-sprint-3 Commit: 06746ea0e7615324668293304d64daa41d9b46e1 Parents: 22252f1 Author: Valentin Kulichenko Authored: Thu Apr 9 14:59:31 2015 -0700 Committer: Valentin Kulichenko Committed: Thu Apr 9 14:59:31 2015 -0700 ---------------------------------------------------------------------- .../processors/cache/GridCacheProcessor.java | 52 ++++++++++---------- .../discovery/tcp/TcpClientDiscoverySpi.java | 4 +- .../tcp/TcpClientDiscoverySelfTest.java | 4 +- .../IgniteSpiDiscoverySelfTestSuite.java | 2 + 4 files changed, 34 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06746ea0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index c0e84f8..cc90cd3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -667,12 +667,12 @@ public class GridCacheProcessor extends GridProcessorAdapter { for (DynamicCacheDescriptor desc : registeredCaches.values()) { CacheConfiguration locCcfg = desc.cacheConfiguration(); - + CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg); cache2PluginMgr.put(locCcfg.getName(), pluginMgr); } - + if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) { for (ClusterNode n : ctx.discovery().remoteNodes()) { checkTransactionConfiguration(n); @@ -688,7 +688,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { if (rmtCfg != null) { CacheConfiguration locCfg = desc.cacheConfiguration(); - + checkCache(locCfg, rmtCfg, n); // Check plugin cache configurations. @@ -718,9 +718,9 @@ public class GridCacheProcessor extends GridProcessorAdapter { CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg); CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName()); - + assert pluginMgr != null : " Map=" + cache2PluginMgr; - + GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx); ctx.dynamicDeploymentId(desc.deploymentId()); @@ -1089,7 +1089,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { CacheContinuousQueryManager contQryMgr = new CacheContinuousQueryManager(); CacheDataStructuresManager dataStructuresMgr = new CacheDataStructuresManager(); GridCacheTtlManager ttlMgr = new GridCacheTtlManager(); - + CacheConflictResolutionManager rslvrMgr = pluginMgr.createComponent(CacheConflictResolutionManager.class); GridCacheDrManager drMgr = pluginMgr.createComponent(GridCacheDrManager.class); CacheStoreManager storeMgr = pluginMgr.createComponent(CacheStoreManager.class); @@ -2157,33 +2157,35 @@ public class GridCacheProcessor extends GridProcessorAdapter { * @return Validation result or {@code null} in case of success. */ @Nullable private IgniteNodeValidationResult validateHashIdResolvers(ClusterNode node) { - for (DynamicCacheDescriptor desc : registeredCaches.values()) { - CacheConfiguration cfg = desc.cacheConfiguration(); + if (!node.isClient()) { + for (DynamicCacheDescriptor desc : registeredCaches.values()) { + CacheConfiguration cfg = desc.cacheConfiguration(); - if (cfg.getAffinity() instanceof RendezvousAffinityFunction) { - RendezvousAffinityFunction aff = (RendezvousAffinityFunction)cfg.getAffinity(); + if (cfg.getAffinity() instanceof RendezvousAffinityFunction) { + RendezvousAffinityFunction aff = (RendezvousAffinityFunction)cfg.getAffinity(); - AffinityNodeHashResolver hashIdRslvr = aff.getHashIdResolver(); + AffinityNodeHashResolver hashIdRslvr = aff.getHashIdResolver(); - assert hashIdRslvr != null; + assert hashIdRslvr != null; - Object nodeHashObj = hashIdRslvr.resolve(node); + Object nodeHashObj = hashIdRslvr.resolve(node); - for (ClusterNode topNode : ctx.discovery().allNodes()) { - Object topNodeHashObj = hashIdRslvr.resolve(topNode); + for (ClusterNode topNode : ctx.discovery().allNodes()) { + Object topNodeHashObj = hashIdRslvr.resolve(topNode); - if (nodeHashObj.hashCode() == topNodeHashObj.hashCode()) { - String errMsg = "Failed to add node to topology because it has the same hash code for " + - "partitioned affinity as one of existing nodes [cacheName=" + U.maskName(cfg.getName()) + - ", hashIdResolverClass=" + hashIdRslvr.getClass().getName() + - ", existingNodeId=" + topNode.id() + ']'; + if (nodeHashObj.hashCode() == topNodeHashObj.hashCode()) { + String errMsg = "Failed to add node to topology because it has the same hash code for " + + "partitioned affinity as one of existing nodes [cacheName=" + U.maskName(cfg.getName()) + + ", hashIdResolverClass=" + hashIdRslvr.getClass().getName() + + ", existingNodeId=" + topNode.id() + ']'; - String sndMsg = "Failed to add node to topology because it has the same hash code for " + - "partitioned affinity as one of existing nodes [cacheName=" + U.maskName(cfg.getName()) + - ", hashIdResolverClass=" + hashIdRslvr.getClass().getName() + ", existingNodeId=" + - topNode.id() + ']'; + String sndMsg = "Failed to add node to topology because it has the same hash code for " + + "partitioned affinity as one of existing nodes [cacheName=" + U.maskName(cfg.getName()) + + ", hashIdResolverClass=" + hashIdRslvr.getClass().getName() + ", existingNodeId=" + + topNode.id() + ']'; - return new IgniteNodeValidationResult(topNode.id(), errMsg, sndMsg); + return new IgniteNodeValidationResult(topNode.id(), errMsg, sndMsg); + } } } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06746ea0/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java index bf69efb..465bfb9 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java @@ -406,6 +406,8 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp } } + Collection addrs0 = new ArrayList<>(addrs); + Iterator it = addrs.iterator(); while (it.hasNext() && !Thread.currentThread().isInterrupted()) { @@ -520,7 +522,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp if (addrs.isEmpty()) { U.warn(log, "Failed to connect to any address from IP finder (will retry to join topology " + - "in 2000ms): " + addrs); + "in 2000ms): " + addrs0); U.sleep(2000); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06746ea0/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySelfTest.java index fa6a6c9..498ed6f 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySelfTest.java @@ -420,14 +420,14 @@ public class TcpClientDiscoverySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ - public void testDataExchangeFromServer() throws Exception { + public void _testDataExchangeFromServer() throws Exception { testDataExchange("server-0"); } /** * @throws Exception If failed. */ - // TODO: GG-9174 + // TODO: IGNITE-587 public void _testDataExchangeFromClient() throws Exception { testDataExchange("client-0"); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06746ea0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java index 93a51a3..09ba42b 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java @@ -51,6 +51,8 @@ public class IgniteSpiDiscoverySelfTestSuite extends TestSuite { suite.addTest(new TestSuite(GridTcpSpiForwardingSelfTest.class)); + suite.addTest(new TestSuite(TcpClientDiscoverySelfTest.class)); + return suite; } }