You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/02/15 13:55:41 UTC

[4/5] ignite git commit: ignite-2407

ignite-2407


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/48d31c09
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/48d31c09
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/48d31c09

Branch: refs/heads/ignite-2407
Commit: 48d31c099b3d8a627bd281d7d0c105b131d2fea3
Parents: a4de9fc
Author: sboikov <sb...@gridgain.com>
Authored: Mon Feb 15 15:46:14 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Feb 15 15:54:38 2016 +0300

----------------------------------------------------------------------
 .../near/GridNearTxFinishFuture.java            |  27 --
 .../internal/TestRecordingCommunicationSpi.java |  21 +-
 .../cache/IgniteCacheNearLockValueSelfTest.java |   2 +-
 .../IgniteCacheReadFromBackupTest.java          |  10 +-
 .../IgniteCacheSingleGetMessageTest.java        |   8 +-
 .../IgniteTxCachePrimarySyncTest.java           | 253 ++++++++++++++++++-
 .../GridCacheDhtPreloadMessageCountTest.java    |   6 +-
 7 files changed, 277 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 6a18a91..d863cf1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -337,13 +337,6 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
     }
 
     /**
-     * Completeness callback.
-     */
-    private void onComplete() {
-        onDone(tx);
-    }
-
-    /**
      * Initializes future.
      */
     @SuppressWarnings("ForLoopReplaceableByForEach")
@@ -374,26 +367,6 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
                 }
 
                 markInitialized();
-
-                if (tx.syncMode() != FULL_SYNC && !isDone()) {
-                    boolean complete = true;
-
-                    synchronized (futs) {
-                        // Avoid collection copy and iterator creation.
-                        for (int i = 0; i < futs.size(); i++) {
-                            IgniteInternalFuture<IgniteInternalTx> f = futs.get(i);
-
-                            if (isMini(f) && !f.isDone()) {
-                                complete = false;
-
-                                break;
-                            }
-                        }
-                    }
-
-                    if (complete)
-                        onComplete();
-                }
             }
             else
                 onDone(new IgniteCheckedException("Failed to commit transaction: " + CU.txString(tx)));

http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/test/java/org/apache/ignite/internal/TestRecordingCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/TestRecordingCommunicationSpi.java b/modules/core/src/test/java/org/apache/ignite/internal/TestRecordingCommunicationSpi.java
index 9eca8cb..2c34bb7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/TestRecordingCommunicationSpi.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/TestRecordingCommunicationSpi.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -32,7 +33,6 @@ import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.plugin.extensions.communication.Message;
 import org.apache.ignite.spi.IgniteSpiException;
 import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
-import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_GRID_NAME;
 
@@ -41,7 +41,7 @@ import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_GRID_NAME;
  */
 public class TestRecordingCommunicationSpi extends TcpCommunicationSpi {
     /** */
-    private Class<?> recordCls;
+    private Set<Class<?>> recordClasses;
 
     /** */
     private List<Object> recordedMsgs = new ArrayList<>();
@@ -64,7 +64,7 @@ public class TestRecordingCommunicationSpi extends TcpCommunicationSpi {
             Object msg0 = ioMsg.message();
 
             synchronized (this) {
-                if (recordCls != null && msg0.getClass().equals(recordCls))
+                if (recordClasses != null && recordClasses.contains(msg0.getClass()))
                     recordedMsgs.add(msg0);
 
                 boolean block = false;
@@ -93,25 +93,32 @@ public class TestRecordingCommunicationSpi extends TcpCommunicationSpi {
     }
 
     /**
-     * @param recordCls Message class to record.
+     * @param recordClasses Message classes to record.
      */
-    public void record(@Nullable Class<?> recordCls) {
+    public void record(Class<?>... recordClasses) {
         synchronized (this) {
-            this.recordCls = recordCls;
+            if (this.recordClasses == null)
+                this.recordClasses = new HashSet<>();
+
+            Collections.addAll(this.recordClasses, recordClasses);
 
             recordedMsgs = new ArrayList<>();
         }
     }
 
     /**
+     * @param stopRecord Stop record flag.
      * @return Recorded messages.
      */
-    public List<Object> recordedMessages() {
+    public List<Object> recordedMessages(boolean stopRecord) {
         synchronized (this) {
             List<Object> msgs = recordedMsgs;
 
             recordedMsgs = new ArrayList<>();
 
+            if (stopRecord)
+                recordClasses = null;
+
             return msgs;
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
index f106fec..a35d5a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -94,7 +94,7 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
                 TestRecordingCommunicationSpi comm =
                     (TestRecordingCommunicationSpi)ignite(0).configuration().getCommunicationSpi();
 
-                Collection<GridNearLockRequest> reqs = (Collection)comm.recordedMessages();
+                Collection<GridNearLockRequest> reqs = (Collection)comm.recordedMessages(false);
 
                 assertEquals(1, reqs.size());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheReadFromBackupTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheReadFromBackupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheReadFromBackupTest.java
index 191ae24..2ccd950 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheReadFromBackupTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheReadFromBackupTest.java
@@ -123,7 +123,7 @@ public class IgniteCacheReadFromBackupTest extends GridCommonAbstractTest {
 
                     assertNull(cache.get(key));
 
-                    List<Object> msgs = spi.recordedMessages();
+                    List<Object> msgs = spi.recordedMessages(false);
 
                     assertEquals(1, msgs.size());
                 }
@@ -216,7 +216,7 @@ public class IgniteCacheReadFromBackupTest extends GridCommonAbstractTest {
 
                     assertNull(cache.get(key));
 
-                    List<Object> msgs = newNodeSpi.recordedMessages();
+                    List<Object> msgs = newNodeSpi.recordedMessages(false);
 
                     assertEquals(1, msgs.size());
 
@@ -304,7 +304,7 @@ public class IgniteCacheReadFromBackupTest extends GridCommonAbstractTest {
             TestRecordingCommunicationSpi spi =
                 (TestRecordingCommunicationSpi)ignite.configuration().getCommunicationSpi();
 
-            List<Object> msgs = spi.recordedMessages();
+            List<Object> msgs = spi.recordedMessages(false);
 
             assertEquals(0, msgs.size());
         }
@@ -330,14 +330,14 @@ public class IgniteCacheReadFromBackupTest extends GridCommonAbstractTest {
         if (nearKey != null) {
             assertNull(cache.get(nearKey));
 
-            msgs = spi.recordedMessages();
+            msgs = spi.recordedMessages(false);
 
             assertEquals(1, msgs.size());
         }
 
         assertNull(cache.get(backupKey));
 
-        msgs = spi.recordedMessages();
+        msgs = spi.recordedMessages(false);
 
         assertTrue(msgs.isEmpty());
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSingleGetMessageTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSingleGetMessageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSingleGetMessageTest.java
index 48fc961..08f44cc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSingleGetMessageTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSingleGetMessageTest.java
@@ -248,12 +248,12 @@ public class IgniteCacheSingleGetMessageTest extends GridCommonAbstractTest {
      * @param primarySpi Primary node SPI.
      */
     private void checkMessages(TestRecordingCommunicationSpi spi, TestRecordingCommunicationSpi primarySpi) {
-        List<Object> msgs = spi.recordedMessages();
+        List<Object> msgs = spi.recordedMessages(false);
 
         assertEquals(1, msgs.size());
         assertTrue(msgs.get(0) instanceof GridNearSingleGetRequest);
 
-        msgs = primarySpi.recordedMessages();
+        msgs = primarySpi.recordedMessages(false);
 
         assertEquals(1, msgs.size());
         assertTrue(msgs.get(0) instanceof GridNearSingleGetResponse);
@@ -264,10 +264,10 @@ public class IgniteCacheSingleGetMessageTest extends GridCommonAbstractTest {
      * @param primarySpi Primary node SPI.
      */
     private void checkNoMessages(TestRecordingCommunicationSpi spi, TestRecordingCommunicationSpi primarySpi) {
-        List<Object> msgs = spi.recordedMessages();
+        List<Object> msgs = spi.recordedMessages(false);
         assertEquals(0, msgs.size());
 
-        msgs = primarySpi.recordedMessages();
+        msgs = primarySpi.recordedMessages(false);
         assertEquals(0, msgs.size());
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
index e80d7d3..35e2ad4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
@@ -19,7 +19,9 @@ package org.apache.ignite.internal.processors.cache.distributed;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.Callable;
 import javax.cache.Cache;
 import javax.cache.configuration.Factory;
@@ -43,6 +45,9 @@ import org.apache.ignite.internal.managers.communication.GridIoMessage;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishRequest;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishRequest;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishResponse;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareRequest;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse;
 import org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.lang.IgnitePredicateX;
@@ -226,7 +231,7 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
 
         waitKeyUpdated(ignite, ccfg.getBackups() + 1, ccfg.getName(), key);
 
-        List<Object> msgs = commSpi0.recordedMessages();
+        List<Object> msgs = commSpi0.recordedMessages(true);
 
         assertEquals(ccfg.getBackups(), msgs.size());
 
@@ -478,7 +483,7 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
 
         waitKeyUpdated(ignite, ccfg.getBackups() + 1, ccfg.getName(), key);
 
-        List<Object> msgs = commSpiClient.recordedMessages();
+        List<Object> msgs = commSpiClient.recordedMessages(true);
 
         assertEquals(1, msgs.size());
 
@@ -486,7 +491,7 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
 
         assertEquals(PRIMARY_SYNC, req.syncMode());
 
-        msgs = commSpi0.recordedMessages();
+        msgs = commSpi0.recordedMessages(true);
 
         assertEquals(ccfg.getBackups(), msgs.size());
 
@@ -502,6 +507,247 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
+    public void testWaitPrimaryResponse() throws Exception {
+        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 1, true, false));
+
+        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 2, false, false));
+
+        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 2, false, true));
+
+        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 3, false, false));
+    }
+
+    /**
+     * @param ccfg Cache configuration.
+     * @throws Exception If failed.
+     */
+    private void checkWaitPrimaryResponse(CacheConfiguration<Object, Object> ccfg) throws Exception {
+        Ignite ignite = ignite(0);
+
+        IgniteCache<Object, Object> cache = ignite.createCache(ccfg);
+
+        try {
+            ignite(NODES - 1).createNearCache(ccfg.getName(), new NearCacheConfiguration<>());
+
+            for (int i = 1; i < NODES; i++) {
+                Ignite node = ignite(i);
+
+                log.info("Test node: " + node.name());
+
+                checkWaitPrimaryResponse(node, ccfg, new IgniteBiInClosure<Integer, IgniteCache<Object, Object>>() {
+                    @Override public void apply(Integer key, IgniteCache<Object, Object> cache) {
+                        cache.put(key, key);
+                    }
+                });
+
+                checkWaitPrimaryResponse(node, ccfg, new IgniteBiInClosure<Integer, IgniteCache<Object, Object>>() {
+                    @Override public void apply(Integer key, IgniteCache<Object, Object> cache) {
+                        Map<Integer, Integer> map = new HashMap<>();
+
+                        for (int i = 0; i < 50; i++)
+                            map.put(i, i);
+
+                        map.put(key, key);
+
+                        cache.putAll(map);
+                    }
+                });
+
+                for (final TransactionConcurrency concurrency : TransactionConcurrency.values()) {
+                    for (final TransactionIsolation isolation : TransactionIsolation.values()) {
+                        checkWaitPrimaryResponse(node, ccfg, new IgniteBiInClosure<Integer, IgniteCache<Object, Object>>() {
+                            @Override public void apply(Integer key, IgniteCache<Object, Object> cache) {
+                                Ignite ignite = cache.unwrap(Ignite.class);
+
+                                try (Transaction tx = ignite.transactions().txStart(concurrency, isolation)) {
+                                    cache.put(key, key);
+
+                                    tx.commit();
+                                }
+                            }
+                        });
+
+                        checkWaitPrimaryResponse(node, ccfg, new IgniteBiInClosure<Integer, IgniteCache<Object, Object>>() {
+                            @Override public void apply(Integer key, IgniteCache<Object, Object> cache) {
+                                Map<Integer, Integer> map = new HashMap<>();
+
+                                for (int i = 0; i < 50; i++)
+                                    map.put(i, i);
+
+                                map.put(key, key);
+
+                                Ignite ignite = cache.unwrap(Ignite.class);
+
+                                try (Transaction tx = ignite.transactions().txStart(concurrency, isolation)) {
+                                    cache.putAll(map);
+
+                                    tx.commit();
+                                }
+                            }
+                        });
+                    }
+                }
+            }
+        }
+        finally {
+            ignite.destroyCache(cache.getName());
+        }
+    }
+
+    /**
+     * @param client Node executing cache operation.
+     * @param ccfg Cache configuration.
+     * @param c Cache update closure.
+     * @throws Exception If failed.
+     */
+    private void checkWaitPrimaryResponse(
+        Ignite client,
+        final CacheConfiguration<Object, Object> ccfg,
+        final IgniteBiInClosure<Integer, IgniteCache<Object, Object>> c) throws Exception {
+        Ignite ignite = ignite(0);
+
+        assertNotSame(ignite, client);
+
+        TestRecordingCommunicationSpi commSpi0 =
+            (TestRecordingCommunicationSpi)ignite.configuration().getCommunicationSpi();
+
+        IgniteCache<Object, Object> cache = ignite.cache(ccfg.getName());
+
+        final Integer key = primaryKey(cache);
+
+        cache.remove(key);
+
+        waitKeyRemoved(ccfg.getName(), key);
+
+        final IgniteCache<Object, Object> clientCache = client.cache(ccfg.getName());
+
+        commSpi0.blockMessages(GridNearTxFinishResponse.class, client.name());
+
+        IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Void>() {
+            @Override public Void call() throws Exception {
+                c.apply(key, clientCache);
+
+                return null;
+            }
+        }, "tx-thread");
+
+        U.sleep(100);
+
+        assertFalse(fut.isDone());
+
+        commSpi0.stopBlock(true);
+
+        fut.get();
+
+        waitKeyUpdated(ignite, ccfg.getBackups() + 1, ccfg.getName(), key);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOnePhaseMessages() throws Exception {
+        checkOnePhaseMessages(cacheConfiguration(null, PRIMARY_SYNC, 1, false, false));
+    }
+
+    /**
+     * @param ccfg Cache configuration.
+     * @throws Exception If failed.
+     */
+    private void checkOnePhaseMessages(CacheConfiguration<Object, Object> ccfg) throws Exception {
+        Ignite ignite = ignite(0);
+
+        IgniteCache<Object, Object> cache = ignite.createCache(ccfg);
+
+        try {
+            for (int i = 1; i < NODES; i++) {
+                Ignite node = ignite(i);
+
+                log.info("Test node: " + node.name());
+
+                checkOnePhaseMessages(node, ccfg, new IgniteBiInClosure<Integer, IgniteCache<Object, Object>>() {
+                    @Override public void apply(Integer key, IgniteCache<Object, Object> cache) {
+                        cache.put(key, key);
+                    }
+                });
+
+                for (final TransactionConcurrency concurrency : TransactionConcurrency.values()) {
+                    for (final TransactionIsolation isolation : TransactionIsolation.values()) {
+                        checkOnePhaseMessages(node, ccfg, new IgniteBiInClosure<Integer, IgniteCache<Object, Object>>() {
+                            @Override public void apply(Integer key, IgniteCache<Object, Object> cache) {
+                                Ignite ignite = cache.unwrap(Ignite.class);
+
+                                try (Transaction tx = ignite.transactions().txStart(concurrency, isolation)) {
+                                    cache.put(key, key);
+
+                                    tx.commit();
+                                }
+                            }
+                        });
+                    }
+                }
+            }
+        }
+        finally {
+            ignite.destroyCache(cache.getName());
+        }
+    }
+
+    /**
+     * @param client Node executing cache operation.
+     * @param ccfg Cache configuration.
+     * @param c Cache update closure.
+     * @throws Exception If failed.
+     */
+    private void checkOnePhaseMessages(
+        Ignite client,
+        final CacheConfiguration<Object, Object> ccfg,
+        final IgniteBiInClosure<Integer, IgniteCache<Object, Object>> c) throws Exception {
+        Ignite ignite = ignite(0);
+
+        assertNotSame(ignite, client);
+
+        TestRecordingCommunicationSpi commSpiClient =
+            (TestRecordingCommunicationSpi)client.configuration().getCommunicationSpi();
+
+        TestRecordingCommunicationSpi commSpi0 =
+            (TestRecordingCommunicationSpi)ignite.configuration().getCommunicationSpi();
+
+        IgniteCache<Object, Object> cache = ignite.cache(ccfg.getName());
+
+        final Integer key = primaryKey(cache);
+
+        cache.remove(key);
+
+        waitKeyRemoved(ccfg.getName(), key);
+
+        final IgniteCache<Object, Object> clientCache = client.cache(ccfg.getName());
+
+        commSpi0.record(GridNearTxFinishResponse.class, GridNearTxPrepareResponse.class);
+        commSpiClient.record(GridNearTxPrepareRequest.class, GridNearTxFinishRequest.class);
+
+        c.apply(key, clientCache);
+
+        List<Object> srvMsgs = commSpi0.recordedMessages(true);
+
+        assertEquals("Unexpected messages: " + srvMsgs, 1, srvMsgs.size());
+        assertTrue("Unexpected message: " + srvMsgs.get(0), srvMsgs.get(0) instanceof GridNearTxPrepareResponse);
+
+        List<Object> clientMsgs = commSpiClient.recordedMessages(true);
+
+        assertEquals("Unexpected messages: " + clientMsgs, 1, clientMsgs.size());
+        assertTrue("Unexpected message: " + clientMsgs.get(0), clientMsgs.get(0) instanceof GridNearTxPrepareRequest);
+
+        GridNearTxPrepareRequest req = (GridNearTxPrepareRequest)clientMsgs.get(0);
+
+        assertTrue(req.onePhaseCommit());
+
+        for (Ignite ignite0 : G.allGrids())
+            assertEquals(key, ignite0.cache(cache.getName()).get(key));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testTxSyncMode() throws Exception {
         Ignite ignite = ignite(0);
 
@@ -811,6 +1057,7 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @param syncMode Write synchronization mode.
      * @param backups Number of backups.
      * @param store If {@code true} configures cache store.
+     * @param nearCache If {@code true} configures near cache.
      * @return Cache configuration.
      */
     private CacheConfiguration<Object, Object> cacheConfiguration(String name,

http://git-wip-us.apache.org/repos/asf/ignite/blob/48d31c09/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
index 0666349..277ffaf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
@@ -110,9 +110,9 @@ public class GridCacheDhtPreloadMessageCountTest extends GridCommonAbstractTest
         TestRecordingCommunicationSpi spi1 = (TestRecordingCommunicationSpi)g1.configuration().getCommunicationSpi();
         TestRecordingCommunicationSpi spi2 = (TestRecordingCommunicationSpi)g2.configuration().getCommunicationSpi();
 
-        info(spi0.recordedMessages().size() + " " +
-            spi1.recordedMessages().size() + " " +
-            spi2.recordedMessages().size());
+        info(spi0.recordedMessages(false).size() + " " +
+            spi1.recordedMessages(false).size() + " " +
+            spi2.recordedMessages(false).size());
 
         checkCache(c0, cnt);
         checkCache(c1, cnt);