geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aging...@apache.org
Subject [geode] branch feature/GEODE-3796 updated: GEODE-3796 Changes are made to validate region version after the region is initialized.
Date Tue, 10 Oct 2017 21:49:31 GMT
This is an automated email from the ASF dual-hosted git repository.

agingade pushed a commit to branch feature/GEODE-3796
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3796 by this push:
     new 42f5072  GEODE-3796 Changes are made to validate region version after the region
is initialized.
42f5072 is described below

commit 42f5072c60c87635dc19808149690beaaaf1756e
Author: Anil <agingade@pivotal.io>
AuthorDate: Tue Oct 10 14:49:06 2017 -0700

    GEODE-3796 Changes are made to validate region version after the region is initialized.
---
 .../apache/geode/internal/cache/versions/RegionVersionVector.java    | 5 ++---
 .../geode/internal/cache/versions/RegionVersionVectorJUnitTest.java  | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionVector.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionVector.java
index af59f06..be22f38 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionVector.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionVector.java
@@ -112,7 +112,6 @@ public abstract class RegionVersionVector<T extends VersionSource<?>>
   /** a flag to prevent accidental serialization of a live member */
   private transient boolean isLiveVector;
 
-  /** for debugging we keep a reference to the region for use in log messages */
   private transient LocalRegion region;
 
   private ConcurrentHashMap<T, Long> memberToGCVersion;
@@ -606,8 +605,8 @@ public abstract class RegionVersionVector<T extends VersionSource<?>>
       // recovers. So we can only assert that the local member has already seen
       // the replayed event.
       synchronized (localExceptions) {
-        if (region != null && region.isInitialized()
-            && this.localVersion.get() < tag.getRegionVersion()) {
+        if (this.localVersion.get() < tag.getRegionVersion() && region != null
+            && region.isInitialized()) {
           Assert.fail(
               "recordVersion invoked for a local version tag that is higher than our local
version. rvv="
                   + this + ", tag=" + tag + " " + region.getName());
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorJUnitTest.java
index b9d3cf6..12f7321 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorJUnitTest.java
@@ -554,7 +554,6 @@ public class RegionVersionVectorJUnitTest {
 
   @Test
   public void testRecordVersionAfterRegionInitThrowsException() {
-    expectedException.expect(InternalGemFireError.class);
     LocalRegion mockRegion = mock(LocalRegion.class);
     when(mockRegion.isInitialized()).thenReturn(true);
     final String local = NetworkUtils.getIPLiteral();
@@ -563,6 +562,7 @@ public class RegionVersionVectorJUnitTest {
     tag.setRegionVersion(1L);
 
     RegionVersionVector rvv = createRegionVersionVector(ownerId, mockRegion);
+    expectedException.expect(InternalGemFireError.class);
     rvv.recordVersion(ownerId, tag);
   }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message