ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [50/50] [abbrv] ignite git commit: Debugging slowdowns
Date Wed, 21 Oct 2015 14:17:35 GMT
Debugging slowdowns


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

Branch: refs/heads/ignite-1.4-slow-server-debug
Commit: df82d531292469877dbecd7b8296caeaef47d09e
Parents: 909a1b8
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Wed Oct 21 17:16:46 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Wed Oct 21 17:16:46 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMvccManager.java  | 32 ++++++--------------
 .../cache/distributed/dht/GridDhtTxRemote.java  | 23 +++++++-------
 .../cache/transactions/IgniteTxManager.java     |  3 +-
 3 files changed, 23 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/df82d531/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index d36b174..7b65218 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -154,9 +154,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
                                 // we can safely invoke any method on the future.
                                 // Also note that we don't remove future here if it is done.
                                 // The removal is initiated from within future itself.
-                                if (mvccFut.onOwnerChanged(
-                                    entry,
-                                    owner))
+                                if (mvccFut.onOwnerChanged(entry, owner))
                                     return;
                             }
                         }
@@ -210,21 +208,8 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
             if (log.isDebugEnabled())
                 log.debug("Processing node left [nodeId=" + discoEvt.eventNode().id() + "]");
 
-            for (Collection<GridCacheFuture<?>> futsCol : futs.values()) {
-                for (GridCacheFuture<?> fut : futsCol) {
-                    if (!fut.trackable()) {
-                        if (log.isDebugEnabled())
-                            log.debug("Skipping non-trackable future: " + fut);
-
-                        continue;
-                    }
-
-                    fut.onNodeLeft(discoEvt.eventNode().id());
-
-                    if (fut.isCancelled() || fut.isDone())
-                        removeFuture(fut);
-                }
-            }
+            for (GridCacheFuture<?> fut : activeFutures())
+                fut.onNodeLeft(discoEvt.eventNode().id());
 
             for (IgniteInternalFuture<?> fut : atomicFuts.values()) {
                 if (fut instanceof GridCacheFuture) {
@@ -361,8 +346,10 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
      */
     private void cancelClientFutures(IgniteCheckedException err) {
         for (Collection<GridCacheFuture<?>> futures : futs.values()) {
-            for (GridCacheFuture<?> future : futures)
-                ((GridFutureAdapter)future).onDone(err);
+            synchronized (futures) {
+                for (GridCacheFuture<?> future : futures)
+                    ((GridFutureAdapter)future).onDone(err);
+            }
         }
 
         for (GridCacheAtomicFuture<?> future : atomicFuts.values())
@@ -605,7 +592,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
     @Nullable public GridCacheFuture future(GridCacheVersion ver, IgniteUuid futId) {
         Collection<? extends GridCacheFuture> futs = this.futs.get(ver);
 
-        if (futs != null)
+        if (futs != null) {
             synchronized (futs) {
                 for (GridCacheFuture<?> fut : futs) {
                     if (fut.futureId().equals(futId)) {
@@ -616,6 +603,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
                     }
                 }
             }
+        }
 
         if (log.isDebugEnabled())
             log.debug("Failed to find future in futures map [ver=" + ver + ", futId=" + futId
+ ']');
@@ -1077,7 +1065,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
      * @return Future that signals when all locks for given partitions will be released.
      */
     private IgniteInternalFuture<?> finishLocks(
-        @Nullable final IgnitePredicate<KeyCacheObject> keyFilter,
+        @Nullable final IgnitePredicate<GridDistributedCacheEntry> filter,
         AffinityTopologyVersion topVer
     ) {
         assert topVer.topologyVersion() != 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/df82d531/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
index 3996d6a..3c97c93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
@@ -17,15 +17,6 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
-import java.io.Externalizable;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.UUID;
-import javax.cache.processor.EntryProcessor;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.CacheObject;
@@ -45,6 +36,16 @@ import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
 import org.jetbrains.annotations.Nullable;
+import org.jsr166.ConcurrentLinkedHashMap;
+
+import javax.cache.processor.EntryProcessor;
+import java.io.Externalizable;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.UUID;
 
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.isNearEnabled;
 
@@ -139,7 +140,7 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
 
         readMap = Collections.emptyMap();
 
-        writeMap = new LinkedHashMap<>(U.capacity(txSize));
+        writeMap = new ConcurrentLinkedHashMap<>(U.capacity(txSize), 0.75f, 1);
 
         topologyVersion(topVer);
     }
@@ -208,7 +209,7 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
         this.rmtFutId = rmtFutId;
 
         readMap = Collections.emptyMap();
-        writeMap = new LinkedHashMap<>(U.capacity(txSize));
+        writeMap = new ConcurrentLinkedHashMap<>(U.capacity(txSize), 0.75f, 1);
 
         topologyVersion(topVer);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df82d531/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index c1a8ae1..7c93375 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -155,8 +155,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
             Integer.getInteger(IGNITE_MAX_COMPLETED_TX_COUNT, DFLT_MAX_COMPLETED_TX_CNT),
             Integer.getInteger(IGNITE_MAX_COMPLETED_TX_COUNT, DFLT_MAX_COMPLETED_TX_CNT),
             0.75f,
-            Math.max(Runtime.getRuntime().availableProcessors(), 64),
-            ConcurrentLinkedHashMap.QueuePolicy.PER_SEGMENT_Q);
+            Math.max(Runtime.getRuntime().availableProcessors(), 64));
 
     /** Transaction finish synchronizer. */
     private GridCacheTxFinishSync txFinishSync;


Mime
View raw message