[ 
https://issues.apache.org/jira/browse/GEODE-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15450452#comment-15450452
 ] 

ASF subversion and git services commented on GEODE-1830:
--------------------------------------------------------

Commit 0c8b2b3b8f9f3da6ccf25fd17ab9313a22ea9d0a in incubator-geode's branch 
refs/heads/develop from [~upthewaterspout]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;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: https://issues.apache.org/jira/browse/GEODE-1830
>             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 configuration:
>  * 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
(v6.3.4#6332)

Reply via email to