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 19D7918B6C for ; Wed, 6 May 2015 11:32:00 +0000 (UTC) Received: (qmail 17573 invoked by uid 500); 6 May 2015 11:32:00 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 17544 invoked by uid 500); 6 May 2015 11:32:00 -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 17498 invoked by uid 99); 6 May 2015 11:32:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2015 11:32:00 +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, 06 May 2015 11:31:51 +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 BBEF3453C3 for ; Wed, 6 May 2015 11:31:30 +0000 (UTC) Received: (qmail 15839 invoked by uid 99); 6 May 2015 11:31:30 -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, 06 May 2015 11:31:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 23BD3DFF07; Wed, 6 May 2015 11:31:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yzhdanov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 06 May 2015 11:31:38 -0000 Message-Id: In-Reply-To: <8dddfc316ea1439eb2f60b2dc7ccc8ea@git.apache.org> References: <8dddfc316ea1439eb2f60b2dc7ccc8ea@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/19] incubator-ignite git commit: # ignite-157-2 X-Virus-Checked: Checked by ClamAV on apache.org # ignite-157-2 Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3394b4c5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3394b4c5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3394b4c5 Branch: refs/heads/ignite-855 Commit: 3394b4c5aa8c557b94c8726ad5f27a01f2d76d32 Parents: 6509936 Author: sboikov Authored: Tue May 5 15:16:09 2015 +0300 Committer: sboikov Committed: Tue May 5 15:41:34 2015 +0300 ---------------------------------------------------------------------- .../GridCacheAbstractNodeRestartSelfTest.java | 94 +++++++++++--------- .../GridCachePartitionedNodeRestartTest.java | 4 +- ...ePartitionedOptimisticTxNodeRestartTest.java | 4 +- .../GridCacheReplicatedNodeRestartSelfTest.java | 2 + .../testsuites/IgniteCacheRestartTestSuite.java | 6 +- 5 files changed, 58 insertions(+), 52 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3394b4c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java index 17d6e42..85e2c7c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java @@ -77,10 +77,10 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs private static volatile int idx = -1; /** Preload mode. */ - protected CacheRebalanceMode preloadMode = ASYNC; + protected CacheRebalanceMode rebalancMode = ASYNC; /** */ - protected int preloadBatchSize = DFLT_BATCH_SIZE; + protected int rebalancBatchSize = DFLT_BATCH_SIZE; /** Number of partitions. */ protected int partitions = DFLT_PARTITIONS; @@ -124,8 +124,8 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs @Override protected void beforeTest() throws Exception { backups = DFLT_BACKUPS; partitions = DFLT_PARTITIONS; - preloadMode = ASYNC; - preloadBatchSize = DFLT_BATCH_SIZE; + rebalancMode = ASYNC; + rebalancBatchSize = DFLT_BATCH_SIZE; nodeCnt = DFLT_NODE_CNT; keyCnt = DFLT_KEY_CNT; retries = DFLT_RETRIES; @@ -160,7 +160,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs * @throws Exception If failed. */ public void testRestart() throws Exception { - preloadMode = SYNC; + rebalancMode = SYNC; partitions = 3; nodeCnt = 2; keyCnt = 10; @@ -240,7 +240,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 2; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 30000; @@ -255,7 +255,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 2; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 30000; @@ -270,7 +270,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 2; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 30000; @@ -285,7 +285,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 2; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 30000; @@ -300,7 +300,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 4; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 60000; @@ -315,7 +315,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 4; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 60000; @@ -330,7 +330,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 4; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 60000; @@ -345,7 +345,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 4; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 60000; @@ -360,7 +360,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 6; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -375,7 +375,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 6; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -390,7 +390,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 8; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -405,7 +405,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 8; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -420,7 +420,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 10; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -435,7 +435,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 10; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -450,7 +450,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 10; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -465,7 +465,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs nodeCnt = 4; keyCnt = 10; partitions = 29; - preloadMode = ASYNC; + rebalancMode = ASYNC; long duration = 90000; @@ -525,7 +525,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs catch (Exception e) { err.compareAndSet(null, e); - error("Failed to put value in cache.", e); + error("Unexpected exception in put-worker.", e); } } }, "put-worker-" + i); @@ -565,7 +565,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs catch (Exception e) { err.compareAndSet(null, e); - error("Failed to restart grid node.", e); + error("Unexpected exception in restart-worker.", e); } } }, "restart-worker-" + i); @@ -643,12 +643,16 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs int c = 0; try { - try (Transaction tx = ignite.transactions().txStart(txConcurrency(), REPEATABLE_READ)) { + IgniteTransactions txs = ignite.transactions(); + + try (Transaction tx = txs.txStart(txConcurrency(), REPEATABLE_READ)) { c = txCntr.incrementAndGet(); - if (c % logFreq == 0) - info(">>> Tx iteration started [cnt=" + c + ", keys=" + keys + ", " + - "locNodeId=" + locNodeId + ']'); + if (c % logFreq == 0) { + info(">>> Tx iteration started [cnt=" + c + + ", keys=" + keys + + ", locNodeId=" + locNodeId + ']'); + } for (int key : keys) { int op = cacheOp(); @@ -664,17 +668,15 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs tx.commit(); } } - catch (ClusterTopologyException | CacheException e) { - if (e instanceof CacheException - && !(e.getCause() instanceof ClusterTopologyException)) - throw e; - + catch (ClusterTopologyException | CacheException ignored) { // It is ok if primary node leaves grid. } - if (c % logFreq == 0) - info(">>> Tx iteration finished [cnt=" + c + ", keys=" + keys + ", " + - "locNodeId=" + locNodeId + ']'); + if (c % logFreq == 0) { + info(">>> Tx iteration finished [cnt=" + c + + ", keys=" + keys + + ", locNodeId=" + locNodeId + ']'); + } } info(">>> " + Thread.currentThread().getName() + " finished."); @@ -682,7 +684,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs catch (Exception e) { err.compareAndSet(null, e); - error("Failed to put value in cache.", e); + error("Unexpected exception in put-worker.", e); } } }, "put-worker-" + i); @@ -719,7 +721,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs catch (Exception e) { err.compareAndSet(null, e); - error("Failed to restart grid node.", e); + error("Unexpected exception in restart-worker.", e); } } }, "restart-worker-" + i); @@ -812,19 +814,21 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs tx.commit(); } - catch (ClusterTopologyException ignored) { + catch (ClusterTopologyException | CacheException ignored) { // It is ok if primary node leaves grid. } - if (c % logFreq == 0) - info(">>> Tx iteration finished [cnt=" + c + ", keys=" + keys + ", " + + if (c % logFreq == 0) { + info(">>> Tx iteration finished [cnt=" + c + + ", keys=" + keys + ", " + "locNodeId=" + locNodeId + ']'); + } } } catch (Exception e) { err.compareAndSet(null, e); - error("Failed to put value in cache.", e); + error("Unexpected exception in put-worker.", e); } } }, "put-worker-" + i); @@ -859,7 +863,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs catch (Exception e) { err.compareAndSet(null, e); - error("Failed to restart grid node.", e); + error("Unexpected exception in restart-worker.", e); } } }, "restart-worker-" + i); @@ -893,10 +897,12 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs * @param attempt Attempt. */ private void printFailureDetails(IgniteCache c, int key, int attempt) { + Ignite ignite = c.unwrap(Ignite.class); + error("*** Failure details ***"); error("Key: " + key); - error("Partition: " + c.getConfiguration(CacheConfiguration.class).getAffinity().partition(key)); + error("Partition: " + ignite.affinity(c.getName()).partition(key)); error("Attempt: " + attempt); - error("Node: " + c.unwrap(Ignite.class).cluster().localNode().id()); + error("Node: " + ignite.cluster().localNode().id()); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3394b4c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java index 8a2b19a..2096836 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java @@ -43,8 +43,8 @@ public class GridCachePartitionedNodeRestartTest extends GridCacheAbstractNodeRe cc.setWriteSynchronizationMode(FULL_ASYNC); cc.setNearConfiguration(null); cc.setStartSize(20); - cc.setRebalanceMode(preloadMode); - cc.setRebalanceBatchSize(preloadBatchSize); + cc.setRebalanceMode(rebalancMode); + cc.setRebalanceBatchSize(rebalancBatchSize); cc.setAffinity(new RendezvousAffinityFunction(false, partitions)); cc.setBackups(backups); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3394b4c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java index 62dfaa9..82da2ac 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java @@ -42,8 +42,8 @@ public class GridCachePartitionedOptimisticTxNodeRestartTest extends GridCacheAb cc.setCacheMode(PARTITIONED); cc.setWriteSynchronizationMode(FULL_ASYNC); cc.setStartSize(20); - cc.setRebalanceMode(preloadMode); - cc.setRebalanceBatchSize(preloadBatchSize); + cc.setRebalanceMode(rebalancMode); + cc.setRebalanceBatchSize(rebalancBatchSize); cc.setAffinity(new RendezvousAffinityFunction(false, partitions)); cc.setBackups(backups); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3394b4c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java index aa32559..0023160 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java @@ -34,6 +34,8 @@ public class GridCacheReplicatedNodeRestartSelfTest extends GridCacheAbstractNod CacheConfiguration cc = defaultCacheConfiguration(); + cc.setNearConfiguration(null); + cc.setAtomicityMode(atomicityMode()); cc.setName(CACHE_NAME); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3394b4c5/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java index 0ced1c8..b219f7f 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java @@ -21,7 +21,6 @@ import junit.framework.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.distributed.*; import org.apache.ignite.internal.processors.cache.distributed.near.*; -import org.apache.ignite.internal.processors.cache.distributed.replicated.*; /** * In-Memory Data Grid stability test suite on changing topology. @@ -36,10 +35,9 @@ public class IgniteCacheRestartTestSuite extends TestSuite { suite.addTestSuite(GridCachePartitionedTxSalvageSelfTest.class); - // TODO: GG-7419: Enable when fixed. - // suite.addTestSuite(GridCachePartitionedNodeRestartTest.class); + suite.addTestSuite(GridCachePartitionedNodeRestartTest.class); + // TODO: IGNITE-157. // suite.addTestSuite(GridCachePartitionedOptimisticTxNodeRestartTest.class); - // TODO: uncomment when fix GG-1969 // suite.addTestSuite(GridCacheReplicatedNodeRestartSelfTest.class); suite.addTestSuite(IgniteCacheAtomicNodeRestartTest.class);