geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (GEODE-1830) Client CacheListener receives a TOMBSTONE when user calls region.get
Date Wed, 31 Aug 2016 19:52:22 GMT


ASF subversion and git services commented on GEODE-1830:

Commit 0c8b2b3b8f9f3da6ccf25fd17ab9313a22ea9d0a in incubator-geode's branch refs/heads/feature/GEODE-420
from [~upthewaterspout]
[;h=0c8b2b3 ]

GEODE-1830: Use event, not entry, to check for a tombstone

In LocalRegion.basicPutPart2, check for a TOMBSTONE using
EntryEvent.getNewValue. Previously we were checking the
RegionEntry.isTombstone, but in the case of a PROXY region, the
RegionEntry is marker that does not set isTombstone to true.

> Client CacheListener receives a TOMBSTONE when user calls region.get
> --------------------------------------------------------------------
>                 Key: GEODE-1830
>                 URL:
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>            Reporter: Dan Smith
>            Assignee: Dan Smith
> A user's CacheListener on the client can see a TOMBSTONE as the newValue in this specific
>  * The region is created using  ClientRegionShortcut.PROXY (not CACHING_PROXY)
>  * The value on the server is a TOMBSTONE (the entry has been created and then destroyed)
>  * The user does a key for the destroyed key.
> Looking at the code, the problem seems to be in LocalRegion.basicPutPart2. The code checks
to see if entry.isTomstone is true:
> {code}
>   protected long basicPutPart2(EntryEventImpl event, RegionEntry entry,
>       boolean isInitialized, long lastModified,
>       boolean clearConflict)
>   {
>     final boolean isNewKey = event.getOperation().isCreate();
>     final boolean invokeCallbacks = !entry.isTombstone(); // put() is creating a tombstone
> {code}
> Unfortunately, if the client is using ClientRegionShortcut.PROXY, the code calling this
is ProxyRegionMap.basicPut, which passes a *static* markerEntry object, which will always
return false for isTombstone. So the listener is invoked, despite the check for entry.isTombstone.

This message was sent by Atlassian JIRA

View raw message