You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by yz...@apache.org on 2015/05/27 18:13:43 UTC

[24/50] [abbrv] incubator-ignite git commit: # ignite-23

# ignite-23


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

Branch: refs/heads/ignite-943
Commit: 913b0efabb7922b74adb42b32d3c8674bec7faeb
Parents: 8980b61
Author: sboikov <sb...@gridgain.com>
Authored: Mon May 25 17:38:58 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon May 25 17:38:58 2015 +0300

----------------------------------------------------------------------
 .../GridDhtPartitionsExchangeFuture.java        |  4 --
 ...niteCacheClientNodeChangingTopologyTest.java | 58 ++++++++++++++++++++
 2 files changed, 58 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/913b0efa/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 a4cdfcd..2ff445f 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
@@ -497,10 +497,6 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
                             GridDhtPartitionTopology top = cacheCtx.topology();
 
-                            GridDhtPartitionMap parts = top.partitions(node.id());
-
-                            assert parts == null || parts.size() == 0 : parts;
-
                             top.updateTopologyVersion(exchId, this, -1, stopping(cacheCtx.cacheId()));
                         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/913b0efa/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 1de78aa..b067797 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
@@ -1249,6 +1249,64 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testServersLeaveOnStart() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setBackups(1);
+        ccfg.setAtomicityMode(ATOMIC);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setRebalanceMode(SYNC);
+
+        Ignite ignite0 = startGrid(0);
+
+        client = true;
+
+        final AtomicInteger nodeIdx = new AtomicInteger(2);
+
+        final int CLIENTS = 10;
+
+        IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
+            @Override public Void call() throws Exception {
+                int idx = nodeIdx.getAndIncrement();
+
+                startGrid(idx);
+
+                return null;
+            }
+        }, CLIENTS, "start-client");
+
+        ignite0.close();
+
+        fut.get();
+
+        for (int i = 0; i < CLIENTS; i++) {
+            Ignite ignite = grid(i + 2);
+
+            assertEquals(CLIENTS, ignite.cluster().nodes().size());
+        }
+
+        client = false;
+
+        startGrid(0);
+        startGrid(1);
+
+        awaitPartitionMapExchange();
+
+        for (int i = 0; i < CLIENTS; i++) {
+            Ignite ignite = grid(i + 2);
+
+            IgniteCache<Integer, Integer> cache = ignite.cache(null);
+
+            cache.put(i, i);
+
+            assertEquals((Object)i, cache.get(i));
+        }
+    }
+
+    /**
      *
      */
     private static class TestCommunicationSpi extends TcpCommunicationSpi {