ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1.5 Fixed hang on metadata update inside put in atomic cache when topology read lock is held.
Date Mon, 21 Dec 2015 11:27:28 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1537 6447fa96d -> 111e44743


ignite-1.5 Fixed hang on metadata update inside put in atomic cache when topology read lock
is held.


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

Branch: refs/heads/ignite-1537
Commit: 111e44743c1f5ebef5a75d92c030b68ed22bea1b
Parents: 6447fa9
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Dec 21 14:27:20 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Dec 21 14:27:20 2015 +0300

----------------------------------------------------------------------
 ...NearOptimisticSerializableTxPrepareFuture.java |  8 +++-----
 .../near/GridNearOptimisticTxPrepareFuture.java   |  8 +++-----
 .../GridNearOptimisticTxPrepareFutureAdapter.java | 18 ++++++------------
 .../near/GridNearPessimisticTxPrepareFuture.java  |  4 +++-
 .../cache/distributed/near/GridNearTxLocal.java   |  6 +++---
 .../near/GridNearTxPrepareFutureAdapter.java      |  4 +++-
 6 files changed, 21 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/111e4474/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
index 7a1789d..afc2d6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
@@ -83,12 +83,10 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
     /**
      * @param cctx Context.
      * @param tx Transaction.
-     * @param waitTopFut If {@code false} does not wait for affinity change future.
      */
     public GridNearOptimisticSerializableTxPrepareFuture(GridCacheSharedContext cctx,
-        GridNearTxLocal tx,
-        boolean waitTopFut) {
-        super(cctx, tx, waitTopFut);
+        GridNearTxLocal tx) {
+        super(cctx, tx);
 
         assert tx.optimistic() && tx.serializable() : tx;
 
@@ -859,7 +857,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
          * @param res Response.
          */
         private void remap(final GridNearTxPrepareResponse res) {
-            prepareOnTopology(true, new Runnable() {
+            prepareOnTopology(true, true, new Runnable() {
                 @Override public void run() {
                     onDone(res);
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/111e4474/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 706f82c..773259e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -71,12 +71,10 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
     /**
      * @param cctx Context.
      * @param tx Transaction.
-     * @param waitTopFut If {@code false} does not wait for affinity change future.
      */
     public GridNearOptimisticTxPrepareFuture(GridCacheSharedContext cctx,
-        GridNearTxLocal tx,
-        boolean waitTopFut) {
-        super(cctx, tx, waitTopFut);
+        GridNearTxLocal tx) {
+        super(cctx, tx);
 
         assert tx.optimistic() && !tx.serializable() : tx;
     }
@@ -751,7 +749,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
          *
          */
         private void remap() {
-            prepareOnTopology(true, new Runnable() {
+            prepareOnTopology(true, true, new Runnable() {
                 @Override public void run() {
                     onDone((GridNearTxPrepareResponse)null);
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/111e4474/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
index f836166..b6d4342 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
@@ -38,26 +38,19 @@ import org.jetbrains.annotations.Nullable;
  *
  */
 public abstract class GridNearOptimisticTxPrepareFutureAdapter extends GridNearTxPrepareFutureAdapter
{
-    /** */
-    private final boolean waitTopFut;
-
     /**
      * @param cctx Context.
      * @param tx Transaction.
-     * @param waitTopFut If {@code false} does not wait for affinity change future.
      */
     public GridNearOptimisticTxPrepareFutureAdapter(GridCacheSharedContext cctx,
-        GridNearTxLocal tx,
-        boolean waitTopFut) {
+        GridNearTxLocal tx) {
         super(cctx, tx);
 
         assert tx.optimistic() : tx;
-
-        this.waitTopFut = waitTopFut;
     }
 
     /** {@inheritDoc} */
-    @Override public final void prepare() {
+    @Override public final void prepare(boolean waitTopFut) {
         // Obtain the topology version to use.
         long threadId = Thread.currentThread().getId();
 
@@ -81,7 +74,7 @@ public abstract class GridNearOptimisticTxPrepareFutureAdapter extends GridNearT
             return;
         }
 
-        prepareOnTopology(false, null);
+        prepareOnTopology(waitTopFut, false, null);
     }
 
     /**
@@ -101,10 +94,11 @@ public abstract class GridNearOptimisticTxPrepareFutureAdapter extends
GridNearT
     }
 
     /**
+     * @param waitTopFut If {@code false} does not wait for affinity change future.
      * @param remap Remap flag.
      * @param c Optional closure to run after map.
      */
-    protected final void prepareOnTopology(final boolean remap, @Nullable final Runnable
c) {
+    protected final void prepareOnTopology(boolean waitTopFut, final boolean remap, @Nullable
final Runnable c) {
         GridDhtTopologyFuture topFut = topologyReadLock();
 
         AffinityTopologyVersion topVer = null;
@@ -165,7 +159,7 @@ public abstract class GridNearOptimisticTxPrepareFutureAdapter extends
GridNearT
                             try {
                                 fut.get();
 
-                                prepareOnTopology(remap, c);
+                                prepareOnTopology(true, remap, c);
                             }
                             catch (IgniteCheckedException e) {
                                 onDone(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/111e4474/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index ffe5373..691a2a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -135,7 +135,9 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
     }
 
     /** {@inheritDoc} */
-    @Override public void prepare() {
+    @Override public void prepare(boolean waitTopFut) {
+        assert waitTopFut;
+
         if (!tx.state(PREPARING)) {
             if (tx.setRollbackOnly()) {
                 if (tx.timedOut())

http://git-wip-us.apache.org/repos/asf/ignite/blob/111e4474/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index e5ccad1..3ee2981 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -798,8 +798,8 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
             // Future must be created before any exception can be thrown.
             if (optimistic()) {
                 fut = serializable() ?
-                    new GridNearOptimisticSerializableTxPrepareFuture(cctx, this, waitTopFut)
:
-                    new GridNearOptimisticTxPrepareFuture(cctx, this, waitTopFut);
+                    new GridNearOptimisticSerializableTxPrepareFuture(cctx, this) :
+                    new GridNearOptimisticTxPrepareFuture(cctx, this);
             }
             else
                 fut = new GridNearPessimisticTxPrepareFuture(cctx, this);
@@ -813,7 +813,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
 
         mapExplicitLocks();
 
-        fut.prepare();
+        fut.prepare(waitTopFut);
 
         return fut;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/111e4474/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
index 52cad91..a587687 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
@@ -130,8 +130,10 @@ public abstract class GridNearTxPrepareFutureAdapter extends
 
     /**
      * Prepares transaction.
+     *
+     * @param waitTopFut If {@code false} does not wait for affinity change future.
      */
-    public abstract void prepare();
+    public abstract void prepare(boolean waitTopFut);
 
     /**
      * @param nodeId Sender.


Mime
View raw message