geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aging...@apache.org
Subject [geode] branch develop updated: Revert "GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819)"
Date Wed, 14 Nov 2018 18:07:47 GMT
This is an automated email from the ASF dual-hosted git repository.

agingade pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 09dd194  Revert "GEODE-6013: Made changes to use the expected initial image requester's
rvv information (#2819)"
09dd194 is described below

commit 09dd194f5a423ea591c0f47d3114df46d23435e8
Author: Anil <agingade@pivotal.io>
AuthorDate: Wed Nov 14 10:06:36 2018 -0800

    Revert "GEODE-6013: Made changes to use the expected initial image requester's rvv information
(#2819)"
    
    This reverts commit b4befb99626e85045379e5b6fb8804b9db2a3eb9.
---
 .../cache/PersistentRegionRecoveryDUnitTest.java   |  86 -------------
 .../internal/cache/InitialImageOperation.java      |   1 +
 .../cache/versions/RegionVersionVector.java        |  27 ++--
 .../cache/versions/RegionVersionVectorTest.java    | 139 ---------------------
 4 files changed, 14 insertions(+), 239 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java
index 01d3f4b..670622f 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java
@@ -29,7 +29,6 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
-import org.apache.geode.cache.DiskStore;
 import org.apache.geode.cache.DiskStoreFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
@@ -410,91 +409,6 @@ public class PersistentRegionRecoveryDUnitTest extends JUnit4DistributedTestCase
     });
   }
 
-  @Test
-  public void testRecoveryFromBackupAndRequestingDeltaGiiDoesFullGiiIfTombstoneGCVersionDiffers()
-      throws Exception {
-    getBlackboard().initBlackboard();
-    vm1.invoke(() -> cacheRule.createCache());
-
-    vm0.invoke(() -> createAsyncDiskRegion(true));
-    vm0.invoke(() -> {
-      Region<String, String> region = cacheRule.getCache().getRegion(regionName);
-      region.put("KEY-1", "VALUE-1");
-      region.put("KEY-2", "VALUE-2");
-      flushAsyncDiskRegion();
-    });
-
-    vm1.invoke(() -> createAsyncDiskRegion(true));
-    vm1.invoke(() -> {
-      Region<String, String> region = cacheRule.getCache().getRegion(regionName);
-      region.put("KEY-1", "VALUE-1");
-      region.put("KEY-2", "VALUE-2");
-      region.put("KEY-1", "VALUE-3");
-      region.put("KEY-2", "VALUE-4");
-      flushAsyncDiskRegion();
-    });
-
-    vm0.invoke(() -> {
-      Region<String, String> region = cacheRule.getCache().getRegion(regionName);
-      region.destroy("KEY-1");
-    });
-
-    vm0.bounceForcibly();
-
-    vm1.invoke(() -> flushAsyncDiskRegion());
-
-    vm1.invoke(() -> {
-      DistributionMessageObserver.setInstance(
-          new DistributionMessageObserver() {
-            @Override
-            public void beforeProcessMessage(ClusterDistributionManager dm,
-                DistributionMessage message) {
-              if (message instanceof InitialImageOperation.RequestImageMessage) {
-                InitialImageOperation.RequestImageMessage rim =
-                    (InitialImageOperation.RequestImageMessage) message;
-                if (rim.regionPath.contains(regionName)) {
-                  getBlackboard().signalGate("GotRegionIIRequest");
-                  await().until(() -> getBlackboard().isGateSignaled("TombstoneGCDone"));
-                }
-              }
-            }
-          });
-    });
-
-    AsyncInvocation vm0createRegion = vm0.invokeAsync(() -> createAsyncDiskRegion(true));
-
-    vm1.invoke(() -> {
-      await().until(() -> getBlackboard().isGateSignaled("GotRegionIIRequest"));
-      cacheRule.getCache().getTombstoneService().forceBatchExpirationForTests(1);
-      flushAsyncDiskRegion();
-      getBlackboard().signalGate("TombstoneGCDone");
-    });
-
-    vm0createRegion.await();
-
-    vm1.invoke(() -> {
-      Region<String, String> region = cacheRule.getCache().getRegion(regionName);
-      assertThat(region.get("KEY-1")).isEqualTo(null);
-      assertThat(region.get("KEY-2")).isEqualTo("VALUE-4");
-    });
-
-    vm0.invoke(() -> {
-      Region<String, String> region = cacheRule.getCache().getRegion(regionName);
-      assertThat(region.get("KEY-1")).isEqualTo(null);
-      assertThat(region.get("KEY-2")).isEqualTo("VALUE-4");
-
-      CachePerfStats stats = ((LocalRegion) region).getRegionPerfStats();
-      assertThat(stats.getDeltaGetInitialImagesCompleted()).isEqualTo(0);
-      assertThat(stats.getGetInitialImagesCompleted()).isEqualTo(1);
-    });
-  }
-
-  private void flushAsyncDiskRegion() {
-    for (DiskStore store : cacheRule.getCache().listDiskStoresIncludingRegionOwned()) {
-      ((DiskStoreImpl) store).forceFlush();
-    }
-  }
-
   private void createSyncDiskRegion() throws IOException {
     createDiskRegion(false, false, regionName);
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
index a3e892d..ba3f741 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
@@ -1596,6 +1596,7 @@ public class InitialImageOperation {
         }
         return true;
       }
+      // TODO GGG: verify GII after UpgradeDiskStore
       return false;
     }
 
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 ce10dfd..7b03d48 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
@@ -977,35 +977,34 @@ public abstract class RegionVersionVector<T extends VersionSource<?>>
     return false;
   }
 
-  private boolean isGCVersionDominatedByOtherHolder(Long gcVersion,
-      RegionVersionHolder<T> otherHolder) {
+  private boolean isGCVersionDominatedByHolder(Long gcVersion, RegionVersionHolder<T>
otherHolder) {
     if (gcVersion == null || gcVersion.longValue() == 0) {
       return true;
     } else {
       RegionVersionHolder<T> holder = new RegionVersionHolder<T>(gcVersion.longValue());
-      return otherHolder.dominates(holder);
+      return !holder.isNewerThanOrCanFillExceptionsFor(otherHolder);
     }
   }
 
   /**
-   * See if this vector's rvvgc has updates that has not seen.
+   * Test to see if this vector's rvvgc has updates that has not seen.
    */
-  public synchronized boolean isRVVGCDominatedBy(RegionVersionVector<T> requesterRVV)
{
-    if (requesterRVV.singleMember) {
+  public synchronized boolean isRVVGCDominatedBy(RegionVersionVector<T> other) {
+    if (other.singleMember) {
       // do the diff for only a single member. This is typically a member that
       // recently crashed.
       Map.Entry<T, RegionVersionHolder<T>> entry =
-          requesterRVV.memberToVersion.entrySet().iterator().next();
+          other.memberToVersion.entrySet().iterator().next();
 
       Long gcVersion = this.memberToGCVersion.get(entry.getKey());
-      return isGCVersionDominatedByOtherHolder(gcVersion, entry.getValue());
+      return isGCVersionDominatedByHolder(gcVersion, entry.getValue());
     }
 
     boolean isDominatedByRemote = true;
     long localgcversion = this.localGCVersion.get();
     if (localgcversion > 0) {
-      RegionVersionHolder<T> otherHolder = requesterRVV.memberToVersion.get(this.myId);
-      isDominatedByRemote = isGCVersionDominatedByOtherHolder(localgcversion, otherHolder);
+      RegionVersionHolder<T> otherHolder = other.memberToVersion.get(this.myId);
+      isDominatedByRemote = isGCVersionDominatedByHolder(localgcversion, otherHolder);
       if (isDominatedByRemote == false) {
         return false;
       }
@@ -1015,12 +1014,12 @@ public abstract class RegionVersionVector<T extends VersionSource<?>>
       T mbr = entry.getKey();
       Long gcVersion = entry.getValue();
       RegionVersionHolder<T> otherHolder = null;
-      if (mbr.equals(requesterRVV.getOwnerId())) {
-        otherHolder = requesterRVV.localExceptions;
+      if (mbr.equals(other.getOwnerId())) {
+        otherHolder = localExceptions;
       } else {
-        otherHolder = requesterRVV.memberToVersion.get(mbr);
+        otherHolder = other.memberToVersion.get(mbr);
       }
-      isDominatedByRemote = isGCVersionDominatedByOtherHolder(gcVersion, otherHolder);
+      isDominatedByRemote = isGCVersionDominatedByHolder(gcVersion, otherHolder);
       if (isDominatedByRemote == false) {
         return false;
       }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorTest.java
index a018aaf..deb7d4e 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/versions/RegionVersionVectorTest.java
@@ -661,145 +661,6 @@ public class RegionVersionVectorTest {
     assertThat(rvv.getVersionForMember(ownerId)).isEqualTo(newVersion);
   }
 
-  @Test
-  public void isRvvGcDominatedByRequesterRvvReturnsTrueIfRequesterRvvForLostMemberDominates()
-      throws Exception {
-    InternalDistributedMember lostMember = mock(InternalDistributedMember.class);
-    ConcurrentHashMap<InternalDistributedMember, Long> memberToGcVersion =
-        new ConcurrentHashMap<>();
-    memberToGcVersion.put(lostMember, new Long(1) /* lostMemberGcVersion */);
-    RegionVersionVector providerRvv = new VMRegionVersionVector(lostMember, null,
-        0, memberToGcVersion, 0, true, null);
-
-    ConcurrentHashMap<InternalDistributedMember, RegionVersionHolder<InternalDistributedMember>>
memberToRegionVersionHolder =
-        new ConcurrentHashMap<>();
-    RegionVersionHolder regionVersionHolder = new RegionVersionHolder(lostMember);
-    regionVersionHolder.setVersion(2);
-    memberToRegionVersionHolder.put(lostMember, regionVersionHolder);
-    RegionVersionVector requesterRvv =
-        new VMRegionVersionVector(lostMember, memberToRegionVersionHolder,
-            0, null, 0, true, null);
-
-    assertThat(providerRvv.isRVVGCDominatedBy(requesterRvv)).isTrue();
-  }
-
-  @Test
-  public void isRvvGcDominatedByRequesterRvvReturnsFalseIfRequesterRvvForLostMemberDominates()
-      throws Exception {
-    InternalDistributedMember lostMember = mock(InternalDistributedMember.class);
-    ConcurrentHashMap<InternalDistributedMember, Long> memberToGcVersion =
-        new ConcurrentHashMap<>();
-    memberToGcVersion.put(lostMember, new Long(1) /* lostMemberGcVersion */);
-    RegionVersionVector providerRvv = new VMRegionVersionVector(lostMember, null,
-        0, memberToGcVersion, 0, true, null);
-
-    ConcurrentHashMap<InternalDistributedMember, RegionVersionHolder<InternalDistributedMember>>
memberToRegionVersionHolder =
-        new ConcurrentHashMap<>();
-    RegionVersionHolder regionVersionHolder = new RegionVersionHolder(lostMember);
-    regionVersionHolder.setVersion(0);
-    memberToRegionVersionHolder.put(lostMember, regionVersionHolder);
-    RegionVersionVector requesterRvv =
-        new VMRegionVersionVector(lostMember, memberToRegionVersionHolder,
-            0, null, 0, true, null);
-
-    assertThat(providerRvv.isRVVGCDominatedBy(requesterRvv)).isFalse();
-  }
-
-  @Test
-  public void isRvvGcDominatedByRequesterRvvReturnsFalseIfRequesterRvvDominatesProvider()
-      throws Exception {
-    final String local = getIPLiteral();
-    InternalDistributedMember provider = new InternalDistributedMember(local, 101);
-    InternalDistributedMember requester = new InternalDistributedMember(local, 102);
-
-    RegionVersionVector providerRvv = new VMRegionVersionVector(provider, null,
-        1, null, 1, false, null);
-
-    ConcurrentHashMap<InternalDistributedMember, RegionVersionHolder<InternalDistributedMember>>
memberToRegionVersionHolder =
-        new ConcurrentHashMap<>();
-    RegionVersionHolder regionVersionHolder = new RegionVersionHolder(provider);
-    regionVersionHolder.setVersion(0);
-    memberToRegionVersionHolder.put(provider, regionVersionHolder);
-    RegionVersionVector requesterRvv =
-        new VMRegionVersionVector(requester, memberToRegionVersionHolder,
-            0, null, 0, false, null);
-
-    assertThat(providerRvv.isRVVGCDominatedBy(requesterRvv)).isFalse();
-  }
-
-  @Test
-  public void isRvvGcDominatedByRequesterRvvReturnsTrueIfRequesterRvvDominatesWithNoGcVersion()
-      throws Exception {
-    final String local = getIPLiteral();
-    InternalDistributedMember provider = new InternalDistributedMember(local, 101);
-    InternalDistributedMember requester = new InternalDistributedMember(local, 102);
-
-    ConcurrentHashMap<InternalDistributedMember, Long> memberToGcVersion =
-        new ConcurrentHashMap<>();
-    RegionVersionVector providerRvv = new VMRegionVersionVector(provider, null,
-        1, memberToGcVersion, 1, false, null);
-
-    ConcurrentHashMap<InternalDistributedMember, RegionVersionHolder<InternalDistributedMember>>
memberToRegionVersionHolder =
-        new ConcurrentHashMap<>();
-    RegionVersionHolder regionVersionHolder = new RegionVersionHolder(provider);
-    regionVersionHolder.setVersion(2);
-    memberToRegionVersionHolder.put(provider, regionVersionHolder);
-    RegionVersionVector requesterRvv =
-        new VMRegionVersionVector(requester, memberToRegionVersionHolder,
-            0, null, 0, false, null);
-
-    assertThat(providerRvv.isRVVGCDominatedBy(requesterRvv)).isTrue();
-  }
-
-  @Test
-  public void isRvvGcDominatedByRequesterRvvReturnsTrueIfRequesterRvvDominates() throws Exception
{
-    final String local = getIPLiteral();
-    InternalDistributedMember provider = new InternalDistributedMember(local, 101);
-    InternalDistributedMember requester = new InternalDistributedMember(local, 102);
-    ConcurrentHashMap<InternalDistributedMember, Long> memberToGcVersion =
-        new ConcurrentHashMap<>();
-    memberToGcVersion.put(requester, new Long(1));
-    RegionVersionVector providerRvv = new VMRegionVersionVector(provider, null,
-        1, memberToGcVersion, 1, false, null);
-
-    ConcurrentHashMap<InternalDistributedMember, RegionVersionHolder<InternalDistributedMember>>
memberToRegionVersionHolder =
-        new ConcurrentHashMap<>();
-    RegionVersionHolder regionVersionHolder = new RegionVersionHolder(provider);
-    regionVersionHolder.setVersion(2);
-    memberToRegionVersionHolder.put(provider, regionVersionHolder);
-    RegionVersionVector requesterRvv =
-        new VMRegionVersionVector(requester, memberToRegionVersionHolder,
-            2, null, 0, false, regionVersionHolder);
-
-    assertThat(providerRvv.isRVVGCDominatedBy(requesterRvv)).isTrue();
-  }
-
-  @Test
-  public void isRvvGcDominatedByRequesterRvvReturnsFalseIfRequesterRvvDominates() throws
Exception {
-    final String local = getIPLiteral();
-    InternalDistributedMember provider = new InternalDistributedMember(local, 101);
-    InternalDistributedMember requester = new InternalDistributedMember(local, 102);
-    ConcurrentHashMap<InternalDistributedMember, Long> memberToGcVersion =
-        new ConcurrentHashMap<>();
-    memberToGcVersion.put(requester, new Long(3));
-    RegionVersionHolder pRegionVersionHolder = new RegionVersionHolder(provider);
-    pRegionVersionHolder.setVersion(4);
-
-    RegionVersionVector providerRvv = new VMRegionVersionVector(provider, null,
-        1, memberToGcVersion, 1, false, pRegionVersionHolder);
-
-    ConcurrentHashMap<InternalDistributedMember, RegionVersionHolder<InternalDistributedMember>>
memberToRegionVersionHolder =
-        new ConcurrentHashMap<>();
-    RegionVersionHolder regionVersionHolder = new RegionVersionHolder(provider);
-    regionVersionHolder.setVersion(2);
-    memberToRegionVersionHolder.put(provider, regionVersionHolder);
-    RegionVersionVector requesterRvv =
-        new VMRegionVersionVector(requester, memberToRegionVersionHolder,
-            2, null, 0, false, regionVersionHolder);
-
-    assertThat(providerRvv.isRVVGCDominatedBy(requesterRvv)).isFalse();
-  }
-
   private RegionVersionVector createRegionVersionVector(InternalDistributedMember ownerId,
       LocalRegion owner) {
     @SuppressWarnings({"unchecked", "rawtypes"})


Mime
View raw message