You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/01/07 18:17:53 UTC
[GitHub] [geode] dschneider-pivotal commented on a change in pull request #5859: GEODE-8278: Modified to cause lruEntryUpdate to be called
dschneider-pivotal commented on a change in pull request #5859:
URL: https://github.com/apache/geode/pull/5859#discussion_r553500739
##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
##########
@@ -838,11 +838,11 @@ public boolean initialImagePut(final Object key, final long lastModified, Object
if (result) {
if (oldIsTombstone) {
owner.unscheduleTombstone(oldRe);
- if (newValue != Token.TOMBSTONE) {
Review comment:
I agree with Alberto. I don't see any reason to do call lruEntryUpdate/lruEntryCreate if the next thing we are going to do is call lruEntryDestroy. But it does seem like this code should make sure to call one of lruEntry(Create/Update/Destroy). So I would change it to be:
` if (result) {
if (oldIsTombstone) {
owner.unscheduleTombstone(oldRe);
}
if (newValue == Token.TOMBSTONE) {
if (!oldIsDestroyedOrRemoved) {
owner.updateSizeOnRemove(key, oldSize);
}
owner.scheduleTombstone(oldRe, entryVersion);
lruEntryDestroy(oldRe);
} else {
int newSize = owner.calculateRegionEntryValueSize(oldRe);
if (!oldIsTombstone) {
owner.updateSizeOnPut(key, oldSize, newSize);
lruEntryUpdate(oldRe);
} else {
owner.updateSizeOnCreate(key, newSize);
lruEntryCreate(oldRe);
}
EntryLogger.logInitialImagePut(_getOwnerObject(), key, newValue);
}
}
`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org