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 27B66189C0 for ; Thu, 23 Apr 2015 10:40:49 +0000 (UTC) Received: (qmail 41431 invoked by uid 500); 23 Apr 2015 10:40:49 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 41401 invoked by uid 500); 23 Apr 2015 10:40:49 -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 41392 invoked by uid 99); 23 Apr 2015 10:40:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 10:40:49 +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; Thu, 23 Apr 2015 10:40:44 +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 95F8D43DD7 for ; Thu, 23 Apr 2015 10:40:23 +0000 (UTC) Received: (qmail 40332 invoked by uid 99); 23 Apr 2015 10:40:23 -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; Thu, 23 Apr 2015 10:40:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 18964E179C; Thu, 23 Apr 2015 10:40:23 +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: Thu, 23 Apr 2015 10:40:29 -0000 Message-Id: <412dac12a5f742a389b73e764405c8d9@git.apache.org> In-Reply-To: <795437cadba042e29acdc64d60f1d619@git.apache.org> References: <795437cadba042e29acdc64d60f1d619@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [08/21] incubator-ignite git commit: ignite-446 X-Virus-Checked: Checked by ClamAV on apache.org ignite-446 Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/921a40c5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/921a40c5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/921a40c5 Branch: refs/heads/ignite-sprint-4 Commit: 921a40c5235cf5e7c96e1051a4dd9650f8f0ff0e Parents: d41b19d Author: avinogradov Authored: Wed Apr 15 17:20:51 2015 +0300 Committer: avinogradov Committed: Wed Apr 15 17:20:51 2015 +0300 ---------------------------------------------------------------------- .../org/apache/ignite/cluster/ClusterNode.java | 1 - .../dht/atomic/GridNearAtomicUpdateFuture.java | 1 + .../dht/colocated/GridDhtColocatedLockFuture.java | 2 ++ .../GridDhtPartitionsExchangeFuture.java | 2 +- .../distributed/near/GridNearLockFuture.java | 1 + .../distributed/near/GridNearTxPrepareFuture.java | 1 + .../IgniteTopologyValidatorAbstractCacheTest.java | 18 ++++++++++++++---- ...gniteTopologyValidatorAbstractTxCacheTest.java | 2 +- 8 files changed, 21 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java index 9de59a3..9cb5d3d 100644 --- a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java +++ b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java @@ -21,7 +21,6 @@ import org.apache.ignite.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.Serializable; import java.util.*; /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java index 0ed625a..72fb346 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java @@ -431,6 +431,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter if (!fut.isCacheTopologyValid(cctx)) { onDone(new IgniteCheckedException("Failed to perform cache operation (cache topology is not valid): " + cctx.name())); + return; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java index 0a54e07..fdb9505 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java @@ -554,6 +554,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity if (cctx.topology().stopping()) { onDone(new IgniteCheckedException("Failed to perform cache operation (cache is stopped): " + cctx.name())); + return; } @@ -563,6 +564,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity if (!fut.isCacheTopologyValid(cctx)) { onDone(new IgniteCheckedException("Failed to perform cache operation (cache topology is not valid): " + cctx.name())); + return; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index 5288ae5..6633b5c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -839,7 +839,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter m = new HashMap<>(); for (GridCacheContext cacheCtx : cctx.cacheContexts()) { - if (!CU.isSystemCache(cacheCtx.name()) && (cacheCtx.config().getTopologyValidator() != null)) + if (cacheCtx.config().getTopologyValidator() != null && !CU.isSystemCache(cacheCtx.name())) m.put(cacheCtx.cacheId(), cacheCtx.config().getTopologyValidator().validate(discoEvt.topologyNodes())); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java index 8f3e476..39820b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java @@ -696,6 +696,7 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFut if (!topFut.isCacheTopologyValid(ctx)) { onDone(new IgniteCheckedException("Failed to perform cache operation (cache topology is not valid): " + ctx.name())); + return; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java index b3b1d7e..55e3c1b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java @@ -30,6 +30,9 @@ import java.util.*; * Topology validator test */ public abstract class IgniteTopologyValidatorAbstractCacheTest extends IgniteCacheAbstractTest implements Serializable { + /** key-value used at test */ + protected static String KEY_VALUE = "1"; + /** {@inheritDoc} */ @Override protected int gridCount() { return 1; @@ -51,13 +54,15 @@ public abstract class IgniteTopologyValidatorAbstractCacheTest extends IgniteCac } /** - * Puts before validator passed. + * Puts before topology is valid. */ protected void putBefore(Transaction tx) { try { - jcache().put("1", "1"); + jcache().put(KEY_VALUE, KEY_VALUE); + if (tx != null) tx.commit(); + assert false : "topology validation broken"; } catch (IgniteException | CacheException ex) { @@ -66,13 +71,18 @@ public abstract class IgniteTopologyValidatorAbstractCacheTest extends IgniteCac } /** - * Puts when validator passed. + * Puts when topology is valid. */ protected void putAfter(Transaction tx) { try { - jcache().put("1", "1"); + assert jcache().get(KEY_VALUE) == null; + + jcache().put(KEY_VALUE, KEY_VALUE); + if (tx != null) tx.commit(); + + assert jcache().get(KEY_VALUE).equals(KEY_VALUE); } catch (IgniteException | CacheException ex) { assert false : "topology validation broken"; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java index 7fe91b8..eee4d5e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java @@ -55,7 +55,7 @@ public abstract class IgniteTopologyValidatorAbstractTxCacheTest extends IgniteT putAfter(tx); } - jcache().remove("1"); + jcache().remove(KEY_VALUE); try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) { putAfter(tx);