boglesby commented on a change in pull request #5859:
URL: https://github.com/apache/geode/pull/5859#discussion_r556709683



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
##########
@@ -838,24 +838,23 @@ public boolean initialImagePut(final Object key, final 
long lastModified, Object
                 if (result) {
                   if (oldIsTombstone) {
                     owner.unscheduleTombstone(oldRe);
-                    if (newValue != Token.TOMBSTONE) {
-                      lruEntryCreate(oldRe);
-                    } else {
-                      lruEntryUpdate(oldRe);
-                    }
                   }
                   if (newValue == Token.TOMBSTONE) {
                     if (!oldIsDestroyedOrRemoved) {
                       owner.updateSizeOnRemove(key, oldSize);
                     }
                     owner.scheduleTombstone(oldRe, entryVersion);
-                    lruEntryDestroy(oldRe);
+                    if (!oldIsTombstone) {

Review comment:
       Yes. That was part of the problem. The code used to do this 
(abbreviated):
   ```
   if (oldIsTombstone) {
     if (newValue != Token.TOMBSTONE) {
       lruEntryCreate(oldRe);
     } else {
       lruEntryUpdate(oldRe);
     }
   }
   if (newValue == Token.TOMBSTONE) {
     lruEntryDestroy(oldRe);
   }
   ```
   So if `oldIsTombstone` and `newValue == Token.TOMBSTONE`, both 
`lruEntryUpdate` and `lruEntryDestroy` were called.
   
   And, `lruEntryCreate` \ `lruEntryUpdate` were not called at all when 
`newValue != Token.TOMBSTONE`.




----------------------------------------------------------------
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:
[email protected]


Reply via email to