From 8c47d424b57bd0354792bd0d92197e467de0ebf3 Mon Sep 17 00:00:00 2001 From: pereslegin-pa Date: Thu, 20 Sep 2018 16:43:32 +0300 Subject: [PATCH 1/2] IGNITE-8092 Initial. --- .../cache/GatewayProtectedCacheProxy.java | 2 +- .../IgniteCacheAtomicPutOnDestroyTest.java | 30 ++++ .../cache/IgniteCachePutOnDestroyTest.java | 157 ++++++++++++++++++ .../cache/IgniteCacheTxPutOnDestroyTest.java | 93 +++++++++++ ...achePartitionedAtomicPutOnDestroyTest.java | 31 ++++ ...iteCachePartitionedTxPutOnDestroyTest.java | 31 ++++ ...CacheReplicatedAtomicPutOnDestroyTest.java | 31 ++++ ...niteCacheReplicatedTxPutOnDestroyTest.java | 31 ++++ ...gniteCacheLocalAtomicPutOnDestroyTest.java | 31 ++++ .../IgniteCacheLocalTxPutOnDestroyTest.java | 31 ++++ 10 files changed, 467 insertions(+), 1 deletion(-) create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedAtomicPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedTxPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedAtomicPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedTxPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalAtomicPutOnDestroyTest.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalTxPutOnDestroyTest.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java index c99eb006002e9f..b25c435cd1c4f1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java @@ -1549,7 +1549,7 @@ private GridCacheGateway checkProxyIsValid(@Nullable GridCacheGateway gate = checkProxyIsValid(gate(), true); + GridCacheGateway gate = checkProxyIsValid(gate(), context().localNode().isClient()); return new CacheOperationGate(gate, lock ? gate.enter(opCtx) : gate.enterNoLock(opCtx)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPutOnDestroyTest.java new file mode 100644 index 00000000000000..2768442a0f79e8 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPutOnDestroyTest.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache; + +import org.apache.ignite.cache.CacheAtomicityMode; + +/** + * Test ensures that the put operation does not hang during asynchronous cache destroy. + */ +public abstract class IgniteCacheAtomicPutOnDestroyTest extends IgniteCachePutOnDestroyTest { + /** {@inheritDoc} */ + @Override public CacheAtomicityMode atomicityMode() { + return CacheAtomicityMode.ATOMIC; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java new file mode 100644 index 00000000000000..9e1f22ad61a15b --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java @@ -0,0 +1,157 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache; + +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.internal.util.typedef.X; +import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.apache.ignite.transactions.Transaction; +import org.apache.ignite.transactions.TransactionConcurrency; +import org.apache.ignite.transactions.TransactionIsolation; + +/** + * Test ensures that the put operation does not hang during asynchronous cache destroy. + */ +public abstract class IgniteCachePutOnDestroyTest extends GridCommonAbstractTest { + /** Iteration count. */ + protected static final int ITER_CNT = 50; + + /** Grid count. */ + private static final int GRID_CNT = 2; + + /** Worker threads timeout. */ + private static final int TIMEOUT = 10_000; + + /** + * @param cacheName Cache name. + * @return Cache configuration. + */ + protected CacheConfiguration cacheConfiguration(String cacheName, String grpName) { + CacheConfiguration cfg = new CacheConfiguration<>(); + + cfg.setName(cacheName); + cfg.setGroupName(grpName); + cfg.setAtomicityMode(atomicityMode()); + + return cfg; + } + + /** + * @return Cache atomicity mode. + */ + protected abstract CacheAtomicityMode atomicityMode(); + + /** + * @return Cache mode. + */ + protected abstract CacheMode cacheMode(); + + /** {@inheritDoc} */ + @Override protected void beforeTestsStarted() throws Exception { + startGrids(GRID_CNT); + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testPutOnCacheDestroy() throws IgniteCheckedException { + for (int n = 0; n < ITER_CNT; n++) + doTestPutOnCacheDestroy(null, null); + } + + /** + * @param concurrency Transaction concurrency level. + * @param isolation Transaction isolation level. + * @throws IgniteCheckedException If failed. + */ + protected void doTestPutOnCacheDestroy(TransactionConcurrency concurrency, + TransactionIsolation isolation) throws IgniteCheckedException { + String grpName = "testGroup"; + + boolean explicitTx = concurrency != null && isolation != null; + + Ignite ignite = grid(0); + + IgniteCache additionalCache = ignite.createCache(cacheConfiguration("cache1", grpName)); + + try { + IgniteCache cache = ignite.getOrCreateCache(cacheConfiguration("cache2", grpName)); + + AtomicInteger cntr = new AtomicInteger(); + + GridTestUtils.runMultiThreadedAsync(() -> { + try { + int key; + + while ((key = cntr.getAndIncrement()) < 2_000) { + if (key == 1_000) { + cache.destroy(); + + break; + } + + if (explicitTx) { + try (Transaction tx = ignite.transactions().txStart(concurrency, isolation)) { + cache.put(key, true); + + tx.commit(); + } + } + else + cache.put(key, true); + } + } + catch (Exception e) { + assertTrue(X.getFullStackTrace(e), hasCacheStoppedMessage(e)); + } + + return null; + }, 6, "put-thread").get(TIMEOUT); + } + finally { + additionalCache.destroy(); + } + } + + /** + * Validate exception. + * + * @param e Exception. + * @return {@code True} if exception (or cause) is instance of {@link CacheStoppedException} or + * {@link IllegalStateException} and message contains "cache" and "stopped" keywords. + */ + private boolean hasCacheStoppedMessage(Exception e) { + for (Throwable t : X.getThrowableList(e)) { + if (t.getClass() == CacheStoppedException.class || t.getClass() == IllegalStateException.class) { + String errMsg = t.getMessage().toLowerCase(); + + if (errMsg.contains("cache") && errMsg.contains("stopped")) + return true; + } + } + + return false; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPutOnDestroyTest.java new file mode 100644 index 00000000000000..a8b921f49ac459 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPutOnDestroyTest.java @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.transactions.TransactionConcurrency; +import org.apache.ignite.transactions.TransactionIsolation; + +import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; +import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC; +import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; +import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED; +import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ; +import static org.apache.ignite.transactions.TransactionIsolation.SERIALIZABLE; + +/** + * Test ensures that the put operation does not hang during asynchronous cache destroy. + */ +public abstract class IgniteCacheTxPutOnDestroyTest extends IgniteCachePutOnDestroyTest { + /** {@inheritDoc} */ + @Override public CacheAtomicityMode atomicityMode() { + return TRANSACTIONAL; + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testTxPutOnDestroyCacheOptimisticReadCommitted() throws IgniteCheckedException { + doTestTxPutOnDestroyCache0(OPTIMISTIC, READ_COMMITTED); + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testTxPutOnDestroyCacheOptimisticRepeatableRead() throws IgniteCheckedException { + doTestTxPutOnDestroyCache0(OPTIMISTIC, REPEATABLE_READ); + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testTxPutOnDestroyCacheOptimisticSerializable() throws IgniteCheckedException { + doTestTxPutOnDestroyCache0(OPTIMISTIC, SERIALIZABLE); + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testTxPutOnDestroyCachePessimisticReadCommitted() throws IgniteCheckedException { + doTestTxPutOnDestroyCache0(PESSIMISTIC, READ_COMMITTED); + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testTxPutOnDestroyCachePessimisticRepeatableRead() throws IgniteCheckedException { + doTestTxPutOnDestroyCache0(PESSIMISTIC, REPEATABLE_READ); + } + + /** + * @throws IgniteCheckedException If failed. + */ + public void testTxPutOnDestroyCachePessimisticSerializable() throws IgniteCheckedException { + doTestTxPutOnDestroyCache0(PESSIMISTIC, SERIALIZABLE); + } + + /** + * @param concurrency Transaction concurrency level. + * @param isolation Transaction isolation level. + * @throws IgniteCheckedException If failed. + */ + private void doTestTxPutOnDestroyCache0(TransactionConcurrency concurrency, + TransactionIsolation isolation) throws IgniteCheckedException { + for (int n = 0; n < ITER_CNT; n++) + doTestPutOnCacheDestroy(concurrency, isolation); + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedAtomicPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedAtomicPutOnDestroyTest.java new file mode 100644 index 00000000000000..7b99318e03c2a8 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedAtomicPutOnDestroyTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.distributed.dht; + +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicPutOnDestroyTest; + +/** + * Tests for partitioned atomic cache. + */ +public class IgniteCachePartitionedAtomicPutOnDestroyTest extends IgniteCacheAtomicPutOnDestroyTest { + /** {@inheritDoc */ + @Override protected CacheMode cacheMode() { + return CacheMode.PARTITIONED; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedTxPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedTxPutOnDestroyTest.java new file mode 100644 index 00000000000000..98d0b3c8a0413d --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedTxPutOnDestroyTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.distributed.dht; + +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.internal.processors.cache.IgniteCacheTxPutOnDestroyTest; + +/** + * Tests for partitioned transactional cache. + */ +public class IgniteCachePartitionedTxPutOnDestroyTest extends IgniteCacheTxPutOnDestroyTest { + /** {@inheritDoc */ + @Override protected CacheMode cacheMode() { + return CacheMode.PARTITIONED; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedAtomicPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedAtomicPutOnDestroyTest.java new file mode 100644 index 00000000000000..0303ccb2f27f0f --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedAtomicPutOnDestroyTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.distributed.replicated; + +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicPutOnDestroyTest; + +/** + * Tests for replicated atomic cache. + */ +public class IgniteCacheReplicatedAtomicPutOnDestroyTest extends IgniteCacheAtomicPutOnDestroyTest { + /** {@inheritDoc */ + @Override protected CacheMode cacheMode() { + return CacheMode.REPLICATED; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedTxPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedTxPutOnDestroyTest.java new file mode 100644 index 00000000000000..a7a7b80d424e98 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedTxPutOnDestroyTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.distributed.replicated; + +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.internal.processors.cache.IgniteCacheTxPutOnDestroyTest; + +/** + * Tests for replicated transactional cache. + */ +public class IgniteCacheReplicatedTxPutOnDestroyTest extends IgniteCacheTxPutOnDestroyTest { + /** {@inheritDoc */ + @Override protected CacheMode cacheMode() { + return CacheMode.REPLICATED; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalAtomicPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalAtomicPutOnDestroyTest.java new file mode 100644 index 00000000000000..ce414147f6fe03 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalAtomicPutOnDestroyTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.local; + +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicPutOnDestroyTest; + +/** + * Tests for local atomic cache. + */ +public class IgniteCacheLocalAtomicPutOnDestroyTest extends IgniteCacheAtomicPutOnDestroyTest { + /** {@inheritDoc} */ + @Override protected CacheMode cacheMode() { + return CacheMode.LOCAL; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalTxPutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalTxPutOnDestroyTest.java new file mode 100644 index 00000000000000..eb881ac1c8269d --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalTxPutOnDestroyTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.local; + +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.internal.processors.cache.IgniteCacheTxPutOnDestroyTest; + +/** + * Tests for local transactional cache. + */ +public class IgniteCacheLocalTxPutOnDestroyTest extends IgniteCacheTxPutOnDestroyTest { + /** {@inheritDoc} */ + @Override protected CacheMode cacheMode() { + return CacheMode.LOCAL; + } +} From 77f01c6af0a65f021414462be70f0ccc3dee898f Mon Sep 17 00:00:00 2001 From: pereslegin-pa Date: Thu, 20 Sep 2018 18:36:53 +0300 Subject: [PATCH 2/2] wip --- .../processors/cache/GridCacheIoManager.java | 22 +- .../dht/atomic/GridDhtAtomicCache.java | 2 +- .../GridNearAtomicSingleUpdateFuture.java | 2 +- .../atomic/GridNearAtomicUpdateFuture.java | 2 +- .../colocated/GridDhtColocatedLockFuture.java | 2 +- .../distributed/near/GridNearLockFuture.java | 2 +- .../near/GridNearTxAbstractEnlistFuture.java | 2 +- .../near/TxTopologyVersionFuture.java | 2 +- .../IgniteTxImplicitSingleStateImpl.java | 2 +- .../cache/transactions/IgniteTxStateImpl.java | 2 +- .../org/apache/ignite/DestroyCacheTest.java | 59 +++ .../cache/IgniteCachePutOnDestroyTest.java | 26 +- .../testsuites/IgniteCacheTestSuite4.java | 358 +++++++++--------- 13 files changed, 293 insertions(+), 190 deletions(-) create mode 100644 modules/core/src/test/java/org/apache/ignite/DestroyCacheTest.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java index 2e66e5bfc3fe4f..c415a0c088a973 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java @@ -1116,15 +1116,23 @@ private boolean onSend(GridCacheMessage msg, @Nullable UUID destNodeId) throws I if (msg.error() != null && cctx.kernalContext().isStopping()) return false; - if (msg.messageId() < 0) - // Generate and set message ID. - msg.messageId(idGen.incrementAndGet()); + asdas - if (destNodeId == null || !cctx.localNodeId().equals(destNodeId)) { - msg.prepareMarshal(cctx); + try { + if (msg.messageId() < 0) + // Generate and set message ID. + msg.messageId(idGen.incrementAndGet()); + + if (destNodeId == null || !cctx.localNodeId().equals(destNodeId)) { + msg.prepareMarshal(cctx); - if (msg instanceof GridCacheDeployable && msg.addDeploymentInfo()) - cctx.deploy().prepare((GridCacheDeployable)msg); + if (msg instanceof GridCacheDeployable && msg.addDeploymentInfo()) + cctx.deploy().prepare((GridCacheDeployable)msg); + } + } catch (RuntimeException e) { + log.error(e.getMessage(), e);//.printStackTrace(); + + return false; } return true; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index 7bc04dc27c08a1..99b81962c62512 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -1757,7 +1757,7 @@ private void updateAllAsyncInternal0( top.readLock(); try { - if (top.stopping()) { + if (top.stopping() || context().gate().isStopped()) { res.addFailedKeys(req.keys(), new CacheStoppedException(name())); completionCb.apply(req, res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java index 82a796492d3b48..d6b1626d2fc8ff 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java @@ -403,7 +403,7 @@ private void updateNear(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicU @Override protected void mapOnTopology() { AffinityTopologyVersion topVer; - if (cache.topology().stopping()) { + if (cache.topology().stopping() || cache.context().gate().isStopped()) { completeFuture(null,new CacheStoppedException( cache.name()), null); 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 fd6b63e62b84e7..9a0ff8e2461c78 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 @@ -626,7 +626,7 @@ private void updateNear(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicU @Override protected void mapOnTopology() { AffinityTopologyVersion topVer; - if (cache.topology().stopping()) { + if (cache.topology().stopping() || cache.context().gate().isStopped()) { completeFuture(null,new CacheStoppedException(cache.name()), null); return; 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 9dbb8be974433a..450a53e804f01d 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 @@ -819,7 +819,7 @@ private void mapOnTopology(final boolean remap, @Nullable final Runnable c) { cctx.topology().readLock(); try { - if (cctx.topology().stopping()) { + if (cctx.topology().stopping() || cctx.gate().isStopped()) { onDone(new CacheStoppedException(cctx.name())); return; 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 6cd45148f95b13..c80a0ec62013a3 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 @@ -885,7 +885,7 @@ synchronized void mapOnTopology(final boolean remap) { cctx.topology().readLock(); try { - if (cctx.topology().stopping()) { + if (cctx.topology().stopping() || cctx.gate().isStopped()) { onDone(new CacheStoppedException(cctx.name())); return; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java index f484bd6ec34529..bdf6bbe87cf724 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java @@ -308,7 +308,7 @@ private void mapOnTopology() { cctx.topology().readLock(); try { - if (cctx.topology().stopping()) { + if (cctx.topology().stopping() || cctx.gate().isStopped()) { onDone(new CacheStoppedException(cctx.name())); return; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/TxTopologyVersionFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/TxTopologyVersionFuture.java index b5e38839b75b47..845c4fdbf3d952 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/TxTopologyVersionFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/TxTopologyVersionFuture.java @@ -99,7 +99,7 @@ private void acquireTopologyVersion() { cctx.topology().readLock(); try { - if (cctx.topology().stopping()) { + if (cctx.topology().stopping() || cctx.gate().isStopped()) { onDone(new CacheStoppedException(cctx.name())); return; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java index 10acb2266b04dd..9f4a1c921aadce 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java @@ -147,7 +147,7 @@ public class IgniteTxImplicitSingleStateImpl extends IgniteTxLocalStateAdapter { cacheCtx.topology().readLock(); - if (cacheCtx.topology().stopping()) { + if (cacheCtx.topology().stopping() || cacheCtx.gate().isStopped()) { fut.onDone(new CacheStoppedException(cacheCtx.name())); return null; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java index 371c6d044f039f..90d3f0621d6bf4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java @@ -287,7 +287,7 @@ public class IgniteTxStateImpl extends IgniteTxLocalStateAdapter { nonLocCtx.topology().readLock(); - if (nonLocCtx.topology().stopping()) { + if (nonLocCtx.topology().stopping() || nonLocCtx.gate().isStopped()) { fut.onDone(new CacheStoppedException(nonLocCtx.name())); return null; diff --git a/modules/core/src/test/java/org/apache/ignite/DestroyCacheTest.java b/modules/core/src/test/java/org/apache/ignite/DestroyCacheTest.java new file mode 100644 index 00000000000000..8a4fdf7b5d354e --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/DestroyCacheTest.java @@ -0,0 +1,59 @@ +package org.apache.ignite; + +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; + + +public class DestroyCacheTest extends GridCommonAbstractTest { + + private CacheConfiguration ccfg(String name, String grp) { + return new CacheConfiguration(name).setCacheMode(CacheMode.PARTITIONED) + .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) + .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) + .setGroupName(grp); + } + + public void testDestroyAsync() throws Exception { + String grpName = "testGroup"; + + try (IgniteEx node = startGrid(0)) { + node.createCache(ccfg("cache2", grpName)); + + for (int n = 0; n < 100; n++) { + IgniteCache cache1 = node.createCache(ccfg("cache1", grpName)); + + AtomicInteger cntr = new AtomicInteger(); + + GridTestUtils.runMultiThreadedAsync(() -> { + try { + int key; + + while ((key = cntr.getAndIncrement()) < 10_000) { + if (key == 1000) + cache1.destroy(); + + cache1.putIfAbsent(key, true); + } + } + catch (Exception ignore) { + log.warning(ignore.getMessage()); + } + + return null; + }, 6, "put-thread").get(); + } + +// System.out.println("HANGED THREADS: " + acq.size()); +// +// for (Thread t : acq.values()) +// U.dumpStack(t); + } + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java index 9e1f22ad61a15b..591cdba2d549f8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutOnDestroyTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; @@ -124,7 +125,11 @@ protected void doTestPutOnCacheDestroy(TransactionConcurrency concurrency, } } catch (Exception e) { - assertTrue(X.getFullStackTrace(e), hasCacheStoppedMessage(e)); + if (!hasCacheStoppedMessage(e)) { + + //assertTrue(X.getFullStackTrace(e), ); + fail("fuck off"); + } } return null; @@ -142,13 +147,30 @@ protected void doTestPutOnCacheDestroy(TransactionConcurrency concurrency, * @return {@code True} if exception (or cause) is instance of {@link CacheStoppedException} or * {@link IllegalStateException} and message contains "cache" and "stopped" keywords. */ - private boolean hasCacheStoppedMessage(Exception e) { + private boolean hasCacheStoppedMessage(Throwable e) { for (Throwable t : X.getThrowableList(e)) { if (t.getClass() == CacheStoppedException.class || t.getClass() == IllegalStateException.class) { String errMsg = t.getMessage().toLowerCase(); if (errMsg.contains("cache") && errMsg.contains("stopped")) return true; + +// for (Throwable t0 : X.getSuppressedList(t)) +// if (hasCacheStoppedMessage(t0)) +// return true; + } + } + + for (Throwable t : X.getSuppressedList(e)) { + if (t.getClass() == CacheStoppedException.class || t.getClass() == IllegalStateException.class) { + String errMsg = t.getMessage().toLowerCase(); + + if (errMsg.contains("cache") && errMsg.contains("stopped")) + return true; + +// for (Throwable t0 : X.getSuppressedList(t)) +// if (hasCacheStoppedMessage(t0)) +// return true; } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java index 370fa4939250fe..50e3564c42c338 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java @@ -111,11 +111,15 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheDhtTxPreloadSelfTest; import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheLockFailoverSelfTest; import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheMultiTxLockSelfTest; +import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCachePartitionedAtomicPutOnDestroyTest; +import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCachePartitionedTxPutOnDestroyTest; import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCrossCacheTxSelfTest; import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheNearTxPreloadSelfTest; import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheNearOnlyTxTest; import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheNearReadCommittedTest; import org.apache.ignite.internal.processors.cache.distributed.replicated.GridReplicatedTxPreloadTest; +import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedAtomicPutOnDestroyTest; +import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedTxPutOnDestroyTest; import org.apache.ignite.internal.processors.cache.integration.IgniteCacheAtomicLoadAllTest; import org.apache.ignite.internal.processors.cache.integration.IgniteCacheAtomicLoaderWriterTest; import org.apache.ignite.internal.processors.cache.integration.IgniteCacheAtomicLocalLoadAllTest; @@ -146,6 +150,8 @@ import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxStoreSessionTest; import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxStoreSessionWriteBehindCoalescingTest; import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxStoreSessionWriteBehindTest; +import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalAtomicPutOnDestroyTest; +import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalTxPutOnDestroyTest; import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryLocalAtomicSwapDisabledSelfTest; import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryLocalTransactionalSelfTest; import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedAtomicSelfTest; @@ -167,178 +173,186 @@ public static TestSuite suite() throws Exception { TestSuite suite = new TestSuite("IgniteCache Test Suite part 4"); - // Multi node update. - suite.addTestSuite(GridCacheMultinodeUpdateSelfTest.class); - suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class); - suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class); - suite.addTestSuite(GridCacheMultinodeUpdateAtomicSelfTest.class); - suite.addTestSuite(GridCacheMultinodeUpdateAtomicNearEnabledSelfTest.class); - - suite.addTestSuite(IgniteCacheAtomicLoadAllTest.class); - suite.addTestSuite(IgniteCacheAtomicLocalLoadAllTest.class); - suite.addTestSuite(IgniteCacheTxLoadAllTest.class); - suite.addTestSuite(IgniteCacheTxLocalLoadAllTest.class); - - suite.addTestSuite(IgniteCacheAtomicLoaderWriterTest.class); - suite.addTestSuite(IgniteCacheTxLoaderWriterTest.class); - - suite.addTestSuite(IgniteCacheAtomicStoreSessionTest.class); - suite.addTestSuite(IgniteCacheTxStoreSessionTest.class); - suite.addTestSuite(IgniteCacheAtomicStoreSessionWriteBehindTest.class); - suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindTest.class); - suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindCoalescingTest.class); - - suite.addTestSuite(IgniteCacheAtomicNoReadThroughTest.class); - suite.addTestSuite(IgniteCacheAtomicNearEnabledNoReadThroughTest.class); - suite.addTestSuite(IgniteCacheAtomicLocalNoReadThroughTest.class); - suite.addTestSuite(IgniteCacheTxNoReadThroughTest.class); - suite.addTestSuite(IgniteCacheTxNearEnabledNoReadThroughTest.class); - suite.addTestSuite(IgniteCacheTxLocalNoReadThroughTest.class); - - suite.addTestSuite(IgniteCacheAtomicNoLoadPreviousValueTest.class); - suite.addTestSuite(IgniteCacheAtomicNearEnabledNoLoadPreviousValueTest.class); - suite.addTestSuite(IgniteCacheAtomicLocalNoLoadPreviousValueTest.class); - suite.addTestSuite(IgniteCacheTxNoLoadPreviousValueTest.class); - suite.addTestSuite(IgniteCacheTxNearEnabledNoLoadPreviousValueTest.class); - suite.addTestSuite(IgniteCacheTxLocalNoLoadPreviousValueTest.class); - - suite.addTestSuite(IgniteCacheAtomicNoWriteThroughTest.class); - suite.addTestSuite(IgniteCacheAtomicNearEnabledNoWriteThroughTest.class); - suite.addTestSuite(IgniteCacheAtomicLocalNoWriteThroughTest.class); - suite.addTestSuite(IgniteCacheTxNoWriteThroughTest.class); - suite.addTestSuite(IgniteCacheTxNearEnabledNoWriteThroughTest.class); - suite.addTestSuite(IgniteCacheTxLocalNoWriteThroughTest.class); - - suite.addTestSuite(IgniteCacheAtomicPeekModesTest.class); - suite.addTestSuite(IgniteCacheAtomicNearPeekModesTest.class); - suite.addTestSuite(IgniteCacheAtomicReplicatedPeekModesTest.class); - suite.addTestSuite(IgniteCacheAtomicLocalPeekModesTest.class); - suite.addTestSuite(IgniteCacheTxPeekModesTest.class); - suite.addTestSuite(IgniteCacheTxNearPeekModesTest.class); - suite.addTestSuite(IgniteCacheTxLocalPeekModesTest.class); - suite.addTestSuite(IgniteCacheTxReplicatedPeekModesTest.class); - - suite.addTestSuite(IgniteCacheInvokeReadThroughSingleNodeTest.class); - suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class); - suite.addTestSuite(IgniteCacheReadThroughStoreCallTest.class); - suite.addTestSuite(GridCacheVersionMultinodeTest.class); - - suite.addTestSuite(IgniteCacheNearReadCommittedTest.class); - suite.addTestSuite(IgniteCacheAtomicCopyOnReadDisabledTest.class); - suite.addTestSuite(IgniteCacheTxCopyOnReadDisabledTest.class); - - suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class); - - suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class); - suite.addTestSuite(IgniteDynamicCacheMultinodeTest.class); - suite.addTestSuite(IgniteDynamicCacheStartFailTest.class); - suite.addTestSuite(IgniteDynamicCacheStartCoordinatorFailoverTest.class); - suite.addTestSuite(IgniteDynamicCacheWithConfigStartSelfTest.class); - suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class); - suite.addTestSuite(IgniteDynamicCacheStartStopConcurrentTest.class); - suite.addTestSuite(IgniteCacheConfigurationTemplateTest.class); - suite.addTestSuite(IgniteCacheConfigurationDefaultTemplateTest.class); - suite.addTestSuite(IgniteDynamicClientCacheStartSelfTest.class); - suite.addTestSuite(IgniteDynamicCacheStartNoExchangeTimeoutTest.class); - suite.addTestSuite(CacheAffinityEarlyTest.class); - suite.addTestSuite(IgniteCacheCreatePutMultiNodeSelfTest.class); - suite.addTestSuite(IgniteCacheCreatePutTest.class); - suite.addTestSuite(CacheStartOnJoinTest.class); - suite.addTestSuite(IgniteCacheStartTest.class); - suite.addTestSuite(CacheDiscoveryDataConcurrentJoinTest.class); - suite.addTestSuite(IgniteClientCacheInitializationFailTest.class); - suite.addTestSuite(IgniteCacheFailedUpdateResponseTest.class); - - suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class); - - suite.addTestSuite(GridCacheMarshallingNodeJoinSelfTest.class); - - suite.addTestSuite(IgniteCacheJdbcBlobStoreNodeRestartTest.class); - - suite.addTestSuite(IgniteCacheAtomicLocalStoreValueTest.class); - suite.addTestSuite(IgniteCacheAtomicStoreValueTest.class); - suite.addTestSuite(IgniteCacheAtomicNearEnabledStoreValueTest.class); - suite.addTestSuite(IgniteCacheTxLocalStoreValueTest.class); - suite.addTestSuite(IgniteCacheTxStoreValueTest.class); - suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class); - - suite.addTestSuite(IgniteCacheLockFailoverSelfTest.class); - suite.addTestSuite(IgniteCacheMultiTxLockSelfTest.class); - - suite.addTestSuite(IgniteInternalCacheTypesTest.class); - - suite.addTestSuite(IgniteExchangeFutureHistoryTest.class); - - suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class); - suite.addTestSuite(IgniteSystemCacheOnClientTest.class); - - suite.addTestSuite(CacheRemoveAllSelfTest.class); - suite.addTestSuite(CacheGetEntryOptimisticReadCommittedSeltTest.class); - suite.addTestSuite(CacheGetEntryOptimisticRepeatableReadSeltTest.class); - suite.addTestSuite(CacheGetEntryOptimisticSerializableSeltTest.class); - suite.addTestSuite(CacheGetEntryPessimisticReadCommittedSeltTest.class); - suite.addTestSuite(CacheGetEntryPessimisticRepeatableReadSeltTest.class); - suite.addTestSuite(CacheGetEntryPessimisticSerializableSeltTest.class); - suite.addTestSuite(CacheTxNotAllowReadFromBackupTest.class); - - suite.addTestSuite(CacheStopAndDestroySelfTest.class); - - suite.addTestSuite(CacheOffheapMapEntrySelfTest.class); - - suite.addTestSuite(CacheJdbcStoreSessionListenerSelfTest.class); - suite.addTestSuite(CacheStoreSessionListenerLifecycleSelfTest.class); - suite.addTestSuite(CacheStoreListenerRWThroughDisabledAtomicCacheTest.class); - suite.addTestSuite(CacheStoreListenerRWThroughDisabledTransactionalCacheTest.class); - suite.addTestSuite(CacheStoreSessionListenerWriteBehindEnabledTest.class); - - suite.addTestSuite(CacheClientStoreSelfTest.class); - suite.addTestSuite(CacheStoreUsageMultinodeStaticStartAtomicTest.class); - suite.addTestSuite(CacheStoreUsageMultinodeStaticStartTxTest.class); - suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartAtomicTest.class); - suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartTxTest.class); - suite.addTestSuite(CacheConnectionLeakStoreTxTest.class); - - suite.addTestSuite(GridCacheStoreManagerDeserializationTest.class); - suite.addTestSuite(GridLocalCacheStoreManagerDeserializationTest.class); - - suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class); - suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class); - - suite.addTestSuite(CacheReadThroughRestartSelfTest.class); - suite.addTestSuite(CacheReadThroughReplicatedRestartSelfTest.class); - suite.addTestSuite(CacheReadThroughReplicatedAtomicRestartSelfTest.class); - suite.addTestSuite(CacheReadThroughLocalRestartSelfTest.class); - suite.addTestSuite(CacheReadThroughLocalAtomicRestartSelfTest.class); - suite.addTestSuite(CacheReadThroughAtomicRestartSelfTest.class); - - // Versioned entry tests - suite.addTestSuite(CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.class); - suite.addTestSuite(CacheVersionedEntryLocalTransactionalSelfTest.class); - suite.addTestSuite(CacheVersionedEntryPartitionedAtomicSelfTest.class); - suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalSelfTest.class); - suite.addTestSuite(CacheVersionedEntryReplicatedAtomicSelfTest.class); - suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalSelfTest.class); - - suite.addTestSuite(GridCacheDhtTxPreloadSelfTest.class); - suite.addTestSuite(GridCacheNearTxPreloadSelfTest.class); - suite.addTestSuite(GridReplicatedTxPreloadTest.class); - suite.addTestSuite(CacheGroupsPreloadTest.class); - - suite.addTestSuite(IgniteDynamicCacheFilterTest.class); - - suite.addTestSuite(CrossCacheLockTest.class); - suite.addTestSuite(IgniteCrossCacheTxSelfTest.class); - - suite.addTestSuite(CacheGetFutureHangsSelfTest.class); - - suite.addTestSuite(IgniteCacheSingleGetMessageTest.class); - suite.addTestSuite(IgniteCacheReadFromBackupTest.class); - - suite.addTestSuite(MarshallerCacheJobRunNodeRestartTest.class); - - suite.addTestSuite(IgniteCacheNearOnlyTxTest.class); - - suite.addTestSuite(IgniteCacheContainsKeyAtomicTest.class); +// // Multi node update. +// suite.addTestSuite(GridCacheMultinodeUpdateSelfTest.class); +// suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class); +// suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class); +// suite.addTestSuite(GridCacheMultinodeUpdateAtomicSelfTest.class); +// suite.addTestSuite(GridCacheMultinodeUpdateAtomicNearEnabledSelfTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicLoadAllTest.class); +// suite.addTestSuite(IgniteCacheAtomicLocalLoadAllTest.class); +// suite.addTestSuite(IgniteCacheTxLoadAllTest.class); +// suite.addTestSuite(IgniteCacheTxLocalLoadAllTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicLoaderWriterTest.class); +// suite.addTestSuite(IgniteCacheTxLoaderWriterTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicStoreSessionTest.class); +// suite.addTestSuite(IgniteCacheTxStoreSessionTest.class); +// suite.addTestSuite(IgniteCacheAtomicStoreSessionWriteBehindTest.class); +// suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindTest.class); +// suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindCoalescingTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicNoReadThroughTest.class); +// suite.addTestSuite(IgniteCacheAtomicNearEnabledNoReadThroughTest.class); +// suite.addTestSuite(IgniteCacheAtomicLocalNoReadThroughTest.class); +// suite.addTestSuite(IgniteCacheTxNoReadThroughTest.class); +// suite.addTestSuite(IgniteCacheTxNearEnabledNoReadThroughTest.class); +// suite.addTestSuite(IgniteCacheTxLocalNoReadThroughTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicNoLoadPreviousValueTest.class); +// suite.addTestSuite(IgniteCacheAtomicNearEnabledNoLoadPreviousValueTest.class); +// suite.addTestSuite(IgniteCacheAtomicLocalNoLoadPreviousValueTest.class); +// suite.addTestSuite(IgniteCacheTxNoLoadPreviousValueTest.class); +// suite.addTestSuite(IgniteCacheTxNearEnabledNoLoadPreviousValueTest.class); +// suite.addTestSuite(IgniteCacheTxLocalNoLoadPreviousValueTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicNoWriteThroughTest.class); +// suite.addTestSuite(IgniteCacheAtomicNearEnabledNoWriteThroughTest.class); +// suite.addTestSuite(IgniteCacheAtomicLocalNoWriteThroughTest.class); +// suite.addTestSuite(IgniteCacheTxNoWriteThroughTest.class); +// suite.addTestSuite(IgniteCacheTxNearEnabledNoWriteThroughTest.class); +// suite.addTestSuite(IgniteCacheTxLocalNoWriteThroughTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicPeekModesTest.class); +// suite.addTestSuite(IgniteCacheAtomicNearPeekModesTest.class); +// suite.addTestSuite(IgniteCacheAtomicReplicatedPeekModesTest.class); +// suite.addTestSuite(IgniteCacheAtomicLocalPeekModesTest.class); +// suite.addTestSuite(IgniteCacheTxPeekModesTest.class); +// suite.addTestSuite(IgniteCacheTxNearPeekModesTest.class); +// suite.addTestSuite(IgniteCacheTxLocalPeekModesTest.class); +// suite.addTestSuite(IgniteCacheTxReplicatedPeekModesTest.class); +// +// suite.addTestSuite(IgniteCacheInvokeReadThroughSingleNodeTest.class); +// suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class); +// suite.addTestSuite(IgniteCacheReadThroughStoreCallTest.class); +// suite.addTestSuite(GridCacheVersionMultinodeTest.class); +// +// suite.addTestSuite(IgniteCacheNearReadCommittedTest.class); +// suite.addTestSuite(IgniteCacheAtomicCopyOnReadDisabledTest.class); +// suite.addTestSuite(IgniteCacheTxCopyOnReadDisabledTest.class); +// +// suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class); +// +// suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class); +// suite.addTestSuite(IgniteDynamicCacheMultinodeTest.class); +// suite.addTestSuite(IgniteDynamicCacheStartFailTest.class); +// suite.addTestSuite(IgniteDynamicCacheStartCoordinatorFailoverTest.class); +// suite.addTestSuite(IgniteDynamicCacheWithConfigStartSelfTest.class); +// suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class); +// suite.addTestSuite(IgniteDynamicCacheStartStopConcurrentTest.class); +// suite.addTestSuite(IgniteCacheConfigurationTemplateTest.class); +// suite.addTestSuite(IgniteCacheConfigurationDefaultTemplateTest.class); +// suite.addTestSuite(IgniteDynamicClientCacheStartSelfTest.class); +// suite.addTestSuite(IgniteDynamicCacheStartNoExchangeTimeoutTest.class); +// suite.addTestSuite(CacheAffinityEarlyTest.class); +// suite.addTestSuite(IgniteCacheCreatePutMultiNodeSelfTest.class); +// suite.addTestSuite(IgniteCacheCreatePutTest.class); +// suite.addTestSuite(CacheStartOnJoinTest.class); +// suite.addTestSuite(IgniteCacheStartTest.class); +// suite.addTestSuite(CacheDiscoveryDataConcurrentJoinTest.class); +// suite.addTestSuite(IgniteClientCacheInitializationFailTest.class); +// suite.addTestSuite(IgniteCacheFailedUpdateResponseTest.class); +// +// suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class); +// +// suite.addTestSuite(GridCacheMarshallingNodeJoinSelfTest.class); +// +// suite.addTestSuite(IgniteCacheJdbcBlobStoreNodeRestartTest.class); +// +// suite.addTestSuite(IgniteCacheAtomicLocalStoreValueTest.class); +// suite.addTestSuite(IgniteCacheAtomicStoreValueTest.class); +// suite.addTestSuite(IgniteCacheAtomicNearEnabledStoreValueTest.class); +// suite.addTestSuite(IgniteCacheTxLocalStoreValueTest.class); +// suite.addTestSuite(IgniteCacheTxStoreValueTest.class); +// suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class); +// +// suite.addTestSuite(IgniteCacheLockFailoverSelfTest.class); +// suite.addTestSuite(IgniteCacheMultiTxLockSelfTest.class); +// +// suite.addTestSuite(IgniteInternalCacheTypesTest.class); +// +// suite.addTestSuite(IgniteExchangeFutureHistoryTest.class); +// +// suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class); +// suite.addTestSuite(IgniteSystemCacheOnClientTest.class); +// +// suite.addTestSuite(CacheRemoveAllSelfTest.class); +// suite.addTestSuite(CacheGetEntryOptimisticReadCommittedSeltTest.class); +// suite.addTestSuite(CacheGetEntryOptimisticRepeatableReadSeltTest.class); +// suite.addTestSuite(CacheGetEntryOptimisticSerializableSeltTest.class); +// suite.addTestSuite(CacheGetEntryPessimisticReadCommittedSeltTest.class); +// suite.addTestSuite(CacheGetEntryPessimisticRepeatableReadSeltTest.class); +// suite.addTestSuite(CacheGetEntryPessimisticSerializableSeltTest.class); +// suite.addTestSuite(CacheTxNotAllowReadFromBackupTest.class); +// +// suite.addTestSuite(CacheStopAndDestroySelfTest.class); +// +// suite.addTestSuite(CacheOffheapMapEntrySelfTest.class); +// +// suite.addTestSuite(CacheJdbcStoreSessionListenerSelfTest.class); +// suite.addTestSuite(CacheStoreSessionListenerLifecycleSelfTest.class); +// suite.addTestSuite(CacheStoreListenerRWThroughDisabledAtomicCacheTest.class); +// suite.addTestSuite(CacheStoreListenerRWThroughDisabledTransactionalCacheTest.class); +// suite.addTestSuite(CacheStoreSessionListenerWriteBehindEnabledTest.class); +// +// suite.addTestSuite(CacheClientStoreSelfTest.class); +// suite.addTestSuite(CacheStoreUsageMultinodeStaticStartAtomicTest.class); +// suite.addTestSuite(CacheStoreUsageMultinodeStaticStartTxTest.class); +// suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartAtomicTest.class); +// suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartTxTest.class); +// suite.addTestSuite(CacheConnectionLeakStoreTxTest.class); +// +// suite.addTestSuite(GridCacheStoreManagerDeserializationTest.class); +// suite.addTestSuite(GridLocalCacheStoreManagerDeserializationTest.class); +// +// suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class); +// suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class); + + suite.addTestSuite(IgniteCacheLocalAtomicPutOnDestroyTest.class); + suite.addTestSuite(IgniteCacheReplicatedAtomicPutOnDestroyTest.class); + suite.addTestSuite(IgniteCachePartitionedAtomicPutOnDestroyTest.class); + + suite.addTestSuite(IgniteCacheLocalTxPutOnDestroyTest.class); + suite.addTestSuite(IgniteCacheReplicatedTxPutOnDestroyTest.class); + suite.addTestSuite(IgniteCachePartitionedTxPutOnDestroyTest.class); + +// suite.addTestSuite(CacheReadThroughRestartSelfTest.class); +// suite.addTestSuite(CacheReadThroughReplicatedRestartSelfTest.class); +// suite.addTestSuite(CacheReadThroughReplicatedAtomicRestartSelfTest.class); +// suite.addTestSuite(CacheReadThroughLocalRestartSelfTest.class); +// suite.addTestSuite(CacheReadThroughLocalAtomicRestartSelfTest.class); +// suite.addTestSuite(CacheReadThroughAtomicRestartSelfTest.class); +// +// // Versioned entry tests +// suite.addTestSuite(CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.class); +// suite.addTestSuite(CacheVersionedEntryLocalTransactionalSelfTest.class); +// suite.addTestSuite(CacheVersionedEntryPartitionedAtomicSelfTest.class); +// suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalSelfTest.class); +// suite.addTestSuite(CacheVersionedEntryReplicatedAtomicSelfTest.class); +// suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalSelfTest.class); +// +// suite.addTestSuite(GridCacheDhtTxPreloadSelfTest.class); +// suite.addTestSuite(GridCacheNearTxPreloadSelfTest.class); +// suite.addTestSuite(GridReplicatedTxPreloadTest.class); +// suite.addTestSuite(CacheGroupsPreloadTest.class); +// +// suite.addTestSuite(IgniteDynamicCacheFilterTest.class); +// +// suite.addTestSuite(CrossCacheLockTest.class); +// suite.addTestSuite(IgniteCrossCacheTxSelfTest.class); +// +// suite.addTestSuite(CacheGetFutureHangsSelfTest.class); +// +// suite.addTestSuite(IgniteCacheSingleGetMessageTest.class); +// suite.addTestSuite(IgniteCacheReadFromBackupTest.class); +// +// suite.addTestSuite(MarshallerCacheJobRunNodeRestartTest.class); +// +// suite.addTestSuite(IgniteCacheNearOnlyTxTest.class); +// +// suite.addTestSuite(IgniteCacheContainsKeyAtomicTest.class); return suite; }