Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B0659200497 for ; Wed, 23 Aug 2017 17:30:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AED1B168FB9; Wed, 23 Aug 2017 15:30:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE784168FB7 for ; Wed, 23 Aug 2017 17:30:00 +0200 (CEST) Received: (qmail 72507 invoked by uid 500); 23 Aug 2017 15:30:00 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 72496 invoked by uid 99); 23 Aug 2017 15:30:00 -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, 23 Aug 2017 15:29:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DD6A0E053D; Wed, 23 Aug 2017 15:29:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Message-Id: <899a93c87d7e41f4987873567d3865c4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: ignite-6174 Temporary changed test until issue not fixed Date: Wed, 23 Aug 2017 15:29:59 +0000 (UTC) archived-at: Wed, 23 Aug 2017 15:30:01 -0000 Repository: ignite Updated Branches: refs/heads/master eee638d3d -> 4fe8f762c ignite-6174 Temporary changed test until issue not fixed Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4fe8f762 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4fe8f762 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4fe8f762 Branch: refs/heads/master Commit: 4fe8f762c2dc1b62bdcddd606b66dc67215b50a6 Parents: eee638d Author: sboikov Authored: Wed Aug 23 18:29:52 2017 +0300 Committer: sboikov Committed: Wed Aug 23 18:29:52 2017 +0300 ---------------------------------------------------------------------- ...ePrimaryNodeFailureRecoveryAbstractTest.java | 111 ++++++++++--------- 1 file changed, 60 insertions(+), 51 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4fe8f762/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java index 0d0cda4..d147d31 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java @@ -56,6 +56,7 @@ import org.apache.ignite.transactions.Transaction; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; +import static org.apache.ignite.internal.processors.cache.ExchangeContext.IGNITE_EXCHANGE_COMPATIBILITY_VER_1; import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC; import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ; @@ -328,91 +329,99 @@ public abstract class IgniteCachePrimaryNodeFailureRecoveryAbstractTest extends boolean optimistic) throws Exception { - IgniteCache cache0 = jcache(0); - IgniteCache cache2 = jcache(2); + // TODO IGNITE-6174: when exchanges can be merged test fails because of IGNITE-6174. + System.setProperty(IGNITE_EXCHANGE_COMPATIBILITY_VER_1, "true"); - Affinity aff = ignite(0).affinity(DEFAULT_CACHE_NAME); + try { + IgniteCache cache0 = jcache(0); + IgniteCache cache2 = jcache(2); - Integer key0 = null; + Affinity aff = ignite(0).affinity(DEFAULT_CACHE_NAME); - for (int key = 0; key < 10_000; key++) { - if (aff.isPrimary(ignite(1).cluster().localNode(), key)) { - if (locBackupKey == aff.isBackup(ignite(0).cluster().localNode(), key)) { - key0 = key; + Integer key0 = null; - break; + for (int key = 0; key < 10_000; key++) { + if (aff.isPrimary(ignite(1).cluster().localNode(), key)) { + if (locBackupKey == aff.isBackup(ignite(0).cluster().localNode(), key)) { + key0 = key; + + break; + } } } - } - assertNotNull(key0); + assertNotNull(key0); - final Integer key1 = key0; - final Integer key2 = primaryKey(cache2); + final Integer key1 = key0; + final Integer key2 = primaryKey(cache2); - int backups = cache0.getConfiguration(CacheConfiguration.class).getBackups(); + int backups = cache0.getConfiguration(CacheConfiguration.class).getBackups(); - final Collection key1Nodes = - (locBackupKey && backups < 2) ? null : aff.mapKeyToPrimaryAndBackups(key1); - final Collection key2Nodes = aff.mapKeyToPrimaryAndBackups(key2); + final Collection key1Nodes = + (locBackupKey && backups < 2) ? null : aff.mapKeyToPrimaryAndBackups(key1); + final Collection key2Nodes = aff.mapKeyToPrimaryAndBackups(key2); - TestCommunicationSpi commSpi = (TestCommunicationSpi)ignite(0).configuration().getCommunicationSpi(); + TestCommunicationSpi commSpi = (TestCommunicationSpi)ignite(0).configuration().getCommunicationSpi(); - IgniteTransactions txs = ignite(0).transactions(); + IgniteTransactions txs = ignite(0).transactions(); - Transaction tx = txs.txStart(optimistic ? OPTIMISTIC : PESSIMISTIC, REPEATABLE_READ); + Transaction tx = txs.txStart(optimistic ? OPTIMISTIC : PESSIMISTIC, REPEATABLE_READ); - log.info("Put key1 [key1=" + key1 + ", nodes=" + U.nodeIds(aff.mapKeyToPrimaryAndBackups(key1)) + ']'); + log.info("Put key1 [key1=" + key1 + ", nodes=" + U.nodeIds(aff.mapKeyToPrimaryAndBackups(key1)) + ']'); - cache0.put(key1, key1); + cache0.put(key1, key1); - log.info("Put key2 [key2=" + key2 + ", nodes=" + U.nodeIds(aff.mapKeyToPrimaryAndBackups(key2)) + ']'); + log.info("Put key2 [key2=" + key2 + ", nodes=" + U.nodeIds(aff.mapKeyToPrimaryAndBackups(key2)) + ']'); - cache0.put(key2, key2); + cache0.put(key2, key2); - log.info("Start prepare."); + log.info("Start prepare."); - GridNearTxLocal txEx = ((TransactionProxyImpl)tx).tx(); + GridNearTxLocal txEx = ((TransactionProxyImpl)tx).tx(); - commSpi.blockMessages(ignite(2).cluster().localNode().id()); // Do not allow to finish prepare for key2. + commSpi.blockMessages(ignite(2).cluster().localNode().id()); // Do not allow to finish prepare for key2. - IgniteInternalFuture prepFut = txEx.prepareNearTxLocal(); + IgniteInternalFuture prepFut = txEx.prepareNearTxLocal(); - waitPrepared(ignite(1)); + waitPrepared(ignite(1)); - log.info("Stop one primary node."); + log.info("Stop one primary node."); - stopGrid(1); + stopGrid(1); - U.sleep(1000); // Wait some time to catch possible issues in tx recovery. + U.sleep(1000); // Wait some time to catch possible issues in tx recovery. - if (!rollback) { - commSpi.stopBlock(); + if (!rollback) { + commSpi.stopBlock(); - prepFut.get(10_000); - } + prepFut.get(10_000); + } - log.info("Stop originating node."); + log.info("Stop originating node."); - stopGrid(0); + stopGrid(0); - GridTestUtils.waitForCondition(new GridAbsPredicate() { - @Override public boolean apply() { - try { - checkKey(key1, rollback ? null : key1Nodes); - checkKey(key2, rollback ? null : key2Nodes); + GridTestUtils.waitForCondition(new GridAbsPredicate() { + @Override public boolean apply() { + try { + checkKey(key1, rollback ? null : key1Nodes); + checkKey(key2, rollback ? null : key2Nodes); - return true; - } catch (AssertionError e) { - log.info("Check failed: " + e); + return true; + } catch (AssertionError e) { + log.info("Check failed: " + e); - return false; + return false; + } } - } - }, 5000); + }, 5000); - checkKey(key1, rollback ? null : key1Nodes); - checkKey(key2, rollback ? null : key2Nodes); + checkKey(key1, rollback ? null : key1Nodes); + checkKey(key2, rollback ? null : key2Nodes); + } + finally { + System.clearProperty(IGNITE_EXCHANGE_COMPATIBILITY_VER_1); + } } /**