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-gg-12389
Date Tue, 04 Jul 2017 14:41:54 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-gg-12389 87cb2ae60 -> 799d15559


ignite-gg-12389


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

Branch: refs/heads/ignite-gg-12389
Commit: 799d1555933e9cca00d6844abf627b84da59da62
Parents: 87cb2ae
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jul 4 17:30:02 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jul 4 17:41:49 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/ClusterCachesInfo.java        | 11 +++++++++--
 .../cache/GridCachePartitionExchangeManager.java   | 17 +++--------------
 .../processors/cache/GridCacheProcessor.java       | 10 ++++++----
 .../cache/version/GridCacheVersionManager.java     |  7 -------
 .../cluster/GridClusterStateProcessor.java         | 17 +++++++++++++++--
 5 files changed, 33 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/799d1555/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
index 7ade879..9a20276 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
@@ -1092,8 +1092,10 @@ class ClusterCachesInfo {
      * @param msg Message.
      * @param topVer Current topology version.
      * @return Exchange action.
+     * @throws IgniteCheckedException If configuration validation failed.
      */
-    ExchangeActions onStateChangeRequest(ChangeGlobalStateMessage msg, AffinityTopologyVersion
topVer) {
+    ExchangeActions onStateChangeRequest(ChangeGlobalStateMessage msg, AffinityTopologyVersion
topVer)
+        throws IgniteCheckedException {
         ExchangeActions exchangeActions = new ExchangeActions();
 
         if (msg.activate()) {
@@ -1152,7 +1154,12 @@ class ClusterCachesInfo {
                 CacheChangeProcessResult res = processCacheChangeRequests(exchangeActions,
reqs, topVer, true);
 
                 if (!res.errs.isEmpty()) {
-                    // TODO GG-12389.
+                    IgniteCheckedException err = new IgniteCheckedException("Failed to activate
cluster.");
+
+                    for (IgniteCheckedException err0 : res.errs)
+                        err.addSuppressed(err0);
+
+                    throw err;
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/799d1555/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 340df2b..ffe962d 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
@@ -494,6 +494,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
      * @throws IgniteCheckedException If failed.
      */
     public void onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException
{
+        for (ClusterNode n : cctx.discovery().remoteNodes())
+            cctx.versions().onReceived(n.id(), n.metrics().getLastDataVersion());
+
         ClusterNode loc = cctx.localNode();
 
         long startTime = loc.metrics().getStartTime();
@@ -527,15 +530,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                         try {
                             fut.get();
 
-                            for (CacheGroupContext grp : cctx.cache().cacheGroups())
-                                grp.preloader().onInitialExchangeComplete(null);
-
                             reconnectExchangeFut.onDone();
                         }
                         catch (IgniteCheckedException e) {
-                            for (CacheGroupContext grp : cctx.cache().cacheGroups())
-                                grp.preloader().onInitialExchangeComplete(e);
-
                             reconnectExchangeFut.onDone(e);
                         }
                     }
@@ -578,14 +575,6 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                 }
             }
 
-            // TODO GG-12389 move to exchange?
-            AffinityTopologyVersion nodeStartVer = locJoin.joinTopologyVersion();
-
-            for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
-                if (nodeStartVer.equals(grp.localStartVersion()))
-                    grp.preloader().onInitialExchangeComplete(null);
-            }
-
             if (log.isDebugEnabled())
                 log.debug("Finished waiting for initial exchange: " + fut.exchangeId());
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/799d1555/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 4d2af50..3e4f192 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -2004,9 +2004,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @param startTopVer Cache start version.
      * @param err Cache start error if any.
      */
-    void initCacheProxies(
-        AffinityTopologyVersion startTopVer, @Nullable
-        Throwable err) {
+    void initCacheProxies(AffinityTopologyVersion startTopVer, @Nullable Throwable err) {
         for (GridCacheAdapter<?, ?> cache : caches.values()) {
             GridCacheContext<?, ?> cacheCtx = cache.context();
 
@@ -2314,8 +2312,12 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
     /**
      * @param msg Message.
+     * @param topVer Current topology version.
+     * @throws IgniteCheckedException If configuration validation failed.
+     * @return Exchange actions.
      */
-    public ExchangeActions onStateChangeRequest(ChangeGlobalStateMessage msg, AffinityTopologyVersion
topVer) {
+    public ExchangeActions onStateChangeRequest(ChangeGlobalStateMessage msg, AffinityTopologyVersion
topVer)
+        throws IgniteCheckedException {
         return cachesInfo.onStateChangeRequest(msg, topVer);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/799d1555/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
index 5cad4d5..269925d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
@@ -87,13 +87,6 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter
{
         cctx.gridEvents().addLocalEventListener(discoLsnr, EVT_NODE_METRICS_UPDATED);
     }
 
-    // TODO GG-12389.
-    /** {@inheritDoc} */
-//    @Override protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-//        for (ClusterNode n : cctx.discovery().remoteNodes())
-//            onReceived(n.id(), n.metrics().getLastDataVersion());
-//    }
-
     /** {@inheritDoc} */
     @Override protected void stop0(boolean cancel) {
         cctx.gridEvents().removeLocalEventListener(discoLsnr, EVT_NODE_METRICS_UPDATED);

http://git-wip-us.apache.org/repos/asf/ignite/blob/799d1555/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
index a1246ad..1220241 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
@@ -250,6 +250,20 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
         }
         else {
             if (globalState.active() != msg.activate()) {
+                ExchangeActions exchangeActions;
+
+                try {
+                    exchangeActions = ctx.cache().onStateChangeRequest(msg, topVer);
+                }
+                catch (IgniteCheckedException e) {
+                    GridChangeGlobalStateFuture fut = changeStateFuture(msg);
+
+                    if (fut != null)
+                        fut.onDone(e);
+
+                    return false;
+                }
+
                 Set<UUID> nodeIds = U.newHashSet(discoCache.allNodes().size());
 
                 for (ClusterNode node : discoCache.allNodes())
@@ -267,8 +281,6 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
                     topVer,
                     nodeIds);
 
-                ExchangeActions exchangeActions = ctx.cache().onStateChangeRequest(msg, topVer);
-
                 AffinityTopologyVersion stateChangeTopVer = topVer.nextMinorVersion();
 
                 StateChangeRequest req = new StateChangeRequest(msg, stateChangeTopVer);
@@ -280,6 +292,7 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
                 return true;
             }
             else {
+                // State already changed.
                 GridChangeGlobalStateFuture stateFut = changeStateFuture(msg);
 
                 if (stateFut != null)


Mime
View raw message