ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/50] ignite git commit: GG-12317 Restore snapshot functionality after split GridCacheDatabaseSharedManager and GridCacheSnapshotManager GG-12318 Remove possibility to edit snapshot by deletion certain cache from snasphot
Date Tue, 20 Jun 2017 06:00:16 GMT
GG-12317 Restore snapshot functionality after split GridCacheDatabaseSharedManager and GridCacheSnapshotManager
GG-12318 Remove possibility to edit snapshot by deletion certain cache from snasphot


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

Branch: refs/heads/ignite-2.1.2-exchange
Commit: 848af3609f9aad462d5e939e708d8284eb5d00e0
Parents: 6483ef6
Author: EdShangGG <eshangareev@gridgain.com>
Authored: Fri Jun 16 21:07:15 2017 +0300
Committer: EdShangGG <eshangareev@gridgain.com>
Committed: Fri Jun 16 21:07:15 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java    | 25 ++++++++++----------
 .../GridDhtPartitionsExchangeFuture.java        |  8 ++++++-
 .../GridCacheDatabaseSharedManager.java         | 17 +++++--------
 .../persistence/tree/util/PageHandler.java      |  2 +-
 4 files changed, 27 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/848af360/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 7130e0f..0016291 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
@@ -1944,15 +1944,15 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         // Break the proxy before exchange future is done.
         IgniteCacheProxy<?, ?> proxy = jCacheProxies.get(cacheName);
 
-            if (proxy != null) {
-                if (stop){
-                    if (restart)
-                        proxy.restart();
+        if (proxy != null) {
+            if (stop) {
+                if (restart)
+                    proxy.restart();
 
-                    proxy.gate().stopped();
-                }
-                else
-                    proxy.closeProxy();
+                proxy.gate().stopped();
+            }
+            else
+                proxy.closeProxy();
 
         }
     }
@@ -2009,11 +2009,12 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     void initCacheProxies(
         AffinityTopologyVersion startTopVer, @Nullable
         Throwable err) {
-    for (GridCacheAdapter<?, ?> cache : caches.values()) {
-        GridCacheContext<?, ?> cacheCtx = cache.context();
+        for (GridCacheAdapter<?, ?> cache : caches.values()) {
+            GridCacheContext<?, ?> cacheCtx = cache.context();
 
-            if (cacheCtx.startTopologyVersion().equals(startTopVer) && !jCacheProxies.containsKey(cacheCtx.name()))
{
-                jCacheProxies.putIfAbsent(cacheCtx.name(), new IgniteCacheProxy(cache.context(),
cache, null, false));
+            if (cacheCtx.startTopologyVersion().equals(startTopVer) ) {
+                if (!jCacheProxies.containsKey(cacheCtx.name()))
+                    jCacheProxies.putIfAbsent(cacheCtx.name(), new IgniteCacheProxy(cache.context(),
cache, null, false));
 
                 if (cacheCtx.preloader() != null)
                     cacheCtx.preloader().onInitialExchangeComplete(err);

http://git-wip-us.apache.org/repos/asf/ignite/blob/848af360/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 ea5ada7..fe7527a 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
@@ -57,6 +57,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache;
 import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
 import org.apache.ignite.internal.processors.cache.CacheGroupContext;
+import org.apache.ignite.internal.processors.cache.CacheGroupDescriptor;
 import org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask;
 import org.apache.ignite.internal.processors.cache.ClusterState;
 import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
@@ -893,10 +894,14 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
     /**
 
      */
-    private void startLocalSnasphotOperation() {StartSnapshotOperationAckDiscoveryMessage
snapOpMsg= getSnapshotOperationMessage();
+    private void startLocalSnasphotOperation() {
+        StartSnapshotOperationAckDiscoveryMessage snapOpMsg= getSnapshotOperationMessage();
+
         if (snapOpMsg != null) {
             SnapshotOperation op = snapOpMsg.snapshotOperation();
 
+            assert snapOpMsg.needExchange();
+
             try {
                 IgniteInternalFuture fut = cctx.snapshot()
                     .startLocalSnapshotOperation(snapOpMsg.initiatorNodeId(), snapOpMsg.snapshotOperation());
@@ -1334,6 +1339,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
             if (customMsg instanceof StartSnapshotOperationAckDiscoveryMessage)
                 return  (StartSnapshotOperationAckDiscoveryMessage)customMsg;
         }
+
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/848af360/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 4ce61e2..77da248 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
@@ -138,6 +138,7 @@ import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.mxbean.PersistenceMetricsMXBean;
 import org.apache.ignite.thread.IgniteThread;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_PDS_SKIP_CRC;
@@ -1965,12 +1966,6 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
                 Checkpoint chp = markCheckpointBegin(tracker);
 
-                if (chp.cpPages == null){
-                    markCheckpointEnd(chp);
-
-                    return;
-                }
-
                 boolean interrupted = true;
 
                 try {
@@ -2019,8 +2014,6 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                             return;
                         }
 
-                        snapshotMgr.afterCheckpointPageWritten();
-
                         tracker.onFsyncStart();
 
                         if (!skipSync) {
@@ -2040,6 +2033,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                         tracker.onFsyncStart();
                     }
 
+                    snapshotMgr.afterCheckpointPageWritten();
+
                     // Must mark successful checkpoint only if there are no exceptions or
interrupts.
                     interrupted = false;
                 }
@@ -2267,7 +2262,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                             curr.reason));
                 }
 
-                return new Checkpoint(null, null, curr);
+                return new Checkpoint(null, new GridMultiCollectionWrapper<>(new Collection[0]),
curr);
             }
         }
 
@@ -2473,7 +2468,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
          */
         private Checkpoint(
             CheckpointEntry cpEntry,
-            GridMultiCollectionWrapper<FullPageId> cpPages,
+            @NotNull GridMultiCollectionWrapper<FullPageId> cpPages,
             CheckpointProgress progress
         ) {
             assert cpEntry == null || cpEntry.initGuard != 0;
@@ -2482,7 +2477,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
             this.cpPages = cpPages;
             this.progress = progress;
 
-            pagesSize = cpPages == null ? 0 : cpPages.size();
+            pagesSize = cpPages.size();
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/848af360/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/util/PageHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/util/PageHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/util/PageHandler.java
index 648ddf7..b42258e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/util/PageHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/util/PageHandler.java
@@ -244,7 +244,7 @@ public abstract class PageHandler<X, R> {
     public static <X, R> R writePage(
         PageMemory pageMem,
         int cacheId,
-        long pageId,
+        final long pageId,
         PageLockListener lsnr,
         PageHandler<X, R> h,
         PageIO init,


Mime
View raw message