ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: gg-12389
Date Thu, 29 Jun 2017 14:19:20 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-gg-12389 10649c7be -> e96b718be


gg-12389


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

Branch: refs/heads/ignite-gg-12389
Commit: e96b718be5c1ff2b753030957ba0d0843ee6d9d5
Parents: 10649c7
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jun 29 16:54:34 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jun 29 17:19:06 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMvccManager.java  |  6 +--
 .../GridCachePartitionExchangeManager.java      |  5 +--
 .../processors/cache/GridCacheProcessor.java    | 10 +----
 .../cache/GridCacheSharedContext.java           | 46 +++++++++++++++++--
 .../cache/GridCacheSharedManager.java           |  6 ---
 .../cache/GridCacheSharedManagerAdapter.java    | 16 -------
 .../GridDhtPartitionsExchangeFuture.java        | 25 ++++++++---
 .../GridCacheDatabaseSharedManager.java         | 24 +++-------
 .../IgniteCacheDatabaseSharedManager.java       | 34 +++++---------
 .../wal/FileWriteAheadLogManager.java           |  8 ----
 .../cache/version/GridCacheVersionManager.java  |  8 ++--
 .../cluster/ChangeGlobalStateFinishMessage.java | 20 +++++++++
 .../cluster/GridClusterStateProcessor.java      | 47 ++++++--------------
 .../pagemem/NoOpPageStoreManager.java           |  5 ---
 .../persistence/pagemem/NoOpWALManager.java     |  5 ---
 15 files changed, 120 insertions(+), 145 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index 657ab95..b156708 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -272,12 +272,8 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
         exchLog = cctx.logger(getClass().getName() + ".exchange");
 
         pendingExplicit = GridConcurrentFactory.newMap();
-    }
 
-    /** {@inheritDoc} */
-    @Override protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        if (!reconnect)
-            cctx.gridEvents().addLocalEventListener(discoLsnr, EVT_NODE_FAILED, EVT_NODE_LEFT);
+        cctx.gridEvents().addLocalEventListener(discoLsnr, EVT_NODE_FAILED, EVT_NODE_LEFT);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/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 c593f73..bdda40e 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
@@ -384,10 +384,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
         return exchangeId(cctx.localNode().id(), startTopVer, EVT_NODE_JOINED);
     }
 
-    /** {@inheritDoc} */
-    @Override protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        super.onKernalStart0(active, reconnect);
-
+    public void onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException
{
         ClusterNode loc = cctx.localNode();
 
         long startTime = loc.metrics().getStartTime();

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/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 c908dea..89d0e4d 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
@@ -835,17 +835,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             if (active && !ctx.clientNode() && !ctx.isDaemon())
                 sharedCtx.database().lock();
 
-            // Must start database before start first cache.
-            sharedCtx.database().onKernalStart(active, false);
-
             ctx.query().onCacheKernalStart();
 
-            // In shared context, we start exchange manager and wait until processed local
join
-            // event, all caches which we get on join will be start.
-            for (GridCacheSharedManager<?, ?> mgr : sharedCtx.managers()) {
-                if (sharedCtx.database() != mgr)
-                    mgr.onKernalStart(active, false);
-            }
+            sharedCtx.exchange().onKernalStart(active, false);
         }
         finally {
             cacheStartedLatch.countDown();

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/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 c0416d5..6d6264c 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
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
@@ -45,7 +46,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopolo
 import org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager;
 import org.apache.ignite.internal.processors.cache.persistence.IgniteCacheSnapshotManager;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
 import org.apache.ignite.internal.processors.cache.jta.CacheJtaManagerAdapter;
 import org.apache.ignite.internal.processors.cache.store.CacheStoreManager;
@@ -54,6 +54,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.transactions.TransactionMetricsAdapter;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
+import org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
 import org.apache.ignite.internal.util.GridIntList;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -156,6 +157,9 @@ public class GridCacheSharedContext<K, V> {
     /** Concurrent DHT atomic updates counters. */
     private AtomicIntegerArray dhtAtomicUpdCnt;
 
+    /** */
+    private final List<IgniteChangeGlobalStateSupport> stateAwareMgrs;
+
     /**
      * @param kernalCtx  Context.
      * @param txMgr Transaction manager.
@@ -207,6 +211,43 @@ public class GridCacheSharedContext<K, V> {
         txFinishMsgLog = kernalCtx.log(CU.TX_MSG_FINISH_LOG_CATEGORY);
         txLockMsgLog = kernalCtx.log(CU.TX_MSG_LOCK_LOG_CATEGORY);
         txRecoveryMsgLog = kernalCtx.log(CU.TX_MSG_RECOVERY_LOG_CATEGORY);
+
+        stateAwareMgrs = new ArrayList<>();
+
+        if (pageStoreMgr != null)
+            stateAwareMgrs.add(pageStoreMgr);
+
+        if (walMgr != null)
+            stateAwareMgrs.add(walMgr);
+
+        stateAwareMgrs.add(dbMgr);
+
+        stateAwareMgrs.add(snpMgr);
+    }
+
+    public void activate() throws IgniteCheckedException {
+        if (!kernalCtx.clientNode())
+            dbMgr.lock();
+
+        boolean success = false;
+
+        try {
+            for (IgniteChangeGlobalStateSupport mgr : stateAwareMgrs)
+                mgr.onActivate(kernalCtx);
+
+            success = true;
+        }
+        finally {
+            if (!success) {
+                if (!kernalCtx.clientNode())
+                    dbMgr.unLock();
+            }
+        }
+    }
+
+    public void deactivate() throws IgniteCheckedException {
+        for (int i = stateAwareMgrs.size() - 1; i >= 0; i--)
+            stateAwareMgrs.get(i).onDeActivate(kernalCtx);
     }
 
     /**
@@ -303,8 +344,7 @@ public class GridCacheSharedContext<K, V> {
 
         kernalCtx.query().onCacheReconnect();
 
-        for (GridCacheSharedManager<?, ?> mgr : mgrs)
-            mgr.onKernalStart(active, true);
+        exchMgr.onKernalStart(active, true);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
index 953d83e..bc1bbb9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
@@ -40,12 +40,6 @@ public interface GridCacheSharedManager<K, V> {
     public void stop(boolean cancel);
 
     /**
-     * @param reconnect {@code True} if manager restarted after client reconnect.
-     * @throws IgniteCheckedException If failed.
-     */
-    public void onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException;
-
-    /**
      * @param cancel Cancel flag.
      */
     public void onKernalStop(boolean cancel);

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
index fdd1e6d..90ae670 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
@@ -112,14 +112,6 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
     }
 
     /** {@inheritDoc} */
-    @Override public final void onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        onKernalStart0(active, reconnect);
-
-        if (!reconnect && log != null && log.isDebugEnabled())
-            log.debug(kernalStartInfo());
-    }
-
-    /** {@inheritDoc} */
     @Override public final void onKernalStop(boolean cancel) {
         if (!starting.get())
             // Ignoring attempt to stop manager that has never been started.
@@ -132,14 +124,6 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
     }
 
     /**
-     * @param reconnect {@code True} if manager restarted after client reconnect.
-     * @throws IgniteCheckedException If failed.
-     */
-    protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        // No-op.
-    }
-
-    /**
      * @param cancel Cancel flag.
      */
     protected void onKernalStop0(boolean cancel) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/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 626d200..ea084cb 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
@@ -73,6 +73,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartit
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateFinishMessage;
 import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateMessage;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -608,8 +609,11 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
 
                         cctx.affinity().initStartedCaches(crdNode, this, receivedCaches);
                     }
-                    else
+                    else {
+                        cctx.activate();
+
                         cctx.cache().startCachesOnLocalJoin(topVer);
+                    }
                 }
 
                 exchange = CU.clientNode(discoEvt.eventNode()) ?
@@ -1818,14 +1822,23 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
                     nodes = new ArrayList<>(srvNodes);
                 }
 
-                if (!nodes.isEmpty())
-                    sendAllPartitions(nodes);
+                if (stateChangeExchange()) {
+                    StateChangeRequest req = exchActions.stateChangeRequest();
+
+                    assert req != null : exchActions;
 
-                if (stateChangeExchange() && !F.isEmpty(changeGlobalStateExceptions))
{
-                    cctx.kernalContext().state().onStateChangeError(changeGlobalStateExceptions,
-                        exchActions.stateChangeRequest());
+                    if (!F.isEmpty(changeGlobalStateExceptions))
+                        cctx.kernalContext().state().onStateChangeError(changeGlobalStateExceptions,
req);
+
+                    ChangeGlobalStateFinishMessage msg = new ChangeGlobalStateFinishMessage(req.requestId(),
+                        req.activate());
+
+                    cctx.discovery().sendCustomEvent(msg);
                 }
 
+                if (!nodes.isEmpty())
+                    sendAllPartitions(nodes);
+
                 onDone(exchangeId().topologyVersion());
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 437945a..491c0ae 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -352,6 +352,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
     /** {@inheritDoc} */
     @Override protected void start0() throws IgniteCheckedException {
+        super.start0();
+
         snapshotMgr = cctx.snapshot();
 
         if (!cctx.kernalContext().clientNode()) {
@@ -369,15 +371,13 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
             fileLockHolder = new FileLockHolder(storeMgr.workDir().getPath(), cctx.kernalContext(),
log);
 
             persStoreMetrics.wal(cctx.wal());
-
-            registrateMetricsMBean();
         }
     }
 
     /**
-     *
+     * @throws IgniteCheckedException If failed.
      */
-    @Override public void initDataBase() throws IgniteCheckedException {
+    private void initDataBase() throws IgniteCheckedException {
         Long cpBufSize = persistenceCfg.getCheckpointingPageBufferSize();
 
         if (persistenceCfg.getCheckpointingThreads() > 1)
@@ -430,8 +430,6 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
         }
 
         checkpointPageBufSize = cpBufSize;
-
-        super.start0();
     }
 
     /** {@inheritDoc} */
@@ -439,16 +437,6 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
         // No-op.
     }
 
-    /** {@inheritDoc} */
-    @Override protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        if (reconnect || cctx.kernalContext().clientNode() || !active)
-            return;
-
-        initDataBase();
-
-        initCachesAndRestoreMemory();
-    }
-
     /**
      *
      */
@@ -491,7 +479,9 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
     }
 
     /** {@inheritDoc} */
-    @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException
{
+    @Override public void onActivate(GridKernalContext ctx) throws IgniteCheckedException
{
+        super.onActivate(ctx);
+
         if (log.isDebugEnabled())
             log.debug("Activate database manager [id=" + cctx.localNodeId() +
                 " topVer=" + cctx.discovery().topologyVersionEx() + " ]");

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
index ec0e895..813f984 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
@@ -100,13 +100,6 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
         if (cctx.kernalContext().clientNode() && cctx.kernalContext().config().getMemoryConfiguration()
== null)
             return;
 
-        init();
-    }
-
-    /**
-     * @throws IgniteCheckedException If failed.
-     */
-    public void init() throws IgniteCheckedException {
         MemoryConfiguration memCfg = cctx.kernalContext().config().getMemoryConfiguration();
 
         assert memCfg != null;
@@ -114,14 +107,6 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
         validateConfiguration(memCfg);
 
         pageSize = memCfg.getPageSize();
-
-        initPageMemoryPolicies(memCfg);
-
-        registerMetricsMBeans();
-
-        startMemoryPolicies();
-
-        initPageMemoryDataStructures(memCfg);
     }
 
     /**
@@ -554,13 +539,6 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
     }
 
     /**
-     * @throws IgniteCheckedException If failed.
-     */
-    public void initDataBase() throws IgniteCheckedException {
-        // No-op.
-    }
-
-    /**
      * @return collection of all configured {@link MemoryPolicy policies}.
      */
     public Collection<MemoryPolicy> memoryPolicies() {
@@ -947,7 +925,17 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
 
     /** {@inheritDoc} */
     @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException
{
-        start0();
+        MemoryConfiguration memCfg = cctx.kernalContext().config().getMemoryConfiguration();
+
+        assert memCfg != null;
+
+        initPageMemoryPolicies(memCfg);
+
+        registerMetricsMBeans();
+
+        startMemoryPolicies();
+
+        initPageMemoryDataStructures(memCfg);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
index 22713d3..d54d59e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
@@ -254,14 +254,6 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter
impl
         }
     }
 
-    /** {@inheritDoc} */
-    @Override protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        super.onKernalStart0(active, reconnect);
-
-        if (!cctx.kernalContext().clientNode() && active)
-            archiver.start();
-    }
-
     /**
      * @return Consistent ID.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/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 7d28e7e..7cf1932 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
@@ -88,10 +88,10 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter
{
     }
 
     /** {@inheritDoc} */
-    @Override protected void onKernalStart0(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        for (ClusterNode n : cctx.discovery().remoteNodes())
-            onReceived(n.id(), n.metrics().getLastDataVersion());
-    }
+//    @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) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
index 53b7335..f73aad5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cluster;
 
+import java.util.UUID;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
 import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
@@ -31,6 +32,25 @@ public class ChangeGlobalStateFinishMessage implements DiscoveryCustomMessage
{
     /** Custom message ID. */
     private IgniteUuid id = IgniteUuid.randomUuid();
 
+    /** */
+    private UUID reqId;
+
+    /** */
+    private boolean clusterActive;
+
+    public ChangeGlobalStateFinishMessage(UUID reqId, boolean clusterActive) {
+        this.reqId = reqId;
+        this.clusterActive = clusterActive;
+    }
+
+    public UUID requestId() {
+        return reqId;
+    }
+
+    public boolean clusterActive() {
+        return clusterActive;
+    }
+
     /** {@inheritDoc} */
     @Override public IgniteUuid id() {
         return id;

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/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 204f797..13a1227 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
@@ -393,41 +393,28 @@ public class GridClusterStateProcessor extends GridProcessorAdapter
{
      *
      */
     private Exception onActivate(AffinityTopologyVersion topVer) {
-        final boolean client = ctx.clientNode();
-
-        if (log.isInfoEnabled())
-            log.info("Start activation process [nodeId=" + ctx.localNodeId() + ", client="
+ client +
+        if (log.isInfoEnabled()) {
+            log.info("Start activation process [nodeId=" + ctx.localNodeId() +
+                ", client=" + ctx.clientNode() +
                 ", topVer=" + topVer + "]");
+        }
 
         try {
-            if (!client)
-                sharedCtx.database().lock();
-
-            IgnitePageStoreManager pageStore = sharedCtx.pageStore();
-
-            if (pageStore != null)
-                pageStore.onActivate(ctx);
-
-            if (sharedCtx.wal() != null)
-                sharedCtx.wal().onActivate(ctx);
-
-            sharedCtx.database().onActivate(ctx);
+            sharedCtx.activate();
 
-            sharedCtx.snapshot().onActivate(ctx);
-
-            if (log.isInfoEnabled())
-                log.info("Successfully activated persistence managers [nodeId="
-                    + ctx.localNodeId() + ", client=" + client + ", topVer=" + topVer + "]");
+            if (log.isInfoEnabled()) {
+                log.info("Successfully activated persistence managers [nodeId=" + ctx.localNodeId()
+
+                    ", client=" + ctx.clientNode() +
+                    ", topVer=" + topVer + "]");
+            }
 
             return null;
         }
         catch (Exception e) {
-            U.error(log, "Failed to activate persistence managers [nodeId=" + ctx.localNodeId()
+ ", client=" + client +
+            U.error(log, "Failed to activate persistence managers [nodeId=" + ctx.localNodeId()
+
+                ", client=" + ctx.clientNode() +
                 ", topVer=" + topVer + "]", e);
 
-            if (!client)
-                sharedCtx.database().unLock();
-
             return e;
         }
     }
@@ -508,15 +495,7 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
         Exception ex = null;
 
         try {
-            sharedCtx.snapshot().onDeActivate(ctx);
-
-            sharedCtx.database().onDeActivate(ctx);
-
-            if (sharedCtx.pageStore() != null)
-                sharedCtx.pageStore().onDeActivate(ctx);
-
-            if (sharedCtx.wal() != null)
-                sharedCtx.wal().onDeActivate(ctx);
+            sharedCtx.deactivate();
 
             sharedCtx.affinity().removeAllCacheInfo();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
index a890cf6..ec6aaaa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
@@ -152,11 +152,6 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager {
     }
 
     /** {@inheritDoc} */
-    @Override public void onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException
{
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
     @Override public void onKernalStop(boolean cancel) {
         // No-op.
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e96b718b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpWALManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpWALManager.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpWALManager.java
index 13f1eb4..7ba5b60 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpWALManager.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpWALManager.java
@@ -92,11 +92,6 @@ public class NoOpWALManager implements IgniteWriteAheadLogManager {
     }
 
     /** {@inheritDoc} */
-    @Override public void onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException
{
-
-    }
-
-    /** {@inheritDoc} */
     @Override public void onKernalStop(boolean cancel) {
 
     }


Mime
View raw message