ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [05/46] ignite git commit: GG-12416: Backport [GG-12402] to 8.1.2
Date Fri, 07 Jul 2017 09:34:08 GMT
GG-12416: Backport [GG-12402] to 8.1.2


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

Branch: refs/heads/ignite-2.1
Commit: c475f2765ca557191dcbff67a070d458143203b0
Parents: fbf9597
Author: Ivan Rakov <ivan.glukos@gmail.com>
Authored: Tue Jul 4 14:58:16 2017 +0300
Committer: Ivan Rakov <ivan.glukos@gmail.com>
Committed: Tue Jul 4 14:58:16 2017 +0300

----------------------------------------------------------------------
 .../cache/persistence/DbCheckpointListener.java           |  2 ++
 .../cache/persistence/GridCacheDatabaseSharedManager.java |  4 ++++
 .../cache/persistence/GridCacheOffheapManager.java        | 10 +++++-----
 3 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c475f276/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DbCheckpointListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DbCheckpointListener.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DbCheckpointListener.java
index f4da637..daaccff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DbCheckpointListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DbCheckpointListener.java
@@ -29,6 +29,8 @@ public interface DbCheckpointListener {
         public boolean nextSnapshot();
 
         public Map<T2<Integer, Integer>, T2<Integer, Integer>> partitionStatMap();
+
+        public boolean needToSnapshot(String cacheOrGrpName);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/c475f276/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 990f54c..3b3932e 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
@@ -2155,6 +2155,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                     @Override public Map<T2<Integer, Integer>, T2<Integer, Integer>>
partitionStatMap() {
                         return map;
                     }
+
+                    @Override public boolean needToSnapshot(String cacheOrGrpName) {
+                        return curr.snapshotOperation.cacheGroupIds().contains(CU.cacheId(cacheOrGrpName));
+                    }
                 };
 
                 // Listeners must be invoked before we write checkpoint record to WAL.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c475f276/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
index a890fa1..ed008be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
@@ -47,6 +47,9 @@ import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl;
 import org.apache.ignite.internal.processors.cache.IgniteRebalanceIterator;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
 import org.apache.ignite.internal.processors.cache.persistence.freelist.FreeListImpl;
 import org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryEx;
 import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO;
@@ -56,9 +59,6 @@ import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageParti
 import org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList;
 import org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseListImpl;
 import org.apache.ignite.internal.processors.cache.persistence.tree.util.PageHandler;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
-import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.lang.GridCursor;
@@ -169,7 +169,7 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl
imple
         boolean beforeDestroy) throws IgniteCheckedException {
         RowStore rowStore0 = store.rowStore();
 
-        boolean beforeSnapshot = ctx != null && ctx.nextSnapshot();
+        boolean needSnapshot = ctx != null && ctx.nextSnapshot() && ctx.needToSnapshot(grp.cacheOrGroupName());
 
         boolean wasSaveToMeta = false;
 
@@ -302,7 +302,7 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl
imple
 
                         int pageCnt;
 
-                        if (beforeSnapshot) {
+                        if (needSnapshot) {
                             pageCnt = this.ctx.pageStore().pages(grpId, store.partId());
                             io.setCandidatePageCount(pageAddr, pageCnt);
 


Mime
View raw message