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 1484219FD2 for ; Fri, 1 Apr 2016 11:24:02 +0000 (UTC) Received: (qmail 24331 invoked by uid 500); 1 Apr 2016 11:24:01 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 24255 invoked by uid 500); 1 Apr 2016 11:24:01 -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 24226 invoked by uid 99); 1 Apr 2016 11:24:01 -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; Fri, 01 Apr 2016 11:24:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7BB92DFC71; Fri, 1 Apr 2016 11:24:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Fri, 01 Apr 2016 11:24:01 -0000 Message-Id: <1820d91a2416477fb8f211fbfce18a8d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] ignite git commit: IGNITE-2925: Fixed conflict resolution in ATOMIC cache. Repository: ignite Updated Branches: refs/heads/ignite-2934 b6a0078a9 -> b8fec8dfe IGNITE-2925: Fixed conflict resolution in ATOMIC cache. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1aa2a2ba Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1aa2a2ba Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1aa2a2ba Branch: refs/heads/ignite-2934 Commit: 1aa2a2baf9f3499f815f7a6865a8bf71273ecf9a Parents: 42048c2 Author: vozerov-gridgain Authored: Fri Apr 1 14:06:41 2016 +0300 Committer: vozerov-gridgain Committed: Fri Apr 1 14:06:41 2016 +0300 ---------------------------------------------------------------------- .../dht/atomic/GridDhtAtomicCache.java | 28 +++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/1aa2a2ba/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index f85862d..1797acd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -1062,6 +1062,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { @Nullable final CacheEntryPredicate[] filter, boolean waitTopFut ) { + CacheOperationContext opCtx = ctx.operationContextPerCall(); + GridCacheOperation op; Collection vals; @@ -1078,7 +1080,27 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { vals = null; } - CacheOperationContext opCtx = ctx.operationContextPerCall(); + GridCacheDrInfo conflictPutVal = null; + GridCacheVersion conflictRmvVer = null; + + if (opCtx != null && opCtx.hasDataCenterId()) { + Byte dcId = opCtx.dataCenterId(); + + assert dcId != null; + + if (op == UPDATE) { + conflictPutVal = new GridCacheDrInfo(ctx.toCacheObject(val), ctx.versions().next(dcId)); + + vals = null; + } + else if (op == GridCacheOperation.TRANSFORM) { + conflictPutVal = new GridCacheDrInfo(proc, ctx.versions().next(dcId)); + + vals = null; + } + else + conflictRmvVer = ctx.versions().next(dcId); + } return new GridNearAtomicUpdateFuture( ctx, @@ -1088,8 +1110,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { Collections.singletonList(key), vals, invokeArgs, - null, - null, + conflictPutVal != null ? Collections.singleton(conflictPutVal) : null, + conflictRmvVer != null ? Collections.singleton(conflictRmvVer) : null, retval, false, opCtx != null ? opCtx.expiry() : null,