geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject geode git commit: fix-5
Date Wed, 12 Apr 2017 20:24:10 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEM-1353 45746d6c0 -> 45fa575bd


fix-5


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

Branch: refs/heads/feature/GEM-1353
Commit: 45fa575bd786306e9af359028c097b31cd9ffc43
Parents: 45746d6
Author: zhouxh <gzhou@pivotal.io>
Authored: Wed Apr 12 13:23:56 2017 -0700
Committer: zhouxh <gzhou@pivotal.io>
Committed: Wed Apr 12 13:23:56 2017 -0700

----------------------------------------------------------------------
 .../internal/cache/AbstractUpdateOperation.java  | 19 -------------------
 .../cache/DistributedCacheOperation.java         | 17 ++++++++++++++++-
 .../geode/internal/cache/Bug45934DUnitTest.java  |  4 ++--
 3 files changed, 18 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/45fa575b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
index 55df601..26fdde5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
@@ -40,8 +40,6 @@ import org.apache.geode.internal.cache.versions.ConcurrentCacheModificationExcep
 import org.apache.geode.internal.cache.versions.VersionTag;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-import org.apache.geode.internal.util.DelayedAction;
 
 /**
  * Common code for both UpdateOperation and DistributedPutAllOperation.
@@ -55,7 +53,6 @@ public abstract class AbstractUpdateOperation extends DistributedCacheOperation
   @edu.umd.cs.findbugs.annotations.SuppressWarnings(
       value = "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD",
       justification = "test hook that is unset normally")
-  public static volatile DelayedAction test_InvalidVersionAction;
 
   private final long lastModifiedTime;
 
@@ -65,22 +62,6 @@ public abstract class AbstractUpdateOperation extends DistributedCacheOperation
   }
 
   @Override
-  public void distribute() {
-    try {
-      super.distribute();
-    } catch (InvalidVersionException e) {
-      if (logger.isDebugEnabled()) {
-        logger.trace(LogMarker.DM, "PutAll failed since versions were missing; retrying again",
e);
-      }
-
-      if (test_InvalidVersionAction != null) {
-        test_InvalidVersionAction.run();
-      }
-      super.distribute();
-    }
-  }
-
-  @Override
   protected Set getRecipients() {
     CacheDistributionAdvisor advisor = getRegion().getCacheDistributionAdvisor();
     return advisor.adviseUpdate(getEvent());

http://git-wip-us.apache.org/repos/asf/geode/blob/45fa575b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedCacheOperation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedCacheOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedCacheOperation.java
index 86063a2..0a9ccd8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedCacheOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedCacheOperation.java
@@ -33,6 +33,7 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.CancelException;
 import org.apache.geode.DataSerializer;
 import org.apache.geode.InvalidDeltaException;
+import org.apache.geode.InvalidVersionException;
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.CacheEvent;
 import org.apache.geode.cache.CacheFactory;
@@ -78,6 +79,7 @@ import org.apache.geode.internal.offheap.StoredObject;
 import org.apache.geode.internal.offheap.annotations.Released;
 import org.apache.geode.internal.offheap.annotations.Unretained;
 import org.apache.geode.internal.sequencelog.EntryLogger;
+import org.apache.geode.internal.util.DelayedAction;
 
 /**
  * 
@@ -240,6 +242,8 @@ public abstract class DistributedCacheOperation {
     return true;
   }
 
+  public static volatile DelayedAction test_InvalidVersionAction;
+
   /**
    * region's distribution advisor marked that a distribution is about to start, then distribute.
It
    * returns a token, which is view version. Return -1 means the method did not succeed.
This method
@@ -256,7 +260,18 @@ public abstract class DistributedCacheOperation {
       logger.trace(LogMarker.STATE_FLUSH_OP, "dispatching operation in view version {}",
           viewVersion);
     }
-    _distribute();
+    try {
+      _distribute();
+    } catch (InvalidVersionException e) {
+      if (logger.isDebugEnabled()) {
+        logger.trace(LogMarker.DM, "PutAll failed since versions were missing; retrying again",
e);
+      }
+
+      if (test_InvalidVersionAction != null) {
+        test_InvalidVersionAction.run();
+      }
+      _distribute();
+    }
     return viewVersion;
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/45fa575b/geode-core/src/test/java/org/apache/geode/internal/cache/Bug45934DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/Bug45934DUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/Bug45934DUnitTest.java
index 0bf501f..8021b97 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/Bug45934DUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/Bug45934DUnitTest.java
@@ -63,13 +63,13 @@ public class Bug45934DUnitTest extends JUnit4CacheTestCase {
     Region<Integer, Integer> region = rf.create(name);
 
     // 3. reset the error flag after initial failure
-    AbstractUpdateOperation.test_InvalidVersionAction = new DelayedAction(new Runnable()
{
+    DistributedCacheOperation.test_InvalidVersionAction = new DelayedAction(new Runnable()
{
       @Override
       public void run() {
         unsetRemoteFlag(remote);
       }
     });
-    AbstractUpdateOperation.test_InvalidVersionAction.allowToProceed();
+    DistributedCacheOperation.test_InvalidVersionAction.allowToProceed();
 
     // 3. put data
     Map<Integer, Integer> values = new HashMap<Integer, Integer>();


Mime
View raw message