You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2018/06/11 18:12:44 UTC

[geode] 01/03: Improve debug messages

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 b87400c276ded6de563dcc60d5db840206d7aa73
Author: Kirk Lund <kl...@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 97f6ae4..2d12e38 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
@@ -2599,18 +2599,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 1642a8a..0064e9a 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);
       }
@@ -11545,7 +11554,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.