This is an automated email from the ASF dual-hosted git repository. eshu11 pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new 2049768 GEODE-8790: Evicted entries sometimes remain in region map (#5851) 2049768 is described below commit 2049768ba20aa44a587612f0d328eeaf6e9b1ad8 Author: Louis Jacome <jaco...@vmware.com> AuthorDate: Thu Jan 7 18:33:15 2021 -0800 GEODE-8790: Evicted entries sometimes remain in region map (#5851) - Modifies regionMapDestroy.retryRemoveWithTombstone to handle case where an evicted entry was left in the region map when concurrency checks is enabled --- .../apache/geode/internal/cache/map/RegionMapDestroy.java | 12 +++++++++--- .../apache/geode/internal/cache/AbstractRegionMapTest.java | 6 +----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/map/RegionMapDestroy.java b/geode-core/src/main/java/org/apache/geode/internal/cache/map/RegionMapDestroy.java index c21dddb..5b2e779 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/map/RegionMapDestroy.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/map/RegionMapDestroy.java @@ -366,11 +366,17 @@ public class RegionMapDestroy { retry = true; doContinue = true; return; - } else if (!isEviction) { + } else { try { - handleEntryNotFound(); + if (!isEviction) { + handleEntryNotFound(); + } } finally { - removeEntryOrLeaveTombstone(); + if (isEviction && newRegionEntry.isTombstone()) { + return; + } else { + removeEntryOrLeaveTombstone(); + } } } } // synchronized(newRegionEntry) diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionMapTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionMapTest.java index 987effc..70afcc4 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionMapTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionMapTest.java @@ -634,11 +634,7 @@ public class AbstractRegionMapTest { anyBoolean(), anyBoolean()); verify(arm._getOwner(), never()).basicDestroyPart3(any(), any(), anyBoolean(), anyBoolean(), anyBoolean(), any()); - // This seems to be a bug. We should not leave an entry in the map - // added by the destroy call if destroy returns false. - assertThat(arm.getEntryMap().containsKey(event.getKey())).isTrue(); - RegionEntry re = (RegionEntry) arm.getEntryMap().get(event.getKey()); - assertThat(re.getValueAsToken()).isEqualTo(Token.REMOVED_PHASE1); + assertThat(arm.getEntryMap().containsKey(event.getKey())).isFalse(); } @Test