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 69B7618152 for ; Tue, 4 Aug 2015 17:30:24 +0000 (UTC) Received: (qmail 59184 invoked by uid 500); 4 Aug 2015 17:30:24 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 59153 invoked by uid 500); 4 Aug 2015 17:30:24 -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 59144 invoked by uid 99); 4 Aug 2015 17:30:24 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2015 17:30:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C872B19A718 for ; Tue, 4 Aug 2015 17:30:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id aucDZs2LWQiv for ; Tue, 4 Aug 2015 17:30:16 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 3037C22F09 for ; Tue, 4 Aug 2015 17:30:16 +0000 (UTC) Received: (qmail 59131 invoked by uid 99); 4 Aug 2015 17:30:16 -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; Tue, 04 Aug 2015 17:30:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D59F2E02EE; Tue, 4 Aug 2015 17:30:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Message-Id: <959cf206168c4eb29f8b7cee469febf5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: master - query restart tests fix Date: Tue, 4 Aug 2015 17:30:15 +0000 (UTC) Repository: incubator-ignite Updated Branches: refs/heads/master 38810b639 -> 90adeae9d master - query restart tests 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/90adeae9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/90adeae9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/90adeae9 Branch: refs/heads/master Commit: 90adeae9dd57f0aaaabe5f244d5167853a0b48dc Parents: 38810b6 Author: S.Vladykin Authored: Tue Aug 4 20:30:00 2015 +0300 Committer: S.Vladykin Committed: Tue Aug 4 20:30:00 2015 +0300 ---------------------------------------------------------------------- .../h2/twostep/GridReduceQueryExecutor.java | 34 ++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90adeae9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java index cde3288..ac269db 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java @@ -150,8 +150,7 @@ public class GridReduceQueryExecutor { for (QueryRun r : runs.values()) { for (GridMergeTable tbl : r.tbls) { if (tbl.getScanIndex(null).hasSource(nodeId)) { - // Will attempt to retry. If reduce query was started it will fail on next page fetching. - retry(r, h2.readyTopologyVersion(), nodeId); + handleNodeLeft(r, nodeId); break; } @@ -162,6 +161,15 @@ public class GridReduceQueryExecutor { } /** + * @param r Query run. + * @param nodeId Left node ID. + */ + private void handleNodeLeft(QueryRun r, UUID nodeId) { + // Will attempt to retry. If reduce query was started it will fail on next page fetching. + retry(r, h2.readyTopologyVersion(), nodeId); + } + + /** * @param nodeId Node ID. * @param msg Message. */ @@ -515,7 +523,7 @@ public class GridReduceQueryExecutor { if (send(nodes, new GridQueryRequest(qryReqId, r.pageSize, space, mapQrys, topVer, extraSpaces, null), partsMap)) { - U.await(r.latch); + awaitAllReplies(r, nodes); Object state = r.state.get(); @@ -595,6 +603,26 @@ public class GridReduceQueryExecutor { } /** + * @param r Query run. + * @param nodes Nodes to check periodically if they alive. + * @throws IgniteInterruptedCheckedException If interrupted. + */ + private void awaitAllReplies(QueryRun r, Collection nodes) + throws IgniteInterruptedCheckedException { + while (!U.await(r.latch, 500, TimeUnit.MILLISECONDS)) { + for (ClusterNode node : nodes) { + if (!ctx.discovery().alive(node)) { + handleNodeLeft(r, node.id()); + + assert r.latch.getCount() == 0; + + return; + } + } + } + } + + /** * Calculates data nodes for replicated caches on unstable topology. * * @param cctx Cache context for main space.