ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-4705
Date Mon, 06 Mar 2017 13:07:44 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4705-2 4f14c7918 -> 25f2cedc2


ignite-4705


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

Branch: refs/heads/ignite-4705-2
Commit: 25f2cedc2c0f083117982930739dc461a1033b83
Parents: 4f14c79
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Mar 6 15:14:44 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Mar 6 16:06:57 2017 +0300

----------------------------------------------------------------------
 .../GridNearAtomicSingleUpdateFuture.java       | 17 ++++++++--------
 .../dht/atomic/GridNearAtomicUpdateFuture.java  | 21 ++++++++------------
 .../atomic/IgniteCacheAtomicProtocolTest.java   |  7 +++++++
 3 files changed, 24 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/25f2cedc/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 6b878ab..cb013f7 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
@@ -163,9 +163,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
                 if (res == DhtLeftResult.DONE)
                     rcvAll = true;
-                else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY) {
+                else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY)
                     checkReq = new GridNearAtomicCheckUpdateRequest(reqState.req);
-                }
                 else
                     return false;
             }
@@ -329,6 +328,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
     }
 
     private AffinityTopologyVersion onAllReceived() {
+        assert futId != null;
+
         AffinityTopologyVersion remapTopVer0 = null;
 
         if (remapTopVer == null) {
@@ -706,18 +707,18 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
     private void finishUpdateFuture(GridCacheReturn opRes,
         CachePartialUpdateCheckedException err,
         @Nullable AffinityTopologyVersion remapTopVer) {
-        if (nearEnabled) {
-            assert reqState.req.response() != null;
-
-            updateNear(reqState.req, reqState.req.response());
-        }
-
         if (remapTopVer != null) {
             waitAndRemap(remapTopVer);
 
             return;
         }
 
+        if (nearEnabled) {
+            assert reqState.req.response() != null;
+
+            updateNear(reqState.req, reqState.req.response());
+        }
+
         onDone(opRes, err);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/25f2cedc/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 f35b7bb..60caa14 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
@@ -534,6 +534,8 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
      * @return Non null topology version if update should be remapped.
      */
     @Nullable private AffinityTopologyVersion onAllReceived() {
+        assert futId != null;
+
         AffinityTopologyVersion remapTopVer0 = null;
 
         if (remapKeys != null) {
@@ -854,7 +856,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
             checkDhtNodes(futId);
     }
 
-    private boolean checkDhtNodes(Long futId) {
+    private void checkDhtNodes(Long futId) {
         GridCacheReturn opRes0 = null;
         CachePartialUpdateCheckedException err0 = null;
         AffinityTopologyVersion remapTopVer0 = null;
@@ -865,11 +867,11 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
 
         synchronized (mux) {
             if (this.futId == null || !this.futId.equals(futId))
-                return false;
+                return;
 
             if (singleReq != null) {
                 if (!singleReq.req.initMappingLocally())
-                    return true;
+                    return;
 
                 DhtLeftResult res = singleReq.checkDhtNodes(cctx);
 
@@ -881,7 +883,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
                 else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY)
                     checkReqs = Collections.singletonList(new GridNearAtomicCheckUpdateRequest(singleReq.req));
                 else
-                    return true;
+                    return;
             }
             else {
                 if (mappings != null) {
@@ -915,7 +917,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
                     }
                 }
                 else
-                    return true;
+                    return;
             }
         }
 
@@ -924,16 +926,9 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
 
             for (int i = 0; i < checkReqs.size(); i++)
                 sendCheckUpdateRequest(checkReqs.get(i));
-
-            return false;
         }
-        else if (rcvAll) {
+        else if (rcvAll)
             finishUpdateFuture(opRes0, err0, remapTopVer0);
-
-            return false;
-        }
-
-        return true;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/25f2cedc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
index d745ba9..075be0e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
@@ -470,6 +470,13 @@ public class IgniteCacheAtomicProtocolTest extends GridCommonAbstractTest
{
     /**
      * @throws Exception If failed.
      */
+    public void testPutAllRemapAndPrimaryFailed() throws Exception {
+        // TODO IGNITE-4705.
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testPutNearNodeFailure() throws Exception {
         startGrids(2);
 


Mime
View raw message