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 460CC18311 for ; Wed, 29 Apr 2015 10:26:15 +0000 (UTC) Received: (qmail 46349 invoked by uid 500); 29 Apr 2015 10:26:15 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 46321 invoked by uid 500); 29 Apr 2015 10:26:15 -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 46308 invoked by uid 99); 29 Apr 2015 10:26:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 10:26:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 10:26:10 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 7004145427 for ; Wed, 29 Apr 2015 10:24:34 +0000 (UTC) Received: (qmail 20685 invoked by uid 99); 29 Apr 2015 10:18:39 -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, 29 Apr 2015 10:18:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 716A4E0984; Wed, 29 Apr 2015 10:18:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sevdokimov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 29 Apr 2015 10:18:42 -0000 Message-Id: <9fcbc31ad0a147e082a0e4fcd705ad0a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/5] incubator-ignite git commit: # IGNITE-709 Fix problem in TcpDiscoverySpi.RingMessageWorker#processClientReconnectMessage() (cherry picked from commit eda676b) X-Virus-Checked: Checked by ClamAV on apache.org # IGNITE-709 Fix problem in TcpDiscoverySpi.RingMessageWorker#processClientReconnectMessage() (cherry picked from commit eda676b) Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f7be0f20 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f7be0f20 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f7be0f20 Branch: refs/heads/ignite-831 Commit: f7be0f20dab2db121fc8eaeca9d6b5fd0c006cf2 Parents: 177077b Author: sevdokimov Authored: Sun Apr 19 19:11:14 2015 +0300 Committer: sevdokimov Committed: Wed Apr 29 13:14:33 2015 +0300 ---------------------------------------------------------------------- .../spi/discovery/tcp/TcpDiscoverySpi.java | 76 +++++++++++--------- 1 file changed, 41 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f7be0f20/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java index 47b17ac..bd3d648 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java @@ -3438,54 +3438,60 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov assert isLocNodeRouter; msg.verify(locNodeId); + + if (ring.hasRemoteNodes()) { + sendMessageAcrossRing(msg); + + return; + } } - else { - UUID nodeId = msg.creatorNodeId(); - TcpDiscoveryNode node = ring.node(nodeId); + UUID nodeId = msg.creatorNodeId(); - assert node == null || node.isClient(); + TcpDiscoveryNode node = ring.node(nodeId); - if (node != null) { - assert node.isClient(); + assert node == null || node.isClient(); - node.clientRouterNodeId(msg.routerNodeId()); - node.aliveCheck(maxMissedClientHbs); + if (node != null) { + assert node.isClient(); - if (isLocalNodeCoordinator()) { - Collection pending = - pendingMsgs.messages(msg.lastMessageId()); + node.clientRouterNodeId(msg.routerNodeId()); + node.aliveCheck(maxMissedClientHbs); - if (pending != null) { - msg.pendingMessages(pending); - msg.success(true); - } - else { - if (log.isDebugEnabled()) - log.debug("Failing reconnecting client node because failed to restore pending " + - "messages [locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']'); + if (isLocalNodeCoordinator()) { + Collection pending = + pendingMsgs.messages(msg.lastMessageId()); - processNodeFailedMessage(new TcpDiscoveryNodeFailedMessage(locNodeId, - node.id(), node.order())); - } + if (pending != null) { + msg.pendingMessages(pending); + msg.success(true); } - } - else if (log.isDebugEnabled()) - log.debug("Reconnecting client node is already failed [nodeId=" + nodeId + ']'); - - if (isLocNodeRouter) { - ClientMessageWorker wrk = clientMsgWorkers.get(nodeId); + else { + if (log.isDebugEnabled()) + log.debug("Failing reconnecting client node because failed to restore pending " + + "messages [locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']'); - if (wrk != null) - wrk.addMessage(msg); - else if (log.isDebugEnabled()) - log.debug("Failed to reconnect client node (disconnected during the process) [locNodeId=" + - locNodeId + ", clientNodeId=" + nodeId + ']'); + processNodeFailedMessage(new TcpDiscoveryNodeFailedMessage(locNodeId, + node.id(), node.internalOrder())); + } } } + else if (log.isDebugEnabled()) + log.debug("Reconnecting client node is already failed [nodeId=" + nodeId + ']'); - if (ring.hasRemoteNodes()) - sendMessageAcrossRing(msg); + if (isLocNodeRouter) { + ClientMessageWorker wrk = clientMsgWorkers.get(nodeId); + + if (wrk != null) + wrk.addMessage(msg); + else if (log.isDebugEnabled()) + log.debug("Failed to reconnect client node (disconnected during the process) [locNodeId=" + + locNodeId + ", clientNodeId=" + nodeId + ']'); + } + else { + if (ring.hasRemoteNodes()) + sendMessageAcrossRing(msg); + } } /**