geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [geode] 01/02: Improve debug messages
Date Fri, 08 Jun 2018 17:50:20 GMT
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch GEM-1722-1629
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 38c92e78a139e1042b7091e98b2cdb2ac2f3ac2c
Author: Kirk Lund <klund@apache.org>
AuthorDate: Fri Jun 8 10:48:13 2018 -0700

    Improve debug messages
---
 .../org/apache/geode/internal/cache/AbstractRegionMap.java  | 12 +++++++-----
 .../java/org/apache/geode/internal/cache/LocalRegion.java   | 13 +++++++++++--
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
index 50b5371..dba07ab 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
@@ -2586,18 +2586,20 @@ public abstract class AbstractRegionMap
         }
       }
       if (deadEntries != numTombstones.get()) {
-        if (logger.isDebugEnabled()) {
-          logger.debug("tombstone count ({}) does not match actual number of tombstones ({})",
-              numTombstones, deadEntries, new Exception());
+        if (logger.isInfoEnabled()) {
+          String message = "GEM-1722: tombstone count (" + numTombstones
+              + ") does not match actual number of entries with tombstones (" + deadEntries
+ ")";
+          logger.info(message);
         }
         return false;
       } else {
-        if (logger.isDebugEnabled()) {
-          logger.debug("tombstone count verified");
+        if (logger.isInfoEnabled()) {
+          logger.info("GEM-1722: tombstone count matches number of entries with tombstones");
         }
       }
     } catch (Exception e) {
       // ignore
+      logger.info("GEM-1722: verifyTombstoneCount ignored exception", e);
     }
     return true;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index ec65991..48ff265 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -219,6 +219,7 @@ import org.apache.geode.internal.offheap.annotations.Released;
 import org.apache.geode.internal.offheap.annotations.Retained;
 import org.apache.geode.internal.offheap.annotations.Unretained;
 import org.apache.geode.internal.sequencelog.EntryLogger;
+import org.apache.geode.internal.util.concurrent.ConcurrentMapWithReusableEntries;
 import org.apache.geode.internal.util.concurrent.CopyOnWriteHashMap;
 import org.apache.geode.internal.util.concurrent.FutureResult;
 import org.apache.geode.internal.util.concurrent.StoppableCountDownLatch;
@@ -2075,6 +2076,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       if (this.imageState.isClient() && !this.getConcurrencyChecksEnabled()) {
         return result - this.imageState.getDestroyedEntriesCount();
       }
+      if (tombstoneCount.get() > result) {
+        ConcurrentMapWithReusableEntries<Object, Object> map =
+            entries.getCustomEntryConcurrentHashMap();
+        logger.info("GEM-1722: " + tombstoneCount.get() + " tombstones is greater than "
+ result +
+            " size for " + getFullPath() + " with map keys " + map.keySet() +
+            ", map entries " + map.entrySet() + ", map reusableEntries " +
+            map.entrySetWithReusableEntries());
+      }
       return result - this.tombstoneCount.get();
     }
   }
@@ -3279,7 +3288,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
           "unscheduling tombstone for {} count is {} entryMap size is {}", entry.getKey(),
           this.tombstoneCount.get(), this.entries.size()/* , new Exception("stack trace")
*/);
     }
-    if (logger.isTraceEnabled(LogMarker.TOMBSTONE_COUNT_VERBOSE) && validate) {
+    if (logger.isInfoEnabled(LogMarker.TOMBSTONE_COUNT_VERBOSE) && validate) {
       if (this.entries instanceof AbstractRegionMap) {
         ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount);
       }
@@ -11544,7 +11553,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       if (this.entries instanceof AbstractRegionMap) {
         ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount);
       }
-      logger.debug("Dumping region of size {} tombstones: {}: {}", size(), getTombstoneCount(),
+      logger.info("GEM-1722: Dumping region of size {} tombstones: {}: {}", size(), getTombstoneCount(),
           this.toString());
       if (this.entries instanceof AbstractRegionMap) {
         ((AbstractRegionMap) this.entries).dumpMap();

-- 
To stop receiving notification emails like this one, please contact
klund@apache.org.

Mime
View raw message