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

Darrel Schneider commented on GEODE-2535:
-----------------------------------------

Another related bug is code in the same basicUpdate method that uses 
"did.getKeyId()" to determine the current state of the region entry (i.e. if 
the value is inVM or onDisk).
I think the code would be much clearer if we quit negating the recoveredKeyId 
on RecoveredEntry and instead just added a boolean flag to it that lets us say 
we have a value or it is still on disk.
The keyId itself on DiskId should not be mutated; it should be final. The only 
place in the code that calls DiskId.isKeyIdNegative simply makes it positive so 
I think if we just leave it positive all the time the code will be easier to 
understand. basicUpdate will need to be changed to no longer use 
"did.getKeyId()" to determine the current state. But this can be done in the 
same way updateRecoveredEntry does it.

> DiskId keyId is not correctly updated
> -------------------------------------
>
>                 Key: GEODE-2535
>                 URL: https://issues.apache.org/jira/browse/GEODE-2535
>             Project: Geode
>          Issue Type: Bug
>          Components: persistence
>            Reporter: Darrel Schneider
>
> On a persistent region the DiskId keyId will be set negative if the value is 
> not in memory but can be read from disk.
> The code correctly sets it the first time an entry is recovered from disk but 
> does not correctly update it if a that same entry is recovered more than once 
> from disk. This can happen when a krf for an oplog does not exist. The same 
> entry can have multiple records for the same key.
> They code that does not correctly update DiskId keyId is in these methods:
> org.apache.geode.internal.cache.DiskEntry.Helper.basicUpdate(DiskEntry, 
> LocalRegion, Object, EntryEventImpl): see the section that handles 
> RecoveredEntry
> and 
> org.apache.geode.internal.cache.DiskEntry.Helper.updateRecoveredEntry(PlaceHolderDiskRegion,
>  DiskEntry, RecoveredEntry, RegionEntryContext)
> The only issue with not updating this keyId is that it can cause the "inVM" 
> and "onDisk" statistics to be incorrect.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to