ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [6/9] ignite git commit: IGNITE-6720 Move operation with file system outside checkpoint write lock - Fixes #2912.
Date Fri, 27 Oct 2017 08:10:18 GMT
IGNITE-6720 Move operation with file system outside checkpoint write lock - Fixes #2912.


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

Branch: refs/heads/ignite-5935
Commit: f0500e274acb1ca397b511c25c0b58bc55d9a3c2
Parents: a93d0bf
Author: Eduard Shangareev <eshangareev@gridgain.com>
Authored: Thu Oct 26 17:41:17 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Oct 26 17:41:17 2017 +0300

----------------------------------------------------------------------
 .../preloader/GridDhtPartitionsExchangeFuture.java  |  3 ++-
 .../persistence/GridCacheDatabaseSharedManager.java | 16 +++++++++++++++-
 .../snapshot/IgniteCacheSnapshotManager.java        |  6 ++++--
 .../persistence/snapshot/SnapshotOperation.java     |  6 +++---
 .../cache/query/QueryEntityIndexDescriptor.java     |  2 ++
 5 files changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f0500e27/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 9c7451e..abfefe8 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
@@ -1458,7 +1458,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
             grpValidRes = m;
         }
 
-        tryToPerformLocalSnapshotOperation();
+        if (!cctx.localNode().isClient())
+            tryToPerformLocalSnapshotOperation();
 
         cctx.cache().onExchangeDone(initialVersion(), exchActions, err);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f0500e27/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 920af17..2dcee89 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
@@ -137,6 +137,7 @@ import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.lang.IgniteOutClosure;
 import org.apache.ignite.mxbean.DataStorageMetricsMXBean;
 import org.apache.ignite.thread.IgniteThread;
@@ -936,6 +937,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                 }
             }, false));
         }
+
         for (IgniteInternalFuture<Void> clearFut : clearFuts) {
             try {
                 clearFut.get();
@@ -2265,6 +2267,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
             boolean hasPages;
 
+            IgniteFuture snapFut = null;
+
             checkpointLock.writeLock().lock();
 
             try {
@@ -2306,7 +2310,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                     lsnr.onCheckpointBegin(ctx0);
 
                 if (curr.nextSnapshot)
-                    snapshotMgr.onMarkCheckPointBegin(curr.snapshotOperation, map);
+                    snapFut = snapshotMgr.onMarkCheckPointBegin(curr.snapshotOperation, map);
 
                 for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
                     if (grp.isLocal())
@@ -2347,6 +2351,16 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
             curr.cpBeginFut.onDone();
 
+            if (snapFut != null) {
+                try {
+                    snapFut.get();
+                }
+                catch (IgniteException e) {
+                    U.error(log, "Failed to wait for snapshot operation initialization: "
+
+                        curr.snapshotOperation + "]", e);
+                }
+            }
+
             if (hasPages) {
                 assert cpPtr != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f0500e27/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteCacheSnapshotManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteCacheSnapshotManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteCacheSnapshotManager.java
index 5746c17..45c0b11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteCacheSnapshotManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteCacheSnapshotManager.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.persistence.snapshot;
 
 import java.nio.ByteBuffer;
 import java.util.UUID;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.events.DiscoveryEvent;
 import org.apache.ignite.internal.GridKernalContext;
@@ -30,6 +31,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter;
 import org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap;
 import org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport;
+import org.apache.ignite.lang.IgniteFuture;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -70,11 +72,11 @@ public class IgniteCacheSnapshotManager<T extends SnapshotOperation>
extends Gri
      *
      * @return {@code true} if next operation must be snapshot, {@code false} if checkpoint
must be executed.
      */
-    public boolean onMarkCheckPointBegin(
+    public IgniteFuture<?> onMarkCheckPointBegin(
         T snapshotOperation,
         PartitionAllocationMap map
     ) throws IgniteCheckedException {
-        return false;
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/f0500e27/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotOperation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotOperation.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotOperation.java
index 6722eb6..dfdf832 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotOperation.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotOperation.java
@@ -30,15 +30,15 @@ public interface SnapshotOperation extends Serializable {
      *
      * @return Cache names.
      */
-    Set<Integer> cacheGroupIds();
+    public Set<Integer> cacheGroupIds();
 
     /**
      * Cache names included to this snapshot.
      */
-    Set<String> cacheNames();
+    public Set<String> cacheNames();
 
     /**
      * Any custom extra parameter.
      */
-    Object extraParameter();
+    public Object extraParameter();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f0500e27/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java
index 2fb5837..0436f10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java
@@ -43,8 +43,10 @@ public class QueryEntityIndexDescriptor implements GridQueryIndexDescriptor
{
         });
     /** */
     private final QueryIndexType type;
+
     /** */
     private final int inlineSize;
+
     /** Fields which should be indexed in descending order. */
     private Collection<String> descendings;
 


Mime
View raw message