ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [18/50] [abbrv] ignite git commit: EA2 - Do not wait for rent inside checkpoint read lock.
Date Mon, 10 Oct 2016 14:57:23 GMT
EA2 - Do not wait for rent inside checkpoint read lock.


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

Branch: refs/heads/ignite-gg-8-io2-park
Commit: ffbc2180be6f7ec159ec07001051ad70196d6030
Parents: db4bbc3
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Wed Sep 28 19:05:09 2016 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Sep 28 19:05:09 2016 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionTopologyImpl.java        | 14 +++++++++++++-
 .../GridDhtPartitionsExchangeFuture.java         | 19 ++++++-------------
 2 files changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ffbc2180/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index edb89f2..6356b71 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -479,11 +479,21 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh
     /** {@inheritDoc} */
     @Override public void beforeExchange(GridDhtPartitionsExchangeFuture exchFut, boolean
affReady)
         throws IgniteCheckedException {
+        // Wait for rent outside of checkpoint lock.
         waitForRent();
 
         ClusterNode loc = cctx.localNode();
 
-        U.writeLock(lock);
+        cctx.shared().database().checkpointReadLock();
+
+        try {
+            U.writeLock(lock);
+        }
+        catch (IgniteInterruptedCheckedException e) {
+            cctx.shared().database().checkpointReadUnlock();
+
+            throw e;
+        }
 
         try {
             GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
@@ -555,6 +565,8 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh
         }
         finally {
             lock.writeLock().unlock();
+
+            cctx.shared().database().checkpointReadUnlock();
         }
 
         // Wait for evictions.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ffbc2180/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 f57118a..3c7919b 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
@@ -763,21 +763,14 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
             if (cacheCtx.isLocal() || stopping(cacheCtx.cacheId()))
                 continue;
 
-            cctx.database().checkpointReadLock();
+            if (topChanged) {
+                cacheCtx.continuousQueries().beforeExchange(exchId.topologyVersion());
 
-            try {
-                if (topChanged) {
-                    cacheCtx.continuousQueries().beforeExchange(exchId.topologyVersion());
-
-                    // Partition release future is done so we can flush the write-behind
store.
-                    cacheCtx.store().forceFlush();
-                }
-
-                cacheCtx.topology().beforeExchange(this, !centralizedAff);
-            }
-            finally {
-                cctx.database().checkpointReadUnlock();
+                // Partition release future is done so we can flush the write-behind store.
+                cacheCtx.store().forceFlush();
             }
+
+            cacheCtx.topology().beforeExchange(this, !centralizedAff);
         }
 
         cctx.database().beforeExchange(this);


Mime
View raw message