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 41A0618EA2 for ; Fri, 19 Jun 2015 18:16:33 +0000 (UTC) Received: (qmail 33153 invoked by uid 500); 19 Jun 2015 18:16:33 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 33122 invoked by uid 500); 19 Jun 2015 18:16:33 -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 33113 invoked by uid 99); 19 Jun 2015 18:16:33 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2015 18:16:33 +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 B436118019D for ; Fri, 19 Jun 2015 18:16:32 +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 utlEZym0v_by for ; Fri, 19 Jun 2015 18:16:17 +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 AFF9D24971 for ; Fri, 19 Jun 2015 18:16:17 +0000 (UTC) Received: (qmail 32025 invoked by uid 99); 19 Jun 2015 18:16:17 -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, 19 Jun 2015 18:16:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7B98AE3CBD; Fri, 19 Jun 2015 18:16:17 +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: Fri, 19 Jun 2015 18:16:26 -0000 Message-Id: <29396da266ef41688b9aa528cc55caf0@git.apache.org> In-Reply-To: <7e6b80c0c80d42c9aa554d7e845e415f@git.apache.org> References: <7e6b80c0c80d42c9aa554d7e845e415f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [10/50] incubator-ignite git commit: ignite-484-1 - replicated cache group reservation fix + drop reservations group for dead nodes ignite-484-1 - replicated cache group reservation fix + drop reservations group for dead nodes Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1fe215e2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1fe215e2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1fe215e2 Branch: refs/heads/ignite-648 Commit: 1fe215e2cc83954f25cc7c2f0974dcf312694eb8 Parents: 68c35e7 Author: S.Vladykin Authored: Wed Jun 17 15:57:24 2015 +0300 Committer: S.Vladykin Committed: Wed Jun 17 15:57:24 2015 +0300 ---------------------------------------------------------------------- .../query/h2/twostep/GridMapQueryExecutor.java | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1fe215e2/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java index 42f01cb..aaf64ee 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java @@ -123,6 +123,18 @@ public class GridMapQueryExecutor { } }, EventType.EVT_NODE_FAILED, EventType.EVT_NODE_LEFT); + // Drop group reservations for dead caches. + ctx.event().addLocalEventListener(new GridLocalEventListener() { + @Override public void onEvent(Event evt) { + String cacheName = ((CacheEvent)evt).cacheName(); + + for (T2 grpKey : reservations.keySet()) { + if (F.eq(grpKey.get1(), cacheName)) + reservations.remove(grpKey); + } + } + }, EventType.EVT_CACHE_STOPPED); + ctx.io().addMessageListener(GridTopic.TOPIC_QUERY, new GridMessageListener() { @Override public void onMessage(UUID nodeId, Object msg) { if (!busyLock.enterBusy()) @@ -244,7 +256,9 @@ public class GridMapQueryExecutor { if (cctx.isLocal()) continue; - final T2 grpKey = new T2<>(cctx.name(), topVer); + // For replicated cache topology version does not make sense. + final T2 grpKey = + new T2<>(cctx.name(), cctx.isReplicated() ? null : topVer); GridReservable r = reservations.get(grpKey); @@ -265,10 +279,10 @@ public class GridMapQueryExecutor { // We don't need to reserve partitions because they will not be evicted in replicated caches. if (part == null || part.state() != OWNING) return false; - - // Mark that we checked this replicated cache. - reservations.putIfAbsent(grpKey, ReplicatedReservation.INSTANCE); } + + // Mark that we checked this replicated cache. + reservations.putIfAbsent(grpKey, ReplicatedReservation.INSTANCE); } } else { // Reserve primary partitions for partitioned cache (if no explicit given).