Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A16AB1780B for ; Thu, 3 Sep 2015 01:03:11 +0000 (UTC) Received: (qmail 83127 invoked by uid 500); 3 Sep 2015 01:03:11 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 83040 invoked by uid 500); 3 Sep 2015 01:03:11 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 82439 invoked by uid 99); 3 Sep 2015 01:03:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2015 01:03:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 03C0FE7E2E; Thu, 3 Sep 2015 01:03:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agoncharuk@apache.org To: commits@ignite.apache.org Date: Thu, 03 Sep 2015 01:03:27 -0000 Message-Id: <5cdfeb42a2f24d36aa9c711766ec9b81@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [18/50] [abbrv] ignite git commit: IGNITE-264 - Fixing tests WIP. 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/e7fa1b32 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e7fa1b32 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e7fa1b32 Branch: refs/heads/ignite-264 Commit: e7fa1b324dd569fa37d5bfc31a76c321fb5e80d3 Parents: 4bc5d50 Author: Alexey Goncharuk Authored: Mon Aug 10 17:19:49 2015 -0700 Committer: Alexey Goncharuk Committed: Mon Aug 10 17:19:49 2015 -0700 ---------------------------------------------------------------------- .../distributed/dht/GridDhtTxLocalAdapter.java | 15 +++++++++++++- .../distributed/dht/GridDhtTxPrepareFuture.java | 15 ++++---------- .../GridNearPessimisticTxPrepareFuture.java | 3 +++ .../cache/transactions/IgniteTxHandler.java | 7 +++++-- .../cache/IgniteOnePhaseCommitNearSelfTest.java | 6 ++++-- .../dht/GridCacheTxNodeFailureSelfTest.java | 21 ++++++++++++++++++-- 6 files changed, 49 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e7fa1b32/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java index d9e85a5..30cee9d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java @@ -65,6 +65,9 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { /** */ protected boolean explicitLock; + /** Flag indicating that originating node has near cache. */ + private boolean nearOnOriginatingNode; + /** Nodes where transactions were started on lock step. */ private Set lockTxNodes; @@ -144,6 +147,15 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { } /** + * Sets flag that indicates that originating node has a near cache that participates in this transaction. + * + * @param hasNear Has near cache flag. + */ + public void nearOnOriginatingNode(boolean hasNear) { + nearOnOriginatingNode = hasNear; + } + + /** * @return {@code True} if explicit lock transaction. */ public boolean explicitLock() { @@ -803,13 +815,14 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { * @return {@code True} if transaction is finished on prepare step. */ protected final boolean commitOnPrepare() { - return onePhaseCommit() && !near(); + return onePhaseCommit() && !near() && !nearOnOriginatingNode; } /** * @param prepFut Prepare future. * @return If transaction if finished on prepare step returns future which is completed after transaction finish. */ + @SuppressWarnings("TypeMayBeWeakened") protected final IgniteInternalFuture chainOnePhasePrepare( final GridDhtTxPrepareFuture prepFut) { if (commitOnPrepare()) { http://git-wip-us.apache.org/repos/asf/ignite/blob/e7fa1b32/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java index 34f9b2a..dae49a1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java @@ -487,11 +487,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture