ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [25/50] [abbrv] ignite git commit: IGNITE-264 - Fixing tests WIP.
Date Thu, 03 Sep 2015 01:03:34 GMT
IGNITE-264 - Fixing tests WIP.


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

Branch: refs/heads/ignite-264
Commit: a733984d48e2d45aee2d7c6fa2702bf5205a80ca
Parents: ed5edc1
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Wed Aug 12 14:53:15 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Wed Aug 12 14:53:15 2015 -0700

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtTxFinishFuture.java        | 2 +-
 .../cache/distributed/near/GridNearTxFinishFuture.java      | 2 +-
 .../processors/cache/transactions/IgniteTxLocalAdapter.java | 9 ++++++---
 .../processors/cache/transactions/IgniteTxManager.java      | 5 ++++-
 4 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a733984d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index c01f85d..8bd518b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -209,7 +209,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
     @Override public boolean onDone(IgniteInternalTx tx, Throwable err) {
         if (initialized() || err != null) {
             if (this.tx.onePhaseCommit() && (this.tx.state() == COMMITTING))
-                this.tx.tmCommit();
+                this.tx.tmFinish(err == null);
 
             Throwable e = this.err.get();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a733984d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 94c5150..1e16982 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -232,7 +232,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
             if (this.tx.onePhaseCommit() && (this.tx.state() == COMMITTING)) {
                 finishOnePhase();
 
-                this.tx.tmCommit();
+                this.tx.tmFinish(err == null);
             }
 
             Throwable th = this.err.get();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a733984d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 9e4473b..f800135 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -1028,14 +1028,17 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     /**
      * Commits transaction to transaction manager. Used for one-phase commit transactions
only.
      */
-    public void tmCommit() {
+    public void tmFinish(boolean commit) {
         assert onePhaseCommit();
 
         if (doneFlag.compareAndSet(false, true)) {
             // Unlock all locks.
-            cctx.tm().commitTx(this);
+            if (commit)
+                cctx.tm().commitTx(this);
+            else
+                cctx.tm().rollbackTx(this);
 
-            state(COMMITTED);
+            state(commit ? COMMITTED : ROLLED_BACK);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a733984d/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 f3bca17..124e71d 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
@@ -1118,9 +1118,12 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter
{
         if (!((committed != null && committed) || tx.writeSet().isEmpty() || tx.isSystemInvalidate()))
{
             uncommitTx(tx);
 
+            GridCacheVersion first = completedVers.isEmpty() ? null : completedVers.firstKey();
+            GridCacheVersion last = completedVers.isEmpty() ? null : completedVers.lastKey();
+
             throw new IgniteException("Missing commit version (consider increasing " +
                 IGNITE_MAX_COMPLETED_TX_COUNT + " system property) [ver=" + tx.xidVersion()
+ ", firstVer=" +
-                completedVers.firstKey() + ", lastVer=" + completedVers.lastKey() + ", tx="
+ tx.xid() + ']');
+                first + ", lastVer=" + last + ", tx=" + tx.xid() + ']');
         }
 
         ConcurrentMap<GridCacheVersion, IgniteInternalTx> txIdMap = transactionMap(tx);


Mime
View raw message