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 0CFA618CE2 for ; Tue, 2 Jun 2015 17:59:21 +0000 (UTC) Received: (qmail 48225 invoked by uid 500); 2 Jun 2015 17:59:21 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 48191 invoked by uid 500); 2 Jun 2015 17:59:21 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 48178 invoked by uid 99); 2 Jun 2015 17:59:20 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2015 17:59:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 809C8C0940 for ; Tue, 2 Jun 2015 17:59:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id j-fYGMe5j5TI for ; Tue, 2 Jun 2015 17:59:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id A382247C31 for ; Tue, 2 Jun 2015 17:59:09 +0000 (UTC) Received: (qmail 48110 invoked by uid 99); 2 Jun 2015 17:59:09 -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; Tue, 02 Jun 2015 17:59:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EDF21DFBDC; Tue, 2 Jun 2015 17:59:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 02 Jun 2015 17:59:10 -0000 Message-Id: <4da7545d309e4503a7661d518fbfc026@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/5] incubator-ignite git commit: ignite-968 lock entries after topology version check, otherwise can add entry in evicted partition ignite-968 lock entries after topology version check, otherwise can add entry in evicted partition Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3ebb1c03 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3ebb1c03 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3ebb1c03 Branch: refs/heads/ignite-sprint-5 Commit: 3ebb1c03ad8b13714f85d7a464a126f4ca931347 Parents: 3c1f0ca Author: sboikov Authored: Tue Jun 2 12:46:08 2015 +0300 Committer: sboikov Committed: Tue Jun 2 12:49:02 2015 +0300 ---------------------------------------------------------------------- .../distributed/dht/atomic/GridDhtAtomicCache.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3ebb1c03/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 69f5501..9ca80f9 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 @@ -1024,9 +1024,7 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { IgniteCacheExpiryPolicy expiry = null; try { - // If batch store update is enabled, we need to lock all entries. - // First, need to acquire locks on cache entries, then check filter. - List locked = lockEntries(keys, req.topologyVersion()); + List locked = null; Collection> deleted = null; try { @@ -1043,7 +1041,7 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { } // Do not check topology version for CLOCK versioning since - // partition exchange will wait for near update future. + // partition exchange will wait for near update future (if future is on server node). // Also do not check topology version if topology was locked on near node by // external transaction or explicit lock. if ((req.fastMap() && !req.clientRequest()) || req.topologyLocked() || @@ -1056,6 +1054,10 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { return; } + // If batch store update is enabled, we need to lock all entries. + // First, need to acquire locks on cache entries, then check filter. + locked = lockEntries(keys, req.topologyVersion()); + boolean hasNear = ctx.discovery().cacheNearNode(node, name()); GridCacheVersion ver = req.updateVersion(); @@ -1144,7 +1146,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { e.printStackTrace(); } finally { - unlockEntries(locked, req.topologyVersion()); + if (locked != null) + unlockEntries(locked, req.topologyVersion()); // Enqueue if necessary after locks release. if (deleted != null) {