ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [4/4] ignite git commit: ignite-5578
Date Thu, 03 Aug 2017 12:55:44 GMT
ignite-5578


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

Branch: refs/heads/ignite-5578
Commit: d4030225aa813052dd63c2d78428fb3ab077873c
Parents: e3ecc16
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Aug 3 15:55:31 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Aug 3 15:55:31 2017 +0300

----------------------------------------------------------------------
 .../GridDhtPartitionsExchangeFuture.java        | 54 ++++++++++++--------
 .../distributed/CacheExchangeMergeTest.java     | 19 +++++++
 2 files changed, 51 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d4030225/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 3d7749b..b43fe92 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
@@ -175,8 +175,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
     private AtomicReference<GridCacheVersion> lastVer = new AtomicReference<>();
 
     /**
-     * Message received from node joining cluster, needed if this join exchange
-     * is merged with previous one.
+     * Message received from node joining cluster (if this is 'node join' exchange),
+     * needed if this exchange is merged with another one.
      */
     @GridToStringExclude
     private GridDhtPartitionsSingleMessage pendingJoinMsg;
@@ -2877,6 +2877,9 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
         initFut.onDone(true);
     }
 
+    /**
+     *
+     */
     private void onAllServersLeft() {
         assert cctx.kernalContext().clientNode() : cctx.localNode();
 
@@ -3235,20 +3238,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
         return exchId.hashCode();
     }
 
-    /**
-     *
-     */
-    enum ExchangeType {
-        /** */
-        CLIENT,
-
-        /** */
-        ALL,
-
-        /** */
-        NONE
-    }
-
     /** {@inheritDoc} */
     @Override public void addDiagnosticRequest(IgniteDiagnosticPrepareContext diagCtx) {
         if (!isDone()) {
@@ -3376,18 +3365,39 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
     /**
      *
      */
-    private enum ExchangeLocalState {
+    enum ExchangeType {
         /** */
-        CRD,
+        CLIENT,
+
         /** */
-        SRV,
+        ALL,
+
         /** */
+        NONE
+    }
+    /**
+     *
+     */
+    private enum ExchangeLocalState {
+        /** Local node is coordinator. */
+        CRD,
+
+        /** Local node is non-coordinator server. */
+        SRV,
+
+        /** Local node is client node. */
         CLIENT,
-        /** */
+
+        /**
+         * Previous coordinator failed before echange finished and
+         * local performs initialization to become new coordinator.
+         */
         BECOME_CRD,
-        /** */
+
+        /** Exchange finished. */
         DONE,
-        /** */
+
+        /** This exchange was merged with another one. */
         MERGED
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4030225/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
index 04d406c..ec41060 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
@@ -656,6 +656,25 @@ public class CacheExchangeMergeTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
+    public void testMergeAndNewCoordinator() throws Exception {
+        final Ignite srv0 = startGrids(3);
+
+        mergeExchangeWaitVersion(srv0, 6);
+
+        IgniteInternalFuture fut = startGrids(srv0, 3, 3);
+
+        fut.get();
+
+        checkCaches();
+
+        stopGrid(0);
+
+        checkCaches();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testMergeServersFail1_1() throws Exception {
         mergeServersFail1(false);
     }


Mime
View raw message