geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sai_boorlaga...@apache.org
Subject incubator-geode git commit: fixed recovery stats test failure
Date Tue, 14 Jun 2016 16:49:34 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-93 dce9316fe -> 1c34a2c72


fixed recovery stats test failure


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1c34a2c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1c34a2c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1c34a2c7

Branch: refs/heads/feature/GEODE-93
Commit: 1c34a2c7285a81a974573335e4993298879dd383
Parents: dce9316
Author: Sai Boorlagadda <sboorlagadda@pivotal.io>
Authored: Tue Jun 14 09:42:33 2016 -0700
Committer: Sai Boorlagadda <sboorlagadda@pivotal.io>
Committed: Tue Jun 14 09:42:33 2016 -0700

----------------------------------------------------------------------
 .../gemfire/internal/cache/DiskEntry.java       | 48 ++++++++++----------
 1 file changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1c34a2c7/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
index 576a2b1..9d58fd2 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
@@ -956,17 +956,7 @@ public interface DiskEntry extends RegionEntry {
           did.setUserBits(re.getUserBits());
           oldValueLength = did.getValueLength();
           did.setValueLength(re.getValueLength());
-          // The following undo and then do fixes bug 41849
-          // First, undo the stats done for the previous recovered value
-          if (oldKeyId < 0) {
-            dr.incNumOverflowOnDisk(-1L);
-            dr.incNumOverflowBytesOnDisk(-oldValueLength);
-            incrementBucketStats(region, 0/*InVM*/, -1/*OnDisk*/, -oldValueLength);
-          } else {
-            dr.incNumEntriesInVM(-1L);
-            incrementBucketStats(region, -1/*InVM*/, 0/*OnDisk*/, 0);
-          }
-          // Second, do the stats done for the current recovered value
+          
           if (re.getRecoveredKeyId() < 0) {
             if (!entry.isValueNull()) {
               try {
@@ -975,16 +965,26 @@ public interface DiskEntry extends RegionEntry {
               }finally {
                 entry.afterValueOverflow(region);
               }
-              
             }
-            dr.incNumOverflowOnDisk(1L);
-            dr.incNumOverflowBytesOnDisk(did.getValueLength());
-            incrementBucketStats(region, 0/*InVM*/, 1/*OnDisk*/,
-                                 did.getValueLength());
           } else {
             entry.setValueWithContext(region, entry.prepareValueForCache(region, re.getValue(),
false));
-            dr.incNumEntriesInVM(1L);
-            incrementBucketStats(region, 1/*InVM*/, 0/*OnDisk*/, 0);
+          }
+          
+          if (re.getRecoveredKeyId() < 0) {
+            if(oldKeyId >= 0) {
+              dr.incNumEntriesInVM(-1L);
+              dr.incNumOverflowOnDisk(1L);
+              dr.incNumOverflowBytesOnDisk(did.getValueLength());
+              incrementBucketStats(region, -1/*InVM*/, 1/*OnDisk*/,
+                                   did.getValueLength());
+            }
+          } else {
+            if(oldKeyId < 0) {
+              dr.incNumEntriesInVM(1L);
+              dr.incNumOverflowOnDisk(-1L);
+              dr.incNumOverflowBytesOnDisk(-oldValueLength);
+              incrementBucketStats(region, 1/*InVM*/, -1/*OnDisk*/, -oldValueLength);
+            }
           }
         }
         else {
@@ -1064,12 +1064,7 @@ public interface DiskEntry extends RegionEntry {
             dr.incNumEntriesInVM(1L);
             incrementBucketStats(region, 1/*InVM*/, 0/*OnDisk*/, 0);
           }
-        }
-        if (entry instanceof LRUEntry) {
-          LRUEntry le = (LRUEntry)entry;
-          le.unsetEvicted();          
-        }
-        if (!Token.isRemovedFromDisk(newValue)) {
+          
           if(newValue == Token.TOMBSTONE) {
             if (oldValue == null) {
               dr.incNumOverflowOnDisk(-1L);
@@ -1091,6 +1086,11 @@ public interface DiskEntry extends RegionEntry {
             }
           }
         }
+        if (entry instanceof LRUEntry) {
+          LRUEntry le = (LRUEntry)entry;
+          le.unsetEvicted();          
+        }
+
       }
       } finally {
         if (syncObj == did) {


Mime
View raw message