geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [05/45] incubator-geode git commit: merge of hot-fix from closed-source 8.2x maintenance branch
Date Fri, 08 Jan 2016 23:37:06 GMT
merge of hot-fix from closed-source 8.2x maintenance branch

The tombstone GC service ran into an NPE removing a tombstone and then
the thread went hot because exception-handling was not advancing to the
next GC candidate.  This revision attempts to avoid the NPE (which was
not reported with line numbers) and alters the exception-handling to
advance to the next tombstone if there is an unexpected problem removing
the current tombstone.


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

Branch: refs/heads/feature/GEODE-715
Commit: 4bc1b28a13b952f6f043ee9f7f28a8d3a9220f1f
Parents: d19bb41
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Mon Jan 4 15:26:05 2016 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Mon Jan 4 15:28:43 2016 -0800

----------------------------------------------------------------------
 .../gemfire/internal/cache/AbstractRegionMap.java         |  6 ++++--
 .../gemstone/gemfire/internal/cache/TombstoneService.java | 10 ++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4bc1b28a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
index 6d49d74..f4fb044 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
@@ -4269,7 +4269,6 @@ RETRY_LOOP:
   public final boolean removeTombstone(RegionEntry re, VersionHolder version, boolean isEviction,
boolean isScheduledTombstone)  {
     boolean result = false;
     int destroyedVersion = version.getEntryVersion();
-    DiskRegion dr = this._getOwner().getDiskRegion();
 
     synchronized(this._getOwner().getSizeGuard()) { // do this sync first; see bug 51985
         synchronized (re) {
@@ -4303,7 +4302,10 @@ RETRY_LOOP:
                 if (isScheduledTombstone) {
                   _getOwner().incTombstoneCount(-1);
                 }
-                _getOwner().getVersionVector().recordGCVersion(version.getMemberID(), version.getRegionVersion());
+                RegionVersionVector vector = _getOwner().getVersionVector();
+                if (vector != null) {
+                  vector.recordGCVersion(version.getMemberID(), version.getRegionVersion());
+                }
               }
             } catch (RegionClearedException e) {
               // if the region has been cleared we don't need to remove the tombstone

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4bc1b28a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
index 9fc5032..0814b34 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
@@ -204,6 +204,10 @@ public class TombstoneService  implements ResourceListener<MemoryEvent>
{
    * @param destroyedVersion the version that was destroyed
    */
   public void scheduleTombstone(LocalRegion r, RegionEntry entry, VersionTag destroyedVersion)
{
+    if (entry.getVersionStamp() == null) {
+      logger.warn("Detected an attempt to schedule a tombstone for an entry that is not versioned
in region " + r.getFullPath(), new Exception("stack trace"));
+      return;
+    }
     boolean useReplicated = useReplicatedQueue(r);
     Tombstone ts = new Tombstone(entry, r, destroyedVersion);
     if (useReplicated) {
@@ -871,6 +875,12 @@ public class TombstoneService  implements ResourceListener<MemoryEvent>
{
               return;
             } catch (Exception e) {
               logger.warn(LocalizedMessage.create(LocalizedStrings.GemFireCacheImpl_TOMBSTONE_ERROR),
e);
+              currentTombstoneLock.lock();
+              try {
+                currentTombstone = null;
+              } finally {
+                currentTombstoneLock.unlock();
+              }
             }
           }
           if (sleepTime > 0) {


Mime
View raw message