Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 925DD200B8D for ; Fri, 23 Sep 2016 19:54:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 90FCC160AD0; Fri, 23 Sep 2016 17:54:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A34F0160ACF for ; Fri, 23 Sep 2016 19:54:58 +0200 (CEST) Received: (qmail 30313 invoked by uid 500); 23 Sep 2016 17:54:57 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 30303 invoked by uid 99); 23 Sep 2016 17:54:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2016 17:54:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3B125CD620 for ; Fri, 23 Sep 2016 17:54:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.344 X-Spam-Level: X-Spam-Status: No, score=-4.344 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.124] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 1e5NyLO0GTtC for ; Fri, 23 Sep 2016 17:54:55 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id EF96B5FAE3 for ; Fri, 23 Sep 2016 17:54:54 +0000 (UTC) Received: (qmail 30267 invoked by uid 99); 23 Sep 2016 17:54:54 -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, 23 Sep 2016 17:54:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6523FDFC7E; Fri, 23 Sep 2016 17:54:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dschneider@apache.org To: commits@geode.incubator.apache.org Message-Id: <7db5f21c1da94cff814153e04227a986@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-geode git commit: on retry remove the region entry from the map Date: Fri, 23 Sep 2016 17:54:54 +0000 (UTC) archived-at: Fri, 23 Sep 2016 17:54:59 -0000 Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-1885 [created] 7f1f4b258 on retry remove the region entry from the map Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7f1f4b25 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7f1f4b25 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7f1f4b25 Branch: refs/heads/feature/GEODE-1885 Commit: 7f1f4b25862c94d06ec107929d140b2ce3f95fb7 Parents: 85e97c3 Author: Darrel Schneider Authored: Fri Sep 23 10:53:35 2016 -0700 Committer: Darrel Schneider Committed: Fri Sep 23 10:53:35 2016 -0700 ---------------------------------------------------------------------- .../geode/internal/cache/AbstractRegionMap.java | 44 +++++++++----------- 1 file changed, 20 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7f1f4b25/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java index 33e98b6..65aebd1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java @@ -640,12 +640,11 @@ public abstract class AbstractRegionMap implements RegionMap { while (oldRe != null) { synchronized (oldRe) { if (oldRe.isRemoved() && !oldRe.isTombstone()) { - oldRe = putEntryIfAbsent(key, newRe); - if (oldRe != null) { - if (_isOwnerALocalRegion()) { - _getOwner().getCachePerfStats().incRetries(); - } + if (_isOwnerALocalRegion()) { + _getOwner().getCachePerfStats().incRetries(); } + _getMap().remove(key, oldRe); + oldRe = putEntryIfAbsent(key, newRe); } /* * Entry already exists which should be impossible. @@ -844,10 +843,9 @@ public abstract class AbstractRegionMap implements RegionMap { while (!done && oldRe != null) { synchronized (oldRe) { if (oldRe.isRemovedPhase2()) { + owner.getCachePerfStats().incRetries(); + _getMap().remove(key, oldRe); oldRe = putEntryIfAbsent(key, newRe); - if (oldRe != null) { - owner.getCachePerfStats().incRetries(); - } } else { boolean acceptedVersionTag = false; @@ -1104,10 +1102,9 @@ public abstract class AbstractRegionMap implements RegionMap { while (!opCompleted && oldRe != null) { synchronized (oldRe) { if (oldRe.isRemovedPhase2()) { + owner.getCachePerfStats().incRetries(); + _getMap().remove(event.getKey(), oldRe); oldRe = putEntryIfAbsent(event.getKey(), newRe); - if (oldRe != null) { - owner.getCachePerfStats().incRetries(); - } } else { event.setRegionEntry(oldRe); @@ -1356,6 +1353,8 @@ public abstract class AbstractRegionMap implements RegionMap { && (event.isOriginRemote() || event.getContext() != null || removeRecoveredEntry)); if (!re.isRemoved() || createTombstoneForConflictChecks) { if (re.isRemovedPhase2()) { + _getMap().remove(event.getKey(), re); + owner.getCachePerfStats().incRetries(); retry = true; continue; } @@ -1650,10 +1649,9 @@ public abstract class AbstractRegionMap implements RegionMap { while (!opCompleted && oldRe != null) { synchronized (oldRe) { if (oldRe.isRemovedPhase2()) { + owner.getCachePerfStats().incRetries(); + _getMap().remove(key, oldRe); oldRe = putEntryIfAbsent(key, newRe); - if (oldRe != null) { - owner.getCachePerfStats().incRetries(); - } } else { try { @@ -1874,10 +1872,9 @@ public abstract class AbstractRegionMap implements RegionMap { // that is destroying the RE will see the invalidation and not // proceed to phase 2 of removal. if (oldRe.isRemovedPhase2()) { + owner.getCachePerfStats().incRetries(); + _getMap().remove(event.getKey(), oldRe); oldRe = putEntryIfAbsent(event.getKey(), newRe); - if (oldRe != null) { - owner.getCachePerfStats().incRetries(); - } } else { opCompleted = true; event.setRegionEntry(oldRe); @@ -2335,10 +2332,9 @@ public abstract class AbstractRegionMap implements RegionMap { while (!opCompleted && oldRe != null) { synchronized (oldRe) { if (oldRe.isRemovedPhase2()) { + owner.getCachePerfStats().incRetries(); + _getMap().remove(key, oldRe); oldRe = putEntryIfAbsent(key, newRe); - if (oldRe != null) { - owner.getCachePerfStats().incRetries(); - } } else { opCompleted = true; @@ -2711,8 +2707,9 @@ public abstract class AbstractRegionMap implements RegionMap { // from the map. otherwise we can append an event to it // and change its state if (re.isRemovedPhase2()) { - re = getOrCreateRegionEntry(owner, event, Token.REMOVED_PHASE1, null, onlyExisting, false); _getOwner().getCachePerfStats().incRetries(); + _getMap().remove(event.getKey(), re); + re = getOrCreateRegionEntry(owner, event, Token.REMOVED_PHASE1, null, onlyExisting, false); if (re == null) { // this will happen when onlyExisting is true return null; @@ -3192,10 +3189,9 @@ public abstract class AbstractRegionMap implements RegionMap { while (!opCompleted && oldRe != null) { synchronized (oldRe) { if (oldRe.isRemovedPhase2()) { + owner.getCachePerfStats().incRetries(); + _getMap().remove(key, oldRe); oldRe = putEntryIfAbsent(key, newRe); - if (oldRe != null) { - owner.getCachePerfStats().incRetries(); - } } else { opCompleted = true;