ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/10] ignite git commit: gg-12389
Date Fri, 30 Jun 2017 13:16:50 GMT
gg-12389


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

Branch: refs/heads/ignite-gg-12389
Commit: 66f5eabf004354b21337320de4fd03b5440fd847
Parents: 93697eb
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jun 30 16:15:55 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jun 30 16:15:55 2017 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgniteKernal.java     |  2 +-
 .../internal/managers/discovery/DiscoCache.java      |  1 +
 .../managers/discovery/GridDiscoveryManager.java     |  1 +
 .../processors/cache/CacheAffinitySharedManager.java | 14 +++++++-------
 .../internal/processors/cache/ClusterCachesInfo.java |  9 ++++-----
 .../processors/cache/GridCacheIoManager.java         |  3 +++
 .../cache/GridCachePartitionExchangeManager.java     | 15 ++-------------
 .../processors/cache/GridCacheProcessor.java         |  4 +++-
 .../processors/cache/GridCacheSharedContext.java     |  6 ++++++
 .../processors/cache/StateChangeRequest.java         |  4 ----
 .../dht/GridDhtTopologyFutureAdapter.java            |  7 +++----
 .../preloader/GridDhtPartitionsExchangeFuture.java   |  1 -
 12 files changed, 31 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index f7eef1e..2b0a36a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1035,7 +1035,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
                 if (!skipDaemon(comp)) {
                     try {
-                        comp.onKernalStart(joinData.active());
+                        comp.onKernalStart(active);
                     }
                     catch (IgniteNeedReconnectException e) {
                         assert ctx.discovery().reconnectSupported();

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
index 30d38bc..7605ae7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
@@ -82,6 +82,7 @@ public class DiscoCache {
     private final Set<UUID> alives = new GridConcurrentHashSet<>();
 
     /**
+     * @param state Current cluster state.
      * @param loc Local node.
      * @param rmtNodes Remote nodes.
      * @param allNodes All nodes.

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 0797541..b9b1d73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2129,6 +2129,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
     /**
      * Called from discovery thread.
      *
+     * @param state Current state.
      * @param loc Local node.
      * @param topSnapshot Topology snapshot.
      * @return Newly created discovery cache.

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index f616482..20b8162 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -111,6 +111,9 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
     /** */
     private final ThreadLocal<ClientCacheChangeDiscoveryMessage> clientCacheChanges
= new ThreadLocal<>();
 
+    /** */
+    private boolean cachesInitialized;
+
     /** Discovery listener. */
     private final GridLocalEventListener discoLsnr = new GridLocalEventListener() {
         @Override public void onEvent(Event evt) {
@@ -139,9 +142,6 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
         cctx.kernalContext().event().addLocalEventListener(discoLsnr, EVT_NODE_LEFT, EVT_NODE_FAILED);
     }
 
-    /** */
-    private boolean initCaches;
-
     /**
      * Callback invoked from discovery thread when discovery message is received.
      *
@@ -168,13 +168,13 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
 
             caches.init(cctx.cache().cacheGroupDescriptors(), cctx.cache().cacheDescriptors());
 
-            initCaches = true;
+            cachesInitialized = true;
         }
         else if (customMsg instanceof ChangeGlobalStateFinishMessage) {
-            if (!initCaches && ((ChangeGlobalStateFinishMessage)customMsg).clusterActive())
{
+            if (!cachesInitialized && ((ChangeGlobalStateFinishMessage)customMsg).clusterActive())
{
                 caches.init(cctx.cache().cacheGroupDescriptors(), cctx.cache().cacheDescriptors());
 
-                initCaches = true;
+                cachesInitialized = true;
             }
         }
 
@@ -725,7 +725,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                 if (cacheProxy != null) {
                     // Cache should be in restarting mode
                     assert cacheProxy.isRestarting()
-                            : "Cache has non restarting proxy " + cacheProxy;
+                        : "Cache has non restarting proxy " + cacheProxy;
 
                     startCache = true;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/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 f9c4945..a5d68bc 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
@@ -93,6 +93,9 @@ class ClusterCachesInfo {
     private List<T2<DynamicCacheDescriptor, NearCacheConfiguration>> locJoinStartCaches;
 
     /** */
+    private Map<String, T2<CacheConfiguration, NearCacheConfiguration>> locCfgsForActivation;
+
+    /** */
     private Map<UUID, CacheClientReconnectDiscoveryData> clientReconnectReqs;
 
     /**
@@ -942,9 +945,6 @@ class ClusterCachesInfo {
             locJoinStartCaches = Collections.emptyList();
     }
 
-    /** */
-    private Map<String, T2<CacheConfiguration, NearCacheConfiguration>> locCfgsForActivation;
-
     /**
      * @param firstNode {@code True} if first node in cluster starts.
      */
@@ -955,8 +955,7 @@ class ClusterCachesInfo {
         locCfgsForActivation = new HashMap<>();
 
         if (joinDiscoData != null) {
-            // TODO GG-12389 handle transition.
-           boolean active = ctx.state().clusterState().active();
+           boolean active = ctx.state().clusterState().active() && !ctx.state().clusterState().transition();
 
             for (DynamicCacheDescriptor desc : registeredCaches.values()) {
                 if (firstNode && !joinDiscoData.caches().containsKey(desc.cacheName()))

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 85b8019..749ec31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -1394,6 +1394,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
     }
 
     /**
+     * @param cctx Context.
      * @param topic Topic.
      * @param c Handler.
      */
@@ -1402,6 +1403,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
     }
 
     /**
+     * @param cctx Context.
      * @param topic Topic.
      * @param c Handler.
      */
@@ -1412,6 +1414,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
     /**
      * Adds ordered message handler.
      *
+     * @param cctx Context.
      * @param cacheGrp {@code True} if cache group message, {@code false} if cache message.
      * @param topic Topic.
      * @param c Handler.

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/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 b2ca275..9788ab7 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
@@ -326,19 +326,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
 
                     assert cctx.discovery().node(n.id()) == null;
 
-                    // Avoid race b/w initial future add and discovery event.
-                    GridDhtPartitionsExchangeFuture initFut = null;
-
-                    if (readyTopVer.get().equals(AffinityTopologyVersion.NONE)) {
-                        initFut = exchangeFuture(initialExchangeId(), null, null, null, null);
-
-                        initFut.onNodeLeft(n);
-                    }
-
-                    for (GridDhtPartitionsExchangeFuture f : exchFuts.values()) {
-                        if (f != initFut)
-                            f.onNodeLeft(n);
-                    }
+                    for (GridDhtPartitionsExchangeFuture f : exchFuts.values())
+                        f.onNodeLeft(n);
 
                     // Notify indexing engine about node leave so that we can re-map coordinator
accordingly.
                     exchWorker.addCustomTask(new SchemaNodeLeaveExchangeWorkerTask(evt.eventNode()));

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/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 ae3c366..ac01ea0 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
@@ -1765,12 +1765,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * @param startCfg Cache configuration to use.
      * @param desc Cache descriptor.
      * @param reqNearCfg Near configuration if specified for client cache start request.
      * @param exchTopVer Current exchange version.
      * @throws IgniteCheckedException If failed.
      */
-    public void prepareCacheStart(
+    void prepareCacheStart(
         CacheConfiguration startCfg,
         DynamicCacheDescriptor desc,
         @Nullable NearCacheConfiguration reqNearCfg,
@@ -2171,6 +2172,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
     /**
      * @param req Request to complete future for.
+     * @param success Future result.
      * @param err Error if any.
      */
     void completeCacheStartFuture(DynamicCacheChangeRequest req, boolean success, @Nullable
Throwable err) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 6d6264c..bd8d434 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -225,6 +225,9 @@ public class GridCacheSharedContext<K, V> {
         stateAwareMgrs.add(snpMgr);
     }
 
+    /**
+     * @throws IgniteCheckedException If failed.
+     */
     public void activate() throws IgniteCheckedException {
         if (!kernalCtx.clientNode())
             dbMgr.lock();
@@ -245,6 +248,9 @@ public class GridCacheSharedContext<K, V> {
         }
     }
 
+    /**
+     * @throws IgniteCheckedException If failed.
+     */
     public void deactivate() throws IgniteCheckedException {
         for (int i = stateAwareMgrs.size() - 1; i >= 0; i--)
             stateAwareMgrs.get(i).onDeActivate(kernalCtx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StateChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StateChangeRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StateChangeRequest.java
index 1caaa4a..c156ca1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StateChangeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StateChangeRequest.java
@@ -17,13 +17,9 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import java.util.Map;
 import java.util.UUID;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateMessage;
-import org.apache.ignite.internal.util.typedef.T2;
 
 /**
  *

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTopologyFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTopologyFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTopologyFutureAdapter.java
index 3b6116e..d04870a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTopologyFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTopologyFutureAdapter.java
@@ -80,10 +80,9 @@ public abstract class GridDhtTopologyFutureAdapter extends GridFutureAdapter<Aff
         if (err != null)
             return err;
 
-// TODO GG-12389.
-//        if (!cctx.shared().kernalContext().state().active())
-//            return new CacheInvalidStateException(
-//                "Failed to perform cache operation (cluster is not activated): " + cctx.name());
+        if (!cctx.shared().kernalContext().state().publicApiActiveState())
+            return new CacheInvalidStateException(
+                "Failed to perform cache operation (cluster is not activated): " + cctx.name());
 
         CacheGroupContext grp = cctx.group();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f5eabf/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 11f3d75..b10c25c 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
@@ -58,7 +58,6 @@ import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCach
 import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
 import org.apache.ignite.internal.processors.cache.CacheGroupContext;
 import org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask;
-import org.apache.ignite.internal.processors.cache.ClusterState;
 import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
 import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
 import org.apache.ignite.internal.processors.cache.ExchangeActions;


Mime
View raw message