ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject ignite git commit: IGNITE-3748 Data rebalancing of large cache can hang out.
Date Wed, 16 Nov 2016 14:20:14 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3748 68c3ab80c -> f8509ee7c


IGNITE-3748 Data rebalancing of large cache can hang out.


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

Branch: refs/heads/ignite-3748
Commit: f8509ee7cdef65742981e5e4b0e0e5edbd105aa0
Parents: 68c3ab8
Author: Anton Vinogradov <av@apache.org>
Authored: Wed Nov 16 17:19:57 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Wed Nov 16 17:19:57 2016 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLocalPartition.java  | 42 +++++++++-----------
 .../dht/preloader/GridDhtPreloader.java         |  9 ++++-
 2 files changed, 26 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f8509ee7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 1712283..39a3e08 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -538,41 +538,35 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
      *
      */
     public void tryEvict() {
-        cctx.gate().enter();
-
-        try {
-            long reservations = state.get();
+        long reservations = state.get();
 
-            int ord = (int)(reservations >> 32);
+        int ord = (int)(reservations >> 32);
 
-            if (ord != RENTING.ordinal() || (reservations & 0xFFFF) != 0 || groupReserved())
-                return;
+        if (ord != RENTING.ordinal() || (reservations & 0xFFFF) != 0 || groupReserved())
+            return;
 
-            // Attempt to evict partition entries from cache.
-            clearAll();
+        // Attempt to evict partition entries from cache.
+        clearAll();
 
-            if (isEmpty() && casState(reservations, EVICTED)) {
-                if (log.isDebugEnabled())
-                    log.debug("Evicted partition: " + this);
+        if (isEmpty() && casState(reservations, EVICTED)) {
+            if (log.isDebugEnabled())
+                log.debug("Evicted partition: " + this);
 
-                if (!GridQueryProcessor.isEnabled(cctx.config()))
-                    clearSwap();
+            if (!GridQueryProcessor.isEnabled(cctx.config()))
+                clearSwap();
 
-                if (cctx.isDrEnabled())
-                    cctx.dr().partitionEvicted(id);
+            if (cctx.isDrEnabled())
+                cctx.dr().partitionEvicted(id);
 
-                cctx.continuousQueries().onPartitionEvicted(id);
+            cctx.continuousQueries().onPartitionEvicted(id);
 
-                cctx.dataStructures().onPartitionEvicted(id);
+            cctx.dataStructures().onPartitionEvicted(id);
 
-                rent.onDone();
+            rent.onDone();
 
-                ((GridDhtPreloader)cctx.preloader()).onPartitionEvicted(this, true);
+            ((GridDhtPreloader)cctx.preloader()).onPartitionEvicted(this, true);
 
-                clearDeferredDeletes();
-            }
-        }finally {
-            cctx.gate().leave();
+            clearDeferredDeletes();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8509ee7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 9191a86..e3834f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -770,7 +770,14 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
 
                             if (part != null)
                                 try {
-                                    part.tryEvict();
+                                    cctx.gate().enter();
+
+                                    try {
+                                        part.tryEvict();
+                                    }
+                                    finally {
+                                        cctx.gate().leave();
+                                    }
                                 }
                                 catch (Throwable ex) {
                                     LT.error(log, ex, "Partition eviction failed, this can
cause grid hang.", true);


Mime
View raw message