ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [17/42] incubator-ignite git commit: ignite-746 race in GridDhtAtomicUpdateFuture mapping and onNodeLeft
Date Mon, 20 Apr 2015 06:43:39 GMT
ignite-746 race in GridDhtAtomicUpdateFuture mapping and onNodeLeft


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

Branch: refs/heads/ignite-gg-9613
Commit: fba8396c15cd9eab888459ac15eefac9f8fbf98b
Parents: 80b1e05
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Apr 16 12:42:34 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Apr 16 12:42:34 2015 +0300

----------------------------------------------------------------------
 .../distributed/dht/atomic/GridDhtAtomicCache.java    | 10 ++++------
 ...idCacheAtomicInvalidPartitionHandlingSelfTest.java | 14 +++++++++-----
 2 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fba8396c/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 ce90f82..d23d55e 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
@@ -1126,6 +1126,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                             retVal = new GridCacheReturn(ctx, node.isLocal(), null, true);
 
                         res.returnValue(retVal);
+
+                        if (dhtFut != null)
+                            ctx.mvcc().addAtomicFuture(dhtFut.version(), dhtFut);
                     }
                     else
                         // Should remap all keys.
@@ -2333,12 +2336,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             }
         }
 
-        GridDhtAtomicUpdateFuture fut = new GridDhtAtomicUpdateFuture(ctx, completionCb,
writeVer, updateReq,
-            updateRes);
-
-        ctx.mvcc().addAtomicFuture(fut.version(), fut);
-
-        return fut;
+        return new GridDhtAtomicUpdateFuture(ctx, completionCb, writeVer, updateReq, updateRes);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fba8396c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 1f63214..a68423b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -173,13 +173,17 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends
GridCommonA
 
             final Set<Integer> keys = new LinkedHashSet<>();
 
-            for (int i = 0; i < range; i++) {
-                cache.put(i, 0);
+            try (IgniteDataStreamer<Integer, Integer> streamer = grid(0).dataStreamer(null))
{
+                streamer.allowOverwrite(true);
 
-                keys.add(i);
+                for (int i = 0; i < range; i++) {
+                    streamer.addData(i, 0);
 
-                if (i > 0 && i % 10_000 == 0)
-                    System.err.println("Put: " + i);
+                    keys.add(i);
+
+                    if (i > 0 && i % 10_000 == 0)
+                        System.err.println("Put: " + i);
+                }
             }
 
             final Affinity<Integer> aff = grid(0).affinity(null);


Mime
View raw message