ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [29/49] ignite git commit: GG-12210 Don't allow join server node and smart merge client configuration during snapshot restore -filter out restarting caches on client join
Date Fri, 02 Jun 2017 17:13:42 GMT
GG-12210 Don't allow join server node and smart merge client configuration during snapshot
restore
-filter out restarting caches on client join


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

Branch: refs/heads/ignite-5398
Commit: 7b06de36a0bb6a9a4730f87151365ae8aac0e10d
Parents: 6cf5d59
Author: EdShangGG <eshangareev@gridgain.com>
Authored: Tue May 23 21:08:40 2017 +0300
Committer: EdShangGG <eshangareev@gridgain.com>
Committed: Tue May 23 21:08:40 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/DynamicCacheChangeBatch.java | 18 ++++++++++++++++++
 .../processors/cache/GridCacheProcessor.java      | 15 +++++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7b06de36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
index f423002..7804240 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
 
 import java.util.Collection;
 import java.util.Map;
+import java.util.Set;
 import java.util.UUID;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -53,6 +54,9 @@ public class DynamicCacheChangeBatch implements DiscoveryCustomMessage {
     /** */
     private boolean startCaches;
 
+    /** Restarting caches. */
+    private Set<String> restartingCaches;
+
     /**
      * @param reqs Requests.
      */
@@ -127,6 +131,20 @@ public class DynamicCacheChangeBatch implements DiscoveryCustomMessage
{
     }
 
     /**
+     * @param caches restarting caches.
+     */
+    public void restartingCaches(Set<String> caches) {
+        this.restartingCaches = caches;
+    }
+
+    /**
+     *
+     */
+    public Set<String> restartingCaches() {
+        return this.restartingCaches;
+    }
+
+    /**
      * @param startCaches {@code True} if required to start all caches on client node.
      */
     public void startCaches(boolean startCaches) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7b06de36/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 5368e37..487500a 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
@@ -2181,6 +2181,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
         batch.clientReconnect(reconnect);
 
+        batch.restartingCaches(restartingCaches);
+
         if (!reconnect)
             batch.startCaches(startAllCachesOnClientStart());
 
@@ -2265,6 +2267,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         else {
                             assert req.cacheType() != null : req;
 
+                            if (restartingCaches.contains(req.cacheName()))
+                                continue;
+
                             DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
                                 ctx,
                                 ccfg,
@@ -2294,12 +2299,18 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     }
                 }
 
+                for (String s : batch.restartingCaches())
+                    registeredCaches.remove(s);
+
+                restartingCaches.addAll(batch.restartingCaches());
+
                 if (!F.isEmpty(batch.clientNodes())) {
                     for (Map.Entry<String, Map<UUID, Boolean>> entry : batch.clientNodes().entrySet())
{
                         String cacheName = entry.getKey();
 
-                        for (Map.Entry<UUID, Boolean> tup : entry.getValue().entrySet())
-                            ctx.discovery().addClientNode(cacheName, tup.getKey(), tup.getValue());
+                        if (!restartingCaches.contains(cacheName))
+                            for (Map.Entry<UUID, Boolean> tup : entry.getValue().entrySet())
+                                ctx.discovery().addClientNode(cacheName, tup.getKey(), tup.getValue());
                     }
                 }
 


Mime
View raw message