You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/12/28 11:17:05 UTC

ignite git commit: IGNITE-7324 Fixing assertion when deadlock is detected

Repository: ignite
Updated Branches:
  refs/heads/ignite-7324 [created] fb511a022


IGNITE-7324 Fixing assertion when deadlock is detected


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

Branch: refs/heads/ignite-7324
Commit: fb511a02249353de9de7bdb58a546b61d58b47aa
Parents: 3c5d376
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Dec 28 14:16:52 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Dec 28 14:16:52 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLockFuture.java      | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fb511a02/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index e0a0260..8b773e2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -45,8 +45,8 @@ import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
 import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate;
-import org.apache.ignite.internal.processors.cache.GridCacheVersionedFuture;
 import org.apache.ignite.internal.processors.cache.GridCacheOperation;
+import org.apache.ignite.internal.processors.cache.GridCacheVersionedFuture;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.GridCacheMappedVersion;
 import org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry;
@@ -775,7 +775,8 @@ public final class GridDhtLockFuture extends GridCacheCompoundIdentityFuture<Boo
      */
     private void map(Iterable<GridDhtCacheEntry> entries) {
         synchronized (this) {
-            if (mapped)
+            // Leave fast if timed out.
+            if (mapped || timedOut)
                 return;
 
             mapped = true;
@@ -820,6 +821,23 @@ public final class GridDhtLockFuture extends GridCacheCompoundIdentityFuture<Boo
                     }
                 }
                 catch (GridDhtInvalidPartitionException e) {
+                    synchronized (this) {
+                        if (!timedOut) {
+                            String msg = "Got entry removed exception after the MVCC candidate was added to the " +
+                                "entry (fill fail the lock future) [entry=" + entry + ", fut=" + this + ']';
+
+                            U.error(log, msg, msg, e);
+
+                            onDone(new IgniteCheckedException(msg, e));
+                        }
+                        else {
+                            U.warn(log, "Got entry removed exception after MVCC candidate was added to the entry " +
+                                "(most likely, a deadlock was detected) [entry=" + entry +
+                                ", tx=" + CU.txString(tx) + ']');
+
+                            return;
+                        }
+                    }
                     assert false : "DHT lock should never get invalid partition [err=" + e + ", fut=" + this + ']';
                 }
             }