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 6E6612007D0 for ; Tue, 10 May 2016 23:08:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6D57816098A; Tue, 10 May 2016 21:08:29 +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 8A7C2160877 for ; Tue, 10 May 2016 23:08:28 +0200 (CEST) Received: (qmail 68053 invoked by uid 500); 10 May 2016 21:08:22 -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 68044 invoked by uid 99); 10 May 2016 21:08:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 May 2016 21:08:22 +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 5548CC0187 for ; Tue, 10 May 2016 21:08:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 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=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id cKTA4kQCJCCg for ; Tue, 10 May 2016 21:08:20 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 6EED360D32 for ; Tue, 10 May 2016 21:08:19 +0000 (UTC) Received: (qmail 67392 invoked by uid 99); 10 May 2016 21:08:18 -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, 10 May 2016 21:08:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5112BEAB44; Tue, 10 May 2016 21:08:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Tue, 10 May 2016 21:08:21 -0000 Message-Id: <56a6086d13ca46a892f84c47339242b0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/9] incubator-geode git commit: GEODE-92: PR with entry eviction 1 leaves 3 entries in memory with async overflow archived-at: Tue, 10 May 2016 21:08:29 -0000 GEODE-92: PR with entry eviction 1 leaves 3 entries in memory with async overflow Found that invoking lruUpdateCallback multiple times with in a single get could mess up entry eviction state. So disabled lru callback and invoked at the end of the operation. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/f4b06438 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f4b06438 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f4b06438 Branch: refs/heads/feature/GEODE-951 Commit: f4b0643829b00d0ba9b0852fdd3a679812395545 Parents: 44c2f39 Author: Sai Boorlagadda Authored: Tue Apr 26 13:31:25 2016 -0700 Committer: Sai Boorlagadda Committed: Tue May 10 08:33:09 2016 -0700 ---------------------------------------------------------------------- .../gemfire/internal/cache/AbstractLRURegionMap.java | 9 +++------ .../gemstone/gemfire/internal/cache/LocalRegion.java | 6 ++++++ .../cache/PartitionedRegionStatsJUnitTest.java | 14 ++------------ 3 files changed, 11 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f4b06438/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java index 2cc7a55..14c431d 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java @@ -197,17 +197,14 @@ public abstract class AbstractLRURegionMap extends AbstractRegionMap { int delta = le.updateEntrySize(_getCCHelper(), new CDValueWrapper(v)); if (delta != 0) { result = true; - boolean needToDisableCallbacks = !getCallbackDisabled(); - if (needToDisableCallbacks) { - setCallbackDisabled(true); - } + boolean disabledLURCallbacks = disableLruUpdateCallback(); // by making sure that callbacks are disabled when we call // setDelta; it ensures that the setDelta will just inc the delta // value and not call lruUpdateCallback which we call in // finishChangeValueForm setDelta(delta); - if (needToDisableCallbacks) { - setCallbackDisabled(false); + if (disabledLURCallbacks) { + enableLruUpdateCallback(); } } // fix for bug 42090 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f4b06438/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java index 3ad294c..e9f5819 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java @@ -1298,6 +1298,7 @@ public class LocalRegion extends AbstractRegion @Retained protected final Object getDeserialized(RegionEntry re, boolean updateStats, boolean disableCopyOnRead, boolean preferCD, boolean retainResult) { assert !retainResult || preferCD; + boolean disabledLRUCallback = this.entries.disableLruUpdateCallback(); try { @Retained Object v = null; try { @@ -1340,6 +1341,11 @@ public class LocalRegion extends AbstractRegion IllegalArgumentException iae = new IllegalArgumentException(LocalizedStrings.DONT_RELEASE.toLocalizedString("Error while deserializing value for key="+re.getKey())); iae.initCause(i); throw iae; + } finally { + if(disabledLRUCallback) { + this.entries.enableLruUpdateCallback(); + this.entries.lruUpdateCallback(); + } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f4b06438/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java index 167b89b..1a3277c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java @@ -436,11 +436,7 @@ public class PartitionedRegionStatsJUnitTest pr.getDiskStore().flush(); - //Workaround for GEODE-92. We are leaving more than 1 entry in memory. To - //validate that stats, let's confirm the stats match what is actually in - //memory - //int entriesInMem = 1; - int entriesInMem = countEntriesInMem(pr); + int entriesInMem = 1; assertEquals(singleEntryMemSize * entriesInMem, stats.getLong("dataStoreBytesInUse")); assertEquals(numEntries , stats.getInt("dataStoreEntryCount")); @@ -475,13 +471,7 @@ public class PartitionedRegionStatsJUnitTest System.out.println("----Done with random operations"); numEntries = pr.entryCount(); - - //Workaround for GEODE-92. We are leaving more than 1 entry in memory. To - //validate that stats, let's confirm the stats match what is actually in - //memory - //entriesInMem = 1; - entriesInMem = countEntriesInMem(pr); - + assertEquals(singleEntryMemSize * entriesInMem, stats.getLong("dataStoreBytesInUse")); assertEquals(numEntries , stats.getInt("dataStoreEntryCount")); assertEquals((numEntries - entriesInMem) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk());