ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/3] ignite git commit: ignite-4705
Date Sat, 04 Mar 2017 16:35:05 GMT
ignite-4705


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

Branch: refs/heads/ignite-4705-2
Commit: 46c71ae512edc39a364b0389b9057e9935517130
Parents: ff55b4d
Author: sboikov <sboikov@gridgain.com>
Authored: Sat Mar 4 12:46:53 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Sat Mar 4 19:33:17 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheIoManager.java    |  11 +-
 .../GridCachePartitionExchangeManager.java      |  85 +++++------
 .../GridDhtAtomicAbstractUpdateFuture.java      |  15 +-
 .../dht/atomic/GridDhtAtomicCache.java          | 140 ++++++++++---------
 .../atomic/GridDhtAtomicSingleUpdateFuture.java |   5 -
 .../GridDhtAtomicSingleUpdateRequest.java       |   6 +-
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |   5 -
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |   6 +-
 .../GridNearAtomicAbstractUpdateFuture.java     |  61 ++++++--
 .../GridNearAtomicAbstractUpdateRequest.java    |  14 +-
 .../GridNearAtomicCheckUpdateRequest.java       |   9 +-
 .../GridNearAtomicSingleUpdateFuture.java       |  34 ++---
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  76 +++++++---
 .../GridDhtPartitionsExchangeFuture.java        |   4 +-
 ...niteCacheClientNodeChangingTopologyTest.java |   5 +-
 15 files changed, 287 insertions(+), 189 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.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 9aec10d..ba2f86e 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
@@ -216,13 +216,13 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
             if (fut != null && !fut.isDone()) {
                 fut.listen(new CI1<IgniteInternalFuture<?>>() {
                     @Override public void apply(IgniteInternalFuture<?> t) {
-                        cctx.kernalContext().closure().runLocalSafe(new Runnable() {
+                        Runnable c = new Runnable() {
                             @Override public void run() {
                                 IgniteLogger log = cacheMsg.messageLogger(cctx);
 
                                 if (log.isDebugEnabled()) {
                                     StringBuilder msg0 = new StringBuilder("Process cache message after wait for " +
-                                        "affinity topology version [");
+                                            "affinity topology version [");
 
                                     appendMessageInfo(cacheMsg, nodeId, msg0).append(']');
 
@@ -231,7 +231,12 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
 
                                 handleMessage(nodeId, cacheMsg);
                             }
-                        });
+                        };
+
+                        if (((GridCacheMessage)msg).partition() >= 0)
+                            cctx.kernalContext().getStripedExecutorService().execute(((GridCacheMessage) msg).partition(), c);
+                        else
+                            cctx.kernalContext().closure().runLocalSafe(c);
                     }
                 });
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index e44f4a8..5a64758 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -62,6 +62,8 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridClientPar
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateFuture;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
@@ -79,6 +81,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
 import org.apache.ignite.internal.util.GridListSet;
+import org.apache.ignite.internal.util.StripedExecutor;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.IgnitePair;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -1477,68 +1480,70 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
      * @param exchTopVer Exchange topology version.
      */
     private void dumpPendingObjects(@Nullable AffinityTopologyVersion exchTopVer) {
-        IgniteTxManager tm = cctx.tm();
+        synchronized (getClass()) {
+            IgniteTxManager tm = cctx.tm();
 
-        if (tm != null) {
-            U.warn(log, "Pending transactions:");
+            if (tm != null) {
+                U.warn(log, "Pending transactions:");
 
-            for (IgniteInternalTx tx : tm.activeTransactions()) {
-                if (exchTopVer != null) {
-                    U.warn(log, ">>> [txVer=" + tx.topologyVersionSnapshot() +
-                        ", exchWait=" + tm.needWaitTransaction(tx, exchTopVer) +
-                        ", tx=" + tx + ']');
+                for (IgniteInternalTx tx : tm.activeTransactions()) {
+                    if (exchTopVer != null) {
+                        U.warn(log, ">>> [txVer=" + tx.topologyVersionSnapshot() +
+                                ", exchWait=" + tm.needWaitTransaction(tx, exchTopVer) +
+                                ", tx=" + tx + ']');
+                    }
+                    else
+                        U.warn(log, ">>> [txVer=" + tx.topologyVersionSnapshot() + ", tx=" + tx + ']');
                 }
-                else
-                    U.warn(log, ">>> [txVer=" + tx.topologyVersionSnapshot() + ", tx=" + tx + ']');
             }
-        }
 
-        GridCacheMvccManager mvcc = cctx.mvcc();
+            GridCacheMvccManager mvcc = cctx.mvcc();
 
-        if (mvcc != null) {
-            U.warn(log, "Pending explicit locks:");
+            if (mvcc != null) {
+                U.warn(log, "Pending explicit locks:");
 
-            for (GridCacheExplicitLockSpan lockSpan : mvcc.activeExplicitLocks())
-                U.warn(log, ">>> " + lockSpan);
+                for (GridCacheExplicitLockSpan lockSpan : mvcc.activeExplicitLocks())
+                    U.warn(log, ">>> " + lockSpan);
 
-            U.warn(log, "Pending cache futures:");
+                U.warn(log, "Pending cache futures:");
 
-            for (GridCacheFuture<?> fut : mvcc.activeFutures())
-                U.warn(log, ">>> " + fut);
+                for (GridCacheFuture<?> fut : mvcc.activeFutures())
+                    U.warn(log, ">>> " + fut);
 
-            U.warn(log, "Pending atomic cache futures:");
+                U.warn(log, "Pending atomic cache futures:");
 
-            for (GridCacheFuture<?> fut : mvcc.atomicFutures())
-                U.warn(log, ">>> " + fut);
+                for (GridCacheFuture<?> fut : mvcc.atomicFutures())
+                    U.warn(log, ">>> " + fut);
 
-            U.warn(log, "Pending data streamer futures:");
+                U.warn(log, "Pending data streamer futures:");
 
-            for (IgniteInternalFuture<?> fut : mvcc.dataStreamerFutures())
-                U.warn(log, ">>> " + fut);
+                for (IgniteInternalFuture<?> fut : mvcc.dataStreamerFutures())
+                    U.warn(log, ">>> " + fut);
 
-            if (tm != null) {
-                U.warn(log, "Pending transaction deadlock detection futures:");
+                if (tm != null) {
+                    U.warn(log, "Pending transaction deadlock detection futures:");
 
-                for (IgniteInternalFuture<?> fut : tm.deadlockDetectionFutures())
-                    U.warn(log, ">>> " + fut);
+                    for (IgniteInternalFuture<?> fut : tm.deadlockDetectionFutures())
+                        U.warn(log, ">>> " + fut);
+                }
             }
-        }
 
-        for (GridCacheContext ctx : cctx.cacheContexts()) {
-            if (ctx.isLocal())
-                continue;
+            for (GridCacheContext ctx : cctx.cacheContexts()) {
+                if (ctx.isLocal())
+                    continue;
 
-            GridCacheContext ctx0 = ctx.isNear() ? ctx.near().dht().context() : ctx;
+                GridCacheContext ctx0 = ctx.isNear() ? ctx.near().dht().context() : ctx;
 
-            GridCachePreloader preloader = ctx0.preloader();
+                GridCachePreloader preloader = ctx0.preloader();
 
-            if (preloader != null)
-                preloader.dumpDebugInfo();
+                if (preloader != null)
+                    preloader.dumpDebugInfo();
 
-            GridCacheAffinityManager affMgr = ctx0.affinity();
+                GridCacheAffinityManager affMgr = ctx0.affinity();
 
-            if (affMgr != null)
-                affMgr.dumpDebugInfo();
+                if (affMgr != null)
+                    affMgr.dumpDebugInfo();
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
index 5e01726..dcd4a18 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
@@ -43,6 +43,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheE
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -78,6 +79,7 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
     protected final GridCacheContext cctx;
 
     /** Future version. */
+    @GridToStringInclude
     protected final Long futId;
 
     /** Update request. */
@@ -94,9 +96,11 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
     private volatile int resCnt;
 
     /** */
+    @GridToStringExclude
     private final GridNearAtomicUpdateResponse updateRes;
 
     /** */
+    @GridToStringExclude
     private final GridDhtAtomicCache.UpdateReplyClosure completionCb;
 
     /**
@@ -368,9 +372,10 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
 
         boolean needReplyToNear = updateReq.writeSynchronizationMode() == PRIMARY_SYNC ||
             !ret.emptyResult() ||
-            updateRes.nearVersion() != null;
+            updateRes.nearVersion() != null ||
+            cctx.localNodeId().equals(nearNode.id());
 
-        boolean needMapping = updateReq.fullSync() && (!updateReq.mappingKnown() || !allUpdated());
+        boolean needMapping = updateReq.fullSync() && (!updateReq.needPrimaryResponse() || !allUpdated());
 
         if (needMapping) {
             initMapping(updateRes);
@@ -470,12 +475,6 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
     }
 
     /**
-     * @param updateRes Response.
-     * @param err Error.
-     */
-    protected abstract void addFailedKeys(GridNearAtomicUpdateResponse updateRes, Throwable err);
-
-    /**
      * @param nodeId Node ID.
      * @param futId Future ID.
      * @param writeVer Update version.

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
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 fc0e16c..5cd07b1 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
@@ -3078,7 +3078,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param checkReq Request.
      */
     private void processCheckUpdateRequest(UUID nodeId, GridNearAtomicCheckUpdateRequest checkReq) {
-        /**
+        /*
          * Message is processed in the same stripe, so primary already processed update request. It is possible
          * response was not sent if operation result was empty. Near node will get original response or this one.
          */
@@ -3104,6 +3104,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param req Dht atomic update request.
      */
     private void processDhtAtomicUpdateRequest(UUID nodeId, GridDhtAtomicAbstractUpdateRequest req) {
+        assert Thread.currentThread().getName().startsWith("sys-stripe-") : Thread.currentThread().getName();
+
         if (msgLog.isDebugEnabled()) {
             msgLog.debug("Received DHT atomic update request [futId=" + req.futureId() +
                 ", writeVer=" + req.writeVersion() + ", node=" + nodeId + ']');
@@ -3272,66 +3274,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     }
 
     /**
-     *
-     */
-    private class DeferredUpdateTimeout implements GridTimeoutObject, Runnable {
-        /** */
-        private final int part;
-
-        /** */
-        private final UUID primaryId;
-
-        /** */
-        private final IgniteUuid id;
-
-        /** */
-        private final long endTime;
-
-        /**
-         * @param part Partition.
-         * @param primaryId Primary ID.
-         */
-        DeferredUpdateTimeout(int part, UUID primaryId) {
-            this.part = part;
-            this.primaryId = primaryId;
-
-            endTime = U.currentTimeMillis() + DEFERRED_UPDATE_RESPONSE_TIMEOUT;
-
-            id = IgniteUuid.fromUuid(primaryId);
-        }
-
-        /** {@inheritDoc} */
-        @Override public IgniteUuid timeoutId() {
-            return id;
-        }
-
-        /** {@inheritDoc} */
-        @Override public long endTime() {
-            return endTime;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void run() {
-            Map<UUID, GridDhtAtomicDeferredUpdateResponse> resMap = defRes.get();
-
-            GridDhtAtomicDeferredUpdateResponse msg = resMap.get(primaryId);
-
-            if (msg != null && msg.timeoutSender() == this) {
-                msg.timeoutSender(null);
-
-                resMap.remove(primaryId);
-
-                sendDeferredUpdateResponse(primaryId, msg);
-            }
-        }
-
-        /** {@inheritDoc} */
-        @Override public void onTimeout() {
-            ctx.kernalContext().getStripedExecutorService().execute(part, this);
-        }
-    }
-
-    /**
      * @param part Partition.
      * @param primaryId Primary ID.
      * @param futId Future ID.
@@ -3362,7 +3304,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
 
         futIds.add(futId);
 
-        if (futIds.size() == DEFERRED_UPDATE_RESPONSE_BUFFER_SIZE) {
+        if (futIds.size() >= DEFERRED_UPDATE_RESPONSE_BUFFER_SIZE) {
             resMap.remove(primaryId);
 
             sendDeferredUpdateResponse(primaryId, msg);
@@ -3375,14 +3317,14 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      */
     private void sendDeferredUpdateResponse(UUID primaryId, GridDhtAtomicDeferredUpdateResponse msg) {
         try {
-            ctx.kernalContext().gateway().readLock();
+            //ctx.kernalContext().gateway().readLock();
 
-            GridTimeoutObject timeoutSnd = msg.timeoutSender();
+            try {
+                GridTimeoutObject timeoutSnd = msg.timeoutSender();
 
-            if (timeoutSnd != null)
-                ctx.time().removeTimeoutObject(timeoutSnd);
+                if (timeoutSnd != null)
+                    ctx.time().removeTimeoutObject(timeoutSnd);
 
-            try {
                 ctx.io().send(primaryId, msg, ctx.ioPolicy());
 
                 if (msgLog.isDebugEnabled()) {
@@ -3391,7 +3333,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                 }
             }
             finally {
-                ctx.kernalContext().gateway().readUnlock();
+               // ctx.kernalContext().gateway().readUnlock();
             }
         }
         catch (IllegalStateException ignored) {
@@ -3706,7 +3648,67 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /**
      *
      */
-    static interface UpdateReplyClosure extends CI2<GridNearAtomicAbstractUpdateRequest, GridNearAtomicUpdateResponse> {
+    interface UpdateReplyClosure extends CI2<GridNearAtomicAbstractUpdateRequest, GridNearAtomicUpdateResponse> {
         // No-op.
     }
+
+    /**
+     *
+     */
+    private class DeferredUpdateTimeout implements GridTimeoutObject, Runnable {
+        /** */
+        private final int part;
+
+        /** */
+        private final UUID primaryId;
+
+        /** */
+        private final IgniteUuid id;
+
+        /** */
+        private final long endTime;
+
+        /**
+         * @param part Partition.
+         * @param primaryId Primary ID.
+         */
+        DeferredUpdateTimeout(int part, UUID primaryId) {
+            this.part = part;
+            this.primaryId = primaryId;
+
+            endTime = U.currentTimeMillis() + DEFERRED_UPDATE_RESPONSE_TIMEOUT;
+
+            id = IgniteUuid.fromUuid(primaryId);
+        }
+
+        /** {@inheritDoc} */
+        @Override public IgniteUuid timeoutId() {
+            return id;
+        }
+
+        /** {@inheritDoc} */
+        @Override public long endTime() {
+            return endTime;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void run() {
+            Map<UUID, GridDhtAtomicDeferredUpdateResponse> resMap = defRes.get();
+
+            GridDhtAtomicDeferredUpdateResponse msg = resMap.get(primaryId);
+
+            if (msg != null && msg.timeoutSender() == this) {
+                msg.timeoutSender(null);
+
+                resMap.remove(primaryId);
+
+                sendDeferredUpdateResponse(primaryId, msg);
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onTimeout() {
+            ctx.kernalContext().getStripedExecutorService().execute(part, this);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
index 0566ce4..879dd40 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
@@ -120,11 +120,6 @@ class GridDhtAtomicSingleUpdateFuture extends GridDhtAtomicAbstractUpdateFuture
         }
     }
 
-    /** {@inheritDoc} */
-    @Override protected void addFailedKeys(GridNearAtomicUpdateResponse updateRes, Throwable err) {
-
-    }
-
     /**
      * @param ttl TTL.
      * @param conflictExpireTime Conflict expire time.

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
index 10dc77c..092bccb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
@@ -197,7 +197,11 @@ public class GridDhtAtomicSingleUpdateRequest extends GridDhtAtomicAbstractUpdat
 
     /** {@inheritDoc} */
     @Override public int partition() {
-        return key.partition();
+        int p = key.partition();
+
+        assert p >= 0;
+
+        return p;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 49e168a..32df24d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -103,11 +103,6 @@ class GridDhtAtomicUpdateFuture extends GridDhtAtomicAbstractUpdateFuture {
     }
 
     /** {@inheritDoc} */
-    @Override protected void addFailedKeys(GridNearAtomicUpdateResponse updateRes, Throwable err) {
-
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridDhtAtomicUpdateFuture.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 78368fb..6b8af8d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -427,7 +427,11 @@ public class GridDhtAtomicUpdateRequest extends GridDhtAtomicAbstractUpdateReque
     @Override public int partition() {
         assert !F.isEmpty(keys) || !F.isEmpty(nearKeys);
 
-        return keys.size() > 0 ? keys.get(0).partition() : nearKeys.get(0).partition();
+        int p = keys.size() > 0 ? keys.get(0).partition() : nearKeys.get(0).partition();
+
+        assert p >= 0;
+
+        return p;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
index 5369d53..bb1e224 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
@@ -31,6 +31,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
@@ -205,8 +206,21 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
         this.remapCnt = remapCnt;
     }
 
-    void sendCheckUpdateRequest(GridNearAtomicCheckUpdateRequest req) {
+    /** {@inheritDoc} */
+    @Override public final IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
+        return null;
+    }
 
+    void sendCheckUpdateRequest(GridNearAtomicCheckUpdateRequest req) {
+        try {
+            cctx.io().send(req.updateRequest().nodeId(), req, cctx.ioPolicy());
+        }
+        catch (ClusterTopologyCheckedException e) {
+            onSendError(req, e);
+        }
+        catch (IgniteCheckedException e) {
+            onDone(e);
+        }
     }
 
     /**
@@ -370,6 +384,17 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
         onPrimaryResponse(req.nodeId(), res, true);
     }
 
+    final void onSendError(GridNearAtomicCheckUpdateRequest req, IgniteCheckedException e) {
+        GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
+                req.updateRequest().nodeId(),
+                req.futureId(),
+                cctx.deploymentEnabled());
+
+        res.addFailedKeys(req.updateRequest().keys(), e);
+
+        onPrimaryResponse(req.updateRequest().nodeId(), res, true);
+    }
+
     /**
      *
      */
@@ -381,7 +406,11 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
         @GridToStringInclude
         private Set<UUID> dhtNodes;
 
+        @GridToStringInclude
+        private List<UUID> dhtNodes0;
+
         /** */
+        @GridToStringInclude
         private Set<UUID> rcvd;
 
         /** */
@@ -396,6 +425,11 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
             this.req = req;
 
             if (req.initMappingLocally()) {
+                dhtNodes0 = new ArrayList<>();
+
+                for (ClusterNode n : nodes)
+                    dhtNodes0.add(n.id());
+
                 if (single) {
                     if (nodes.size() > 1) {
                         dhtNodes = U.newHashSet(nodes.size() - 1);
@@ -424,13 +458,16 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
 
             for (int i = 1; i < nodes.size(); i++)
                 dhtNodes.add(nodes.get(i).id());
+
+            for (int i = 1; i < nodes.size(); i++)
+                dhtNodes0.add(nodes.get(i).id());
         }
 
-        boolean checkDhtNodes(GridCacheContext cctx) {
+        DhtLeftResult checkDhtNodes(GridCacheContext cctx) {
             assert req.initMappingLocally() : req;
 
             if (finished())
-                return false;
+                return DhtLeftResult.NOT_DONE;
 
             boolean finished = false;
 
@@ -448,7 +485,13 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
                 }
             }
 
-            return finished;
+            if (finished)
+                return DhtLeftResult.DONE;
+
+            if (dhtNodes.isEmpty())
+                return req.needPrimaryResponse() ? DhtLeftResult.ALL_RCVD_CHECK_PRIMARY : DhtLeftResult.NOT_DONE;
+
+            return DhtLeftResult.NOT_DONE;
         }
 
         /**
@@ -487,7 +530,7 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
                 if (hasRes)
                     return DhtLeftResult.DONE;
                 else
-                    return req.mappingKnown() ? DhtLeftResult.ALL_RCVD_CHECK_UPDATE : DhtLeftResult.NOT_DONE;
+                    return req.needPrimaryResponse() ? DhtLeftResult.ALL_RCVD_CHECK_PRIMARY : DhtLeftResult.NOT_DONE;
             }
 
             return DhtLeftResult.NOT_DONE;
@@ -572,8 +615,10 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
         /** {@inheritDoc} */
         @Override public String toString() {
             return S.toString(PrimaryRequestState.class, this,
-                "node", req.nodeId(),
-                "rcvdRes", req.response() != null);
+                "primary", primaryId(),
+                "mapppingKnown", req.needPrimaryResponse(),
+                "primaryRes", req.response() != null,
+                "done", finished());
         }
     }
 
@@ -588,7 +633,7 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
         NOT_DONE,
 
         /** */
-        ALL_RCVD_CHECK_UPDATE
+        ALL_RCVD_CHECK_PRIMARY
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
index a833588..34a3c0b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
@@ -47,7 +47,7 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
     public static final int CACHE_MSG_IDX = nextIndexId();
 
     /** . */
-    private static final int MAPPING_KNOWN_FLAG_MASK = 0x01;
+    private static final int NEED_PRIMARY_RES_FLAG_MASK = 0x01;
 
     /** Topology locked flag. Set if atomic update is performed inside TX or explicit lock. */
     private static final int TOP_LOCKED_FLAG_MASK = 0x02;
@@ -141,7 +141,7 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
         this.addDepInfo = addDepInfo;
 
         if (mappingKnown)
-            mappingKnown(true);
+            needPrimaryResponse(true);
 
         if (topLocked)
             topologyLocked(true);
@@ -177,11 +177,11 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
     }
 
     boolean initMappingLocally() {
-        return mappingKnown() && fullSync();
+        return needPrimaryResponse() && fullSync();
     }
 
-    boolean mappingKnown() {
-        return isFlag(MAPPING_KNOWN_FLAG_MASK);
+    boolean needPrimaryResponse() {
+        return isFlag(NEED_PRIMARY_RES_FLAG_MASK);
     }
 
     boolean fullSync() {
@@ -190,8 +190,8 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
         return syncMode == CacheWriteSynchronizationMode.FULL_SYNC;
     }
 
-    void mappingKnown(boolean stableTop) {
-        setFlag(stableTop, MAPPING_KNOWN_FLAG_MASK);
+    void needPrimaryResponse(boolean stableTop) {
+        setFlag(stableTop, NEED_PRIMARY_RES_FLAG_MASK);
     }
 
     public int taskNameHash() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
index 030abdf..a30269b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
@@ -51,14 +51,13 @@ public class GridNearAtomicCheckUpdateRequest extends GridCacheMessage {
         // No-op.
     }
 
-    GridNearAtomicCheckUpdateRequest(int cacheId, GridNearAtomicAbstractUpdateRequest updateReq, int partId, long futId) {
+    GridNearAtomicCheckUpdateRequest(GridNearAtomicAbstractUpdateRequest updateReq) {
         assert updateReq != null;
-        assert partId >= 0 : partId;
 
-        this.cacheId = cacheId;
         this.updateReq = updateReq;
-        this.partId = partId;
-        this.futId = futId;
+        this.cacheId = updateReq.cacheId();
+        this.partId = updateReq.partition();
+        this.futId = updateReq.futureId();
     }
 
     long futureId() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
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 82d397d..f96de31 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
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
 
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -164,11 +162,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
                 if (res == DhtLeftResult.DONE)
                     rcvAll = true;
-                else if (res == DhtLeftResult.ALL_RCVD_CHECK_UPDATE) {
-                    checkReq = new GridNearAtomicCheckUpdateRequest(cctx.cacheId(),
-                        reqState.req,
-                        reqState.req.partition(),
-                        futId);
+                else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY) {
+                    checkReq = new GridNearAtomicCheckUpdateRequest(reqState.req);
                 }
                 else
                     return false;
@@ -190,11 +185,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
     @SuppressWarnings("ConstantConditions")
     @Override public boolean onDone(@Nullable Object res, @Nullable Throwable err) {
         assert res == null || res instanceof GridCacheReturn;
@@ -529,9 +519,11 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
      * @return
      */
     private boolean checkDhtNodes(Long futId) {
-        GridCacheReturn opRes0;
-        CachePartialUpdateCheckedException err0;
-        AffinityTopologyVersion remapTopVer0;
+        GridCacheReturn opRes0 = null;
+        CachePartialUpdateCheckedException err0 = null;
+        AffinityTopologyVersion remapTopVer0 = null;
+
+        GridNearAtomicCheckUpdateRequest checkReq = null;
 
         synchronized (mux) {
             if (this.futId == null || !this.futId.equals(futId))
@@ -539,16 +531,24 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
             assert reqState != null;
 
-            if (reqState.checkDhtNodes(cctx)) {
+            DhtLeftResult res = reqState.checkDhtNodes(cctx);
+
+            if (res == DhtLeftResult.DONE) {
                 opRes0 = opRes;
                 err0 = err;
                 remapTopVer0 = onAllReceived();
             }
+            else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY){
+                checkReq = new GridNearAtomicCheckUpdateRequest(reqState.req);
+            }
             else
                 return true;
         }
 
-        finishUpdateFuture(opRes0, err0, remapTopVer0);
+        if (checkReq != null)
+            sendCheckUpdateRequest(checkReq);
+        else
+            finishUpdateFuture(opRes0, err0, remapTopVer0);
 
         return false;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 7b1c530..77ba579 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
@@ -164,6 +164,8 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
 
         boolean rcvAll = false;
 
+        List<GridNearAtomicCheckUpdateRequest> checkReqs = null;
+
         synchronized (mux) {
             if (futId == null)
                 return false;
@@ -173,6 +175,8 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
                     GridNearAtomicAbstractUpdateRequest req = singleReq.processPrimaryResponse(nodeId);
 
                     if (req != null) {
+                        rcvAll = true;
+
                         GridNearAtomicUpdateResponse res = primaryFailedResponse(req);
 
                         singleReq.onPrimaryResponse(res, cctx);
@@ -181,7 +185,12 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
                     }
                 }
                 else {
-                    singleReq.onDhtNodeLeft(nodeId);
+                    DhtLeftResult res = singleReq.onDhtNodeLeft(nodeId);
+
+                    if (res == DhtLeftResult.DONE)
+                        rcvAll = true;
+                    else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY)
+                        checkReqs = Collections.singletonList(new GridNearAtomicCheckUpdateRequest(singleReq.req));
                 }
 
                 if (rcvAll) {
@@ -215,7 +224,16 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
                         }
                     }
                     else {
-                        reqState.onDhtNodeLeft(nodeId);
+                        DhtLeftResult res = reqState.onDhtNodeLeft(nodeId);
+
+                        if (res == DhtLeftResult.DONE)
+                            reqDone = true;
+                        else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY) {
+                            if (checkReqs == null)
+                                checkReqs = new ArrayList<>();
+
+                            checkReqs.add(new GridNearAtomicCheckUpdateRequest(reqState.req));
+                        }
                     }
 
                     if (reqDone) {
@@ -237,18 +255,19 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
             }
         }
 
-        if (rcvAll)
+        if (checkReqs != null) {
+            assert !rcvAll;
+
+            for (int i = 0; i < checkReqs.size(); i++)
+                sendCheckUpdateRequest(checkReqs.get(i));
+        }
+        else if (rcvAll)
             finishUpdateFuture(opRes0, err0, remapTopVer0);
 
         return false;
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
     @SuppressWarnings("ConstantConditions")
     @Override public boolean onDone(@Nullable Object res, @Nullable Throwable err) {
         assert res == null || res instanceof GridCacheReturn;
@@ -824,25 +843,33 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
         CachePartialUpdateCheckedException err0 = null;
         AffinityTopologyVersion remapTopVer0 = null;
 
+        List<GridNearAtomicCheckUpdateRequest> checkReqs = null;
+
+        boolean rcvAll = false;
+
         synchronized (mux) {
             if (this.futId == null || !this.futId.equals(futId))
                 return false;
 
             if (singleReq != null) {
-                if (singleReq.checkDhtNodes(cctx)) {
+                DhtLeftResult res = singleReq.checkDhtNodes(cctx);
+
+                if (res == DhtLeftResult.DONE) {
                     opRes0 = opRes;
                     err0 = err;
                     remapTopVer0 = onAllReceived();
                 }
+                else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY)
+                    checkReqs = Collections.singletonList(new GridNearAtomicCheckUpdateRequest(singleReq.req));
                 else
                     return true;
             }
             else {
                 if (mappings != null) {
-                    boolean rcvAll = false;
-
                     for (PrimaryRequestState reqState : mappings.values()) {
-                        if (reqState.checkDhtNodes(cctx)) {
+                        DhtLeftResult res = reqState.checkDhtNodes(cctx);
+
+                        if (res == DhtLeftResult.DONE) {
                             assert mappings.size() > resCnt : "[mappings=" + mappings.size() + ", cnt=" + resCnt + ']';
 
                             resCnt++;
@@ -857,19 +884,34 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
                                 break;
                             }
                         }
-                    }
+                        else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY) {
+                            if (checkReqs == null)
+                                checkReqs = new ArrayList<>(mappings.size());
 
-                    if (!rcvAll)
-                        return true;
+                            checkReqs.add(new GridNearAtomicCheckUpdateRequest(reqState.req));
+                        }
+                    }
                 }
                 else
                     return true;
             }
         }
 
-        finishUpdateFuture(opRes0, err0, remapTopVer0);
+        if (checkReqs != null) {
+            assert !rcvAll;
 
-        return false;
+            for (int i = 0; i < checkReqs.size(); i++)
+                sendCheckUpdateRequest(checkReqs.get(i));
+
+            return false;
+        }
+        else if (rcvAll) {
+            finishUpdateFuture(opRes0, err0, remapTopVer0);
+
+            return false;
+        }
+
+        return true;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index a334fd5..34b8540 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -783,7 +783,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
             catch (IgniteFutureTimeoutCheckedException ignored) {
                 // Print pending transactions and locks that might have led to hang.
                 if (dumpedObjects < DUMP_PENDING_OBJECTS_THRESHOLD) {
-                    dumpPendingObjects();
+                    synchronized (getClass()) {
+                        dumpPendingObjects();
+                    }
 
                     dumpedObjects++;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/46c71ae5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
index 081e49f..222620a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
@@ -1750,7 +1750,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
         for (int i = 0; i < SRV_CNT; i++)
             startGrid(i);
 
-        final int CLIENT_CNT = 4;
+        final int CLIENT_CNT = 1;
 
         final List<Ignite> clients = new ArrayList<>();
 
@@ -1768,7 +1768,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
 
         final AtomicInteger threadIdx = new AtomicInteger(0);
 
-        final int THREADS = CLIENT_CNT * 3;
+        final int THREADS = CLIENT_CNT * 1;
 
         final ConcurrentHashSet<Integer> putKeys = new ConcurrentHashSet<>();
 
@@ -1834,6 +1834,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
                                     }
                                 }
                                 else
+                                    //cache.put(map.keySet().iterator().next(), map.values().iterator().next());
                                     cache.putAll(map);
 
                                 putKeys.addAll(map.keySet());


Mime
View raw message