[geode] branch develop updated (f2636e0 -> dabb610)
This is an automated email from the ASF dual-hosted git repository. jchen21 pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from f2636e0 Revert "GEODE-8905: Introduce JarDeploymentService (#5989)" (#6078) add dabb610 GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925) No new revisions were added by this update. Summary of changes: .../cache/RegionConcurrentOperationDUnitTest.java | 102 - .../apache/geode/internal/cache/LocalRegion.java | 33 --- .../geode/internal/cache/LocalRegionTest.java | 43 + 3 files changed, 146 insertions(+), 32 deletions(-)
[geode] branch feature/GEODE-8992 created (now 97c9552)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a change to branch feature/GEODE-8992 in repository https://gitbox.apache.org/repos/asf/geode.git. at 97c9552 GEODE-8992: Added operationDetail to toData/fromData This branch includes the following new commits: new 97c9552 GEODE-8992: Added operationDetail to toData/fromData The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[geode] 01/01: GEODE-8992: Added operationDetail to toData/fromData
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch feature/GEODE-8992 in repository https://gitbox.apache.org/repos/asf/geode.git commit 97c95520e6eabdb1bb8cfa6708e0b812da8b2c17 Author: Barry Oglesby AuthorDate: Wed Mar 3 10:38:09 2021 -0800 GEODE-8992: Added operationDetail to toData/fromData --- .../codeAnalysis/sanctionedDataSerializables.txt | 8 +- .../internal/cache/wan/GatewaySenderEventImpl.java | 15 ++- .../cache/wan/GatewaySenderEventImplTest.java | 130 +++-- 3 files changed, 140 insertions(+), 13 deletions(-) diff --git a/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt b/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt index 03e7c5b..5f50033 100644 --- a/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt +++ b/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt @@ -1922,12 +1922,14 @@ org/apache/geode/internal/cache/wan/GatewaySenderEventCallbackArgument,2 fromData,65 toData,89 -org/apache/geode/internal/cache/wan/GatewaySenderEventImpl,6 -fromData,62 +org/apache/geode/internal/cache/wan/GatewaySenderEventImpl,8 +fromData,17 fromDataPre_GEODE_1_14_0_0,31 +fromDataPre_GEODE_1_15_0_0,62 fromDataPre_GEODE_1_9_0_0,200 -toData,59 +toData,17 toDataPre_GEODE_1_14_0_0,18 +toDataPre_GEODE_1_15_0_0,59 toDataPre_GEODE_1_9_0_0,151 org/apache/geode/internal/cache/wan/GatewaySenderQueueEntrySynchronizationOperation$GatewaySenderQueueEntrySynchronizationEntry,2 diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java index e4a8b75..369157c 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java @@ -710,6 +710,12 @@ public class GatewaySenderEventImpl @Override public void toData(DataOutput out, SerializationContext context) throws IOException { +toDataPre_GEODE_1_15_0_0(out, context); +out.writeInt(this.operationDetail); + } + + public void toDataPre_GEODE_1_15_0_0(DataOutput out, + SerializationContext context) throws IOException { toDataPre_GEODE_1_14_0_0(out, context); boolean hasTransaction = this.transactionId != null; DataSerializer.writeBoolean(hasTransaction, out); @@ -754,6 +760,12 @@ public class GatewaySenderEventImpl @Override public void fromData(DataInput in, DeserializationContext context) throws IOException, ClassNotFoundException { +fromDataPre_GEODE_1_15_0_0(in, context); +this.operationDetail = in.readInt(); + } + + public void fromDataPre_GEODE_1_15_0_0(DataInput in, DeserializationContext context) + throws IOException, ClassNotFoundException { fromDataPre_GEODE_1_14_0_0(in, context); if (version >= KnownVersion.GEODE_1_14_0.ordinal()) { boolean hasTransaction = DataSerializer.readBoolean(in); @@ -1287,7 +1299,8 @@ public class GatewaySenderEventImpl @Override public KnownVersion[] getSerializationVersions() { -return new KnownVersion[] {KnownVersion.GEODE_1_9_0, KnownVersion.GEODE_1_14_0}; +return new KnownVersion[] {KnownVersion.GEODE_1_9_0, KnownVersion.GEODE_1_14_0, +KnownVersion.GEODE_1_15_0}; } public int getSerializedValueSize() { diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImplTest.java index 3add1a1..69f686d 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImplTest.java @@ -15,6 +15,8 @@ package org.apache.geode.internal.cache.wan; import static org.apache.geode.internal.serialization.KnownVersion.GEODE_1_13_0; +import static org.apache.geode.internal.serialization.KnownVersion.GEODE_1_14_0; +import static org.apache.geode.internal.serialization.KnownVersion.GEODE_1_8_0; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.isA; @@ -29,10 +31,13 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import junitparams.JUnitParamsRunner; +import junitparams.Parameters; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; +import org.junit.runner.RunWith; import org.apache.geode.cache.Operation; import org.apache.geode.cache.TransactionId; @@ -41,6 +46,7 @@ import org.apache.geode.internal.
[geode] branch support/1.14 updated: GEODE-8958: When tombstone timestamps get corrupted. (#6042)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.14 by this push: new 1986468 GEODE-8958: When tombstone timestamps get corrupted. (#6042) 1986468 is described below commit 1986468212d50ae7c91d839209bf24c89449f1ac Author: mhansonp AuthorDate: Mon Mar 1 14:28:23 2021 -0800 GEODE-8958: When tombstone timestamps get corrupted. (#6042) - The system would wait, now it does expires it and moves on. (cherry picked from commit ab59830ecf754957b76e5fba068f653b03d467a9) --- .../cache/versions/TombstoneDUnitTest.java | 136 ++--- .../geode/internal/cache/TombstoneService.java | 38 -- 2 files changed, 148 insertions(+), 26 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java index bb75eca..a576706 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java @@ -28,6 +28,7 @@ import java.util.Arrays; import java.util.Properties; import java.util.concurrent.CountDownLatch; +import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -48,7 +49,10 @@ import org.apache.geode.internal.cache.DistributedTombstoneOperation; import org.apache.geode.internal.cache.InitialImageOperation; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.internal.cache.PartitionedRegion; +import org.apache.geode.internal.cache.RegionEntry; import org.apache.geode.internal.cache.TombstoneService; +import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.NetworkUtils; import org.apache.geode.test.dunit.VM; @@ -117,35 +121,139 @@ public class TombstoneDUnitTest implements Serializable { }); } + @Test - public void testGetOldestTombstoneTimeReplicate() { + public void testWhenAnOutOfRangeTimeStampIsSeenWeExpireItInReplicateTombstoneSweeper() { VM server1 = VM.getVM(0); VM server2 = VM.getVM(1); +final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future +final int count = 10; +// Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(REPLICATE_PERSISTENT); - region.put("K1", "V1"); - region.put("K2", "V2"); + createCacheAndRegion(RegionShortcut.REPLICATE); + for (int i = 0; i < count; i++) { +region.put("K" + i, "V" + i); + } }); -server2.invoke(() -> createCacheAndRegion(REPLICATE)); +server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); server1.invoke(() -> { - // Send tombstone gc message to vm1. - region.destroy("K1"); + // Now that we have a cache and a region specifically with data, we can start the real work TombstoneService.TombstoneSweeper tombstoneSweeper = ((InternalCache) cache).getTombstoneService().getSweeper((LocalRegion) region); - assertThat(tombstoneSweeper.getOldestTombstoneTime()).isGreaterThan(0) - .isLessThan(((InternalCache) cache).cacheTimeMillis()); - performGC(1); + // Get one of the entries + RegionEntry regionEntry = ((LocalRegion) region).getRegionEntry("K0"); + + /* + * Create a version tag with a timestamp far off in the future... + * It should be in the near past, but we are testing that a future tombstone will be cleared + */ + VersionTag versionTag = regionEntry.getVersionStamp().asVersionTag(); + versionTag.setVersionTimeStamp(System.currentTimeMillis() + FAR_INTO_THE_FUTURE); + + // Create the forged tombstone with the versionTag from the future + TombstoneService.Tombstone modifiedTombstone = + new TombstoneService.Tombstone(regionEntry, (LocalRegion) region, + versionTag); + + // Add it to the list of tombstones so that when checkOldestUnexpired is called it will see it + tombstoneSweeper.tombstones.add(modifiedTombstone); + tombstoneSweeper.checkOldestUnexpired(System.currentTimeMillis()); + + // Validate that the tombstone was cleared. assertThat(tombstoneSweeper.getOldestTombstoneTime()).isEqualTo(0); }); } @Test - public void testGetOldestTombstoneTimeNonReplicate() { + public void testWhenAnOutOfRangeTimeStampIsSeenWeExpireItInNonReplicateTombstoneSweeper() { +VM server1 = VM.getVM(0); +VM server2 = VM.getVM(1); +final in
[geode] branch support/1.13 updated: GEODE-8958: When tombstone timestamps get corrupted. (#6042)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new a125d37 GEODE-8958: When tombstone timestamps get corrupted. (#6042) a125d37 is described below commit a125d370cc737e87514ce97226b065362cb33a0b Author: mhansonp AuthorDate: Mon Mar 1 14:28:23 2021 -0800 GEODE-8958: When tombstone timestamps get corrupted. (#6042) - The system would wait, now it does expires it and moves on. (cherry picked from commit 465ff56ccc7430ee7676bc8e8ae354e35fed3b3e) --- .../cache/versions/TombstoneDUnitTest.java | 134 +++-- .../geode/internal/cache/TombstoneService.java | 38 -- 2 files changed, 147 insertions(+), 25 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java index 8cb94e5..9471e0a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Properties; import java.util.concurrent.CountDownLatch; +import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -41,7 +42,10 @@ import org.apache.geode.internal.cache.DestroyOperation; import org.apache.geode.internal.cache.DistributedTombstoneOperation; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.internal.cache.PartitionedRegion; +import org.apache.geode.internal.cache.RegionEntry; import org.apache.geode.internal.cache.TombstoneService; +import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.DistributedTestUtils; import org.apache.geode.test.dunit.NetworkUtils; @@ -107,35 +111,139 @@ public class TombstoneDUnitTest implements Serializable { }); } + @Test - public void testGetOldestTombstoneTimeReplicate() { + public void testWhenAnOutOfRangeTimeStampIsSeenWeExpireItInReplicateTombstoneSweeper() { VM server1 = VM.getVM(0); VM server2 = VM.getVM(1); +final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future +final int count = 10; +// Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE_PERSISTENT); - region.put("K1", "V1"); - region.put("K2", "V2"); + createCacheAndRegion(RegionShortcut.REPLICATE); + for (int i = 0; i < count; i++) { +region.put("K" + i, "V" + i); + } }); server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); server1.invoke(() -> { - // Send tombstone gc message to vm1. - region.destroy("K1"); + // Now that we have a cache and a region specifically with data, we can start the real work TombstoneService.TombstoneSweeper tombstoneSweeper = ((InternalCache) cache).getTombstoneService().getSweeper((LocalRegion) region); - assertThat(tombstoneSweeper.getOldestTombstoneTime()).isGreaterThan(0) - .isLessThan(((InternalCache) cache).cacheTimeMillis()); - performGC(1); + // Get one of the entries + RegionEntry regionEntry = ((LocalRegion) region).getRegionEntry("K0"); + + /* + * Create a version tag with a timestamp far off in the future... + * It should be in the near past, but we are testing that a future tombstone will be cleared + */ + VersionTag versionTag = regionEntry.getVersionStamp().asVersionTag(); + versionTag.setVersionTimeStamp(System.currentTimeMillis() + FAR_INTO_THE_FUTURE); + + // Create the forged tombstone with the versionTag from the future + TombstoneService.Tombstone modifiedTombstone = + new TombstoneService.Tombstone(regionEntry, (LocalRegion) region, + versionTag); + + // Add it to the list of tombstones so that when checkOldestUnexpired is called it will see it + tombstoneSweeper.tombstones.add(modifiedTombstone); + tombstoneSweeper.checkOldestUnexpired(System.currentTimeMillis()); + + // Validate that the tombstone was cleared. + assertThat(tombstoneSweeper.getOldestTombstoneTime()).isEqualTo(0); +}); + } + + @Test + public void testWhenAnOutOfRangeTimeStampIsSeenWeExpireItInNonReplicateTombstoneSweeper() { +VM server1 = VM.getVM(0); +VM server2 = VM.getVM(1); +final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future +final int count
[geode] branch support/1.12 updated: GEODE-8958: When tombstone timestamps get corrupted. (#6042)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new 15af30d GEODE-8958: When tombstone timestamps get corrupted. (#6042) 15af30d is described below commit 15af30d4f0a89df4168dcd5d80697143da944936 Author: mhansonp AuthorDate: Mon Mar 1 14:28:23 2021 -0800 GEODE-8958: When tombstone timestamps get corrupted. (#6042) - The system would wait, now it does expires it and moves on. (cherry picked from commit 1fdcf3220704c858b64b053b0c27fb37c481b4a8) --- .../cache/versions/TombstoneDUnitTest.java | 134 +++-- .../geode/internal/cache/TombstoneService.java | 38 -- 2 files changed, 147 insertions(+), 25 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java index 8cb94e5..9471e0a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Properties; import java.util.concurrent.CountDownLatch; +import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -41,7 +42,10 @@ import org.apache.geode.internal.cache.DestroyOperation; import org.apache.geode.internal.cache.DistributedTombstoneOperation; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.internal.cache.PartitionedRegion; +import org.apache.geode.internal.cache.RegionEntry; import org.apache.geode.internal.cache.TombstoneService; +import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.DistributedTestUtils; import org.apache.geode.test.dunit.NetworkUtils; @@ -107,35 +111,139 @@ public class TombstoneDUnitTest implements Serializable { }); } + @Test - public void testGetOldestTombstoneTimeReplicate() { + public void testWhenAnOutOfRangeTimeStampIsSeenWeExpireItInReplicateTombstoneSweeper() { VM server1 = VM.getVM(0); VM server2 = VM.getVM(1); +final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future +final int count = 10; +// Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE_PERSISTENT); - region.put("K1", "V1"); - region.put("K2", "V2"); + createCacheAndRegion(RegionShortcut.REPLICATE); + for (int i = 0; i < count; i++) { +region.put("K" + i, "V" + i); + } }); server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); server1.invoke(() -> { - // Send tombstone gc message to vm1. - region.destroy("K1"); + // Now that we have a cache and a region specifically with data, we can start the real work TombstoneService.TombstoneSweeper tombstoneSweeper = ((InternalCache) cache).getTombstoneService().getSweeper((LocalRegion) region); - assertThat(tombstoneSweeper.getOldestTombstoneTime()).isGreaterThan(0) - .isLessThan(((InternalCache) cache).cacheTimeMillis()); - performGC(1); + // Get one of the entries + RegionEntry regionEntry = ((LocalRegion) region).getRegionEntry("K0"); + + /* + * Create a version tag with a timestamp far off in the future... + * It should be in the near past, but we are testing that a future tombstone will be cleared + */ + VersionTag versionTag = regionEntry.getVersionStamp().asVersionTag(); + versionTag.setVersionTimeStamp(System.currentTimeMillis() + FAR_INTO_THE_FUTURE); + + // Create the forged tombstone with the versionTag from the future + TombstoneService.Tombstone modifiedTombstone = + new TombstoneService.Tombstone(regionEntry, (LocalRegion) region, + versionTag); + + // Add it to the list of tombstones so that when checkOldestUnexpired is called it will see it + tombstoneSweeper.tombstones.add(modifiedTombstone); + tombstoneSweeper.checkOldestUnexpired(System.currentTimeMillis()); + + // Validate that the tombstone was cleared. + assertThat(tombstoneSweeper.getOldestTombstoneTime()).isEqualTo(0); +}); + } + + @Test + public void testWhenAnOutOfRangeTimeStampIsSeenWeExpireItInNonReplicateTombstoneSweeper() { +VM server1 = VM.getVM(0); +VM server2 = VM.getVM(1); +final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future +final int count
[geode] branch support/1.13 updated: GEODE-8958: When timestamps get corrupted.
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new 3e1e3b0 GEODE-8958: When timestamps get corrupted. 3e1e3b0 is described below commit 3e1e3b0a7114801c3ce832a6e164e35ff9edd7d7 Author: Mark Hanson AuthorDate: Wed Mar 3 15:45:58 2021 -0800 GEODE-8958: When timestamps get corrupted. Fixing an import issue. --- .../cache/versions/TombstoneDUnitTest.java | 32 +++--- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java index 9471e0a..b03b298 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java @@ -14,6 +14,9 @@ */ package org.apache.geode.internal.cache.versions; +import static org.apache.geode.cache.RegionShortcut.PARTITION; +import static org.apache.geode.cache.RegionShortcut.REPLICATE; +import static org.apache.geode.cache.RegionShortcut.REPLICATE_PERSISTENT; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -23,7 +26,6 @@ import java.util.Arrays; import java.util.Properties; import java.util.concurrent.CountDownLatch; -import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -45,7 +47,6 @@ import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.PartitionedRegion; import org.apache.geode.internal.cache.RegionEntry; import org.apache.geode.internal.cache.TombstoneService; -import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.DistributedTestUtils; import org.apache.geode.test.dunit.NetworkUtils; @@ -80,12 +81,12 @@ public class TombstoneDUnitTest implements Serializable { VM vm1 = VM.getVM(1); vm0.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE_PERSISTENT); + createCacheAndRegion(REPLICATE_PERSISTENT); region.put("K1", "V1"); region.put("K2", "V2"); }); -vm1.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); +vm1.invoke(() -> createCacheAndRegion(REPLICATE)); vm0.invoke(() -> { // Send tombstone gc message to vm1. @@ -121,13 +122,13 @@ public class TombstoneDUnitTest implements Serializable { // Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE); + createCacheAndRegion(REPLICATE); for (int i = 0; i < count; i++) { region.put("K" + i, "V" + i); } }); -server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); +server2.invoke(() -> createCacheAndRegion(REPLICATE)); server1.invoke(() -> { @@ -165,16 +166,15 @@ public class TombstoneDUnitTest implements Serializable { VM server2 = VM.getVM(1); final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future final int count = 2000; -Logger logger = LogService.getLogger(); // Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.PARTITION); + createCacheAndRegion(PARTITION); for (int i = 0; i < count; i++) { region.put("K" + i, "V" + i); } }); -server2.invoke(() -> createCacheAndRegion(RegionShortcut.PARTITION)); +server2.invoke(() -> createCacheAndRegion(PARTITION)); server1.invoke(() -> { @@ -217,13 +217,13 @@ public class TombstoneDUnitTest implements Serializable { VM server2 = VM.getVM(1); final int count = 10; server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE); + createCacheAndRegion(REPLICATE); for (int i = 0; i < count; i++) { region.put("K" + i, "V" + i); } }); -server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); +server2.invoke(() -> createCacheAndRegion(REPLICATE)); server1.invoke(() -> { TombstoneService.TombstoneSweeper tombstoneSweeper = @@ -249,7 +249,7 @@ public class TombstoneDUnitTest implements Serializable { // Fire up the server and put in some data that is deletable server.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE); + createCacheAndRegion(REPLICATE); cache.addCacheServer().start(); for (int i = 0; i < 1000; i++) { re
[geode] branch support/1.12 updated: GEODE-8958: When timestamps get corrupted.
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new 3ffc6a6 GEODE-8958: When timestamps get corrupted. 3ffc6a6 is described below commit 3ffc6a6aaaf9a0ed9245d7069dd6cfdc68d5c936 Author: Mark Hanson AuthorDate: Wed Mar 3 15:45:58 2021 -0800 GEODE-8958: When timestamps get corrupted. Fixing an import issue. (cherry picked from commit 3e1e3b0a7114801c3ce832a6e164e35ff9edd7d7) --- .../cache/versions/TombstoneDUnitTest.java | 32 +++--- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java index 9471e0a..b03b298 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java @@ -14,6 +14,9 @@ */ package org.apache.geode.internal.cache.versions; +import static org.apache.geode.cache.RegionShortcut.PARTITION; +import static org.apache.geode.cache.RegionShortcut.REPLICATE; +import static org.apache.geode.cache.RegionShortcut.REPLICATE_PERSISTENT; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -23,7 +26,6 @@ import java.util.Arrays; import java.util.Properties; import java.util.concurrent.CountDownLatch; -import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -45,7 +47,6 @@ import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.PartitionedRegion; import org.apache.geode.internal.cache.RegionEntry; import org.apache.geode.internal.cache.TombstoneService; -import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.DistributedTestUtils; import org.apache.geode.test.dunit.NetworkUtils; @@ -80,12 +81,12 @@ public class TombstoneDUnitTest implements Serializable { VM vm1 = VM.getVM(1); vm0.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE_PERSISTENT); + createCacheAndRegion(REPLICATE_PERSISTENT); region.put("K1", "V1"); region.put("K2", "V2"); }); -vm1.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); +vm1.invoke(() -> createCacheAndRegion(REPLICATE)); vm0.invoke(() -> { // Send tombstone gc message to vm1. @@ -121,13 +122,13 @@ public class TombstoneDUnitTest implements Serializable { // Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE); + createCacheAndRegion(REPLICATE); for (int i = 0; i < count; i++) { region.put("K" + i, "V" + i); } }); -server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); +server2.invoke(() -> createCacheAndRegion(REPLICATE)); server1.invoke(() -> { @@ -165,16 +166,15 @@ public class TombstoneDUnitTest implements Serializable { VM server2 = VM.getVM(1); final int FAR_INTO_THE_FUTURE = 100; // 1 million millis into the future final int count = 2000; -Logger logger = LogService.getLogger(); // Create a cache and load some boiler plate entries server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.PARTITION); + createCacheAndRegion(PARTITION); for (int i = 0; i < count; i++) { region.put("K" + i, "V" + i); } }); -server2.invoke(() -> createCacheAndRegion(RegionShortcut.PARTITION)); +server2.invoke(() -> createCacheAndRegion(PARTITION)); server1.invoke(() -> { @@ -217,13 +217,13 @@ public class TombstoneDUnitTest implements Serializable { VM server2 = VM.getVM(1); final int count = 10; server1.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE); + createCacheAndRegion(REPLICATE); for (int i = 0; i < count; i++) { region.put("K" + i, "V" + i); } }); -server2.invoke(() -> createCacheAndRegion(RegionShortcut.REPLICATE)); +server2.invoke(() -> createCacheAndRegion(REPLICATE)); server1.invoke(() -> { TombstoneService.TombstoneSweeper tombstoneSweeper = @@ -249,7 +249,7 @@ public class TombstoneDUnitTest implements Serializable { // Fire up the server and put in some data that is deletable server.invoke(() -> { - createCacheAndRegion(RegionShortcut.REPLICATE); + createCacheAndRegion(REPLICATE); cache
[geode] branch develop updated (dabb610 -> 3faf283)
This is an automated email from the ASF dual-hosted git repository. nnag pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from dabb610 GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925) add 3faf283 GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6080) No new revisions were added by this update. Summary of changes: geode-assembly/build.gradle| 3 +- .../web/controllers/RestAPICompatibilityTest.java | 201 + .../api/LocatorClusterManagementService.java | 48 - .../functions/CacheRealizationFunction.java} | 11 +- .../internal/cli/functions/RebalanceFunction.java} | 8 +- .../functions/CacheRealizationFunction.java| 1 + .../operation/RebalanceOperationPerformer.java | 34 +++- .../sanctioned-geode-core-serializables.txt| 4 +- .../operation/RebalanceOperationPerformerTest.java | 4 +- .../internal/cli/commands/RebalanceCommand.java| 3 +- .../geode/management/GfshCompatibilityTest.java| 29 ++- 11 files changed, 317 insertions(+), 29 deletions(-) create mode 100644 geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java copy geode-core/src/main/java/org/apache/geode/management/internal/{exceptions/NoMembersException.java => cli/functions/CacheRealizationFunction.java} (75%) copy geode-core/src/main/java/org/apache/geode/{internal/cache/wan/GatewaySenderEventProcessor.java => management/internal/cli/functions/RebalanceFunction.java} (78%)
[geode] branch develop updated (3faf283 -> c650095)
This is an automated email from the ASF dual-hosted git repository. dschneider pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 3faf283 GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6080) add c650095 GEODE-8998: fix NPE caused by thread-monitor-enabled=false (#6083) No new revisions were added by this update. Summary of changes: .../ThreadMonitorDisabledDistributedTest.java | 33 -- .../monitoring/ThreadsMonitoringImplDummy.java | 12 +++- .../monitoring/executor/AbstractExecutor.java | 4 +-- 3 files changed, 36 insertions(+), 13 deletions(-) copy geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/examples/DistributedReferenceCacheExampleTest.java => geode-core/src/distributedTest/java/org/apache/geode/cache/ThreadMonitorDisabledDistributedTest.java (61%)
[geode] branch support/1.13 updated: do more testing in parallel on mature support branches
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new df372ea do more testing in parallel on mature support branches df372ea is described below commit df372eaf202b8bf4b6ee8284aab53aa8019f4337 Author: Owen Nichols AuthorDate: Wed Mar 3 17:48:28 2021 -0800 do more testing in parallel on mature support branches --- ci/pipelines/geode-build/jinja.template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/pipelines/geode-build/jinja.template.yml b/ci/pipelines/geode-build/jinja.template.yml index 2cf04f2..67a8ce4 100644 --- a/ci/pipelines/geode-build/jinja.template.yml +++ b/ci/pipelines/geode-build/jinja.template.yml @@ -539,7 +539,7 @@ jobs: - aggregate: - get: geode-ci passed: &publish-passed-inputs - {{- all_gating_jobs() | indent(6) }} + - Build - get: alpine-tools-image - get: geode passed: *publish-passed-inputs
[geode] branch support/1.12 updated: do more testing in parallel on mature support branches
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new 15dfe9b do more testing in parallel on mature support branches 15dfe9b is described below commit 15dfe9bed57c3eab62d06f79e8afd573844373e1 Author: Owen Nichols AuthorDate: Wed Mar 3 17:48:28 2021 -0800 do more testing in parallel on mature support branches (cherry picked from commit df372eaf202b8bf4b6ee8284aab53aa8019f4337) --- ci/pipelines/geode-build/jinja.template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/pipelines/geode-build/jinja.template.yml b/ci/pipelines/geode-build/jinja.template.yml index 7bb138b..3c16380 100644 --- a/ci/pipelines/geode-build/jinja.template.yml +++ b/ci/pipelines/geode-build/jinja.template.yml @@ -539,7 +539,7 @@ jobs: - aggregate: - get: geode-ci passed: &publish-passed-inputs - {{- all_gating_jobs() | indent(6) }} + - Build - get: alpine-tools-image - get: geode passed: *publish-passed-inputs
[geode-benchmarks] branch develop updated (c973383 -> 05262df)
This is an automated email from the ASF dual-hosted git repository. donalevans pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git. from c973383 Bumping copyright year to 2021 add 8b0ef98 Prevent Travis build timeout new 05262df Prevent Travis build timeout The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: geode-benchmarks/build.gradle | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)
[geode-benchmarks] 01/01: Prevent Travis build timeout
This is an automated email from the ASF dual-hosted git repository. donalevans pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git commit 05262df4162320082a0e4c0734c13b0f90c04add Merge: c973383 8b0ef98 Author: Donal Evans AuthorDate: Wed Mar 3 18:24:49 2021 -0800 Prevent Travis build timeout - Add output after each test completes, as Travis declares a task hung if no output is written for 10 minutes, which is longer than the build and tests take to complete geode-benchmarks/build.gradle | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)
[geode] branch support/1.13 updated: GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6087)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new ef10a36 GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6087) ef10a36 is described below commit ef10a36b0bbee6053b2b5293362285198be976da Author: Nabarun Nag AuthorDate: Wed Mar 3 18:33:05 2021 -0800 GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6087) * Moved new child RebalanceFunction and CacheRealizationFunction to pre 1.12.0 locations. * While talking to pre-1.12.0 servers, the locators send the function from the old package. * While talking to 1.12.0 server, the new package function is used. * For RebalanceFunction and CacheRealizationFunction the serialVersionUID is set to the one created by 1.11.0 for old package location and serialVersionUID created by 1.12.0 for the latter. (cherry picked from commit 3faf283c038880755a7356fe570a4f92a46826cd) --- geode-assembly/build.gradle| 3 +- .../web/controllers/RestAPICompatibilityTest.java | 201 + .../api/LocatorClusterManagementService.java | 48 - .../cli/functions/CacheRealizationFunction.java| 23 +++ .../internal/cli/functions/RebalanceFunction.java | 22 +++ .../functions/CacheRealizationFunction.java| 1 + .../operation/RebalanceOperationPerformer.java | 32 +++- .../sanctioned-geode-core-serializables.txt| 4 +- .../operation/RebalanceOperationPerformerTest.java | 4 +- .../internal/cli/commands/RebalanceCommand.java| 3 +- .../geode/management/GfshCompatibilityTest.java| 29 ++- 11 files changed, 352 insertions(+), 18 deletions(-) diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle index 9f2e7f3..24760ec 100755 --- a/geode-assembly/build.gradle +++ b/geode-assembly/build.gradle @@ -299,8 +299,9 @@ dependencies { upgradeTestCompileOnly(platform(project(':boms:geode-all-bom'))) upgradeTestCompileOnly('io.swagger:swagger-annotations') - upgradeTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'testOutput')) + distributedTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'testOutput')) + testImplementation('org.assertj:assertj-core') upgradeTestRuntimeOnly(project(':extensions:session-testing-war')) upgradeTestRuntimeOnly('org.codehaus.cargo:cargo-core-uberjar') upgradeTestRuntimeOnly('org.apache.httpcomponents:httpclient') diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java new file mode 100644 index 000..11ba362 --- /dev/null +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.apache.geode.rest.internal.web.controllers; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import o
[geode] branch support/1.14 updated: GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6080)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.14 by this push: new b7a931e GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6080) b7a931e is described below commit b7a931e4bc55694438da8e7ec61b79d206d96b5b Author: Nabarun Nag AuthorDate: Wed Mar 3 17:08:59 2021 -0800 GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6080) * Moved new child RebalanceFunction and CacheRealizationFunction to pre 1.12.0 locations. * While talking to pre-1.12.0 servers, the locators send the function from the old package. * While talking to 1.12.0 server, the new package function is used. * For RebalanceFunction and CacheRealizationFunction the serialVersionUID is set to the one created by 1.11.0 for old package location and serialVersionUID created by 1.12.0 for the latter. (cherry picked from commit 3faf283c038880755a7356fe570a4f92a46826cd) --- geode-assembly/build.gradle| 3 +- .../web/controllers/RestAPICompatibilityTest.java | 201 + .../api/LocatorClusterManagementService.java | 48 - .../cli/functions/CacheRealizationFunction.java| 23 +++ .../internal/cli/functions/RebalanceFunction.java | 22 +++ .../functions/CacheRealizationFunction.java| 1 + .../operation/RebalanceOperationPerformer.java | 34 +++- .../sanctioned-geode-core-serializables.txt| 4 +- .../operation/RebalanceOperationPerformerTest.java | 4 +- .../internal/cli/commands/RebalanceCommand.java| 3 +- .../geode/management/GfshCompatibilityTest.java| 29 ++- 11 files changed, 354 insertions(+), 18 deletions(-) diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle index 51af352..8e11e7f 100755 --- a/geode-assembly/build.gradle +++ b/geode-assembly/build.gradle @@ -297,8 +297,9 @@ dependencies { upgradeTestCompileOnly(platform(project(':boms:geode-all-bom'))) upgradeTestCompileOnly('io.swagger:swagger-annotations') - upgradeTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'testOutput')) + distributedTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'testOutput')) + testImplementation('org.assertj:assertj-core') upgradeTestRuntimeOnly(project(':extensions:session-testing-war')) upgradeTestRuntimeOnly('org.codehaus.cargo:cargo-core-uberjar') upgradeTestRuntimeOnly('org.apache.httpcomponents:httpclient') diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java new file mode 100644 index 000..11ba362 --- /dev/null +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPICompatibilityTest.java @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.apache.geode.rest.internal.web.controllers; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +impor
[geode] branch support/1.14 updated (b7a931e -> d201090)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a change to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git. from b7a931e GEODE-8996: Fixed rebalance gfsh and REST API in mixed version mode (#6080) new 453e298 GEODE-8933: update INFO to return maxmemory field (#6019) new d1b8319 GEODE-8894 allow individual deltas to trigger bucket size recalculation (#5978) new 944d796 GEODE-8865: Create additional dunit and integration tests for Redis HMGET (#5945) new d201090 GEODE-8624: Support Redis HINCRBYFLOAT command (#5986) The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../internal/cache/DeltaFaultInDUnitTest.java | 6 +- .../cache/DeltaForceSizingFlagDUnitTest.java | 315 + .../org/apache/geode/internal/cache/TestDelta.java | 28 +- .../src/main/java/org/apache/geode/Delta.java | 35 ++- .../apache/geode/internal/cache/BucketRegion.java | 1 + .../geode/internal/cache/EntryEventImpl.java | 19 +- .../apache/geode/internal/cache/LocalRegion.java | 3 - .../geode/internal/cache/EntryEventImplTest.java | 56 ...a => MemoryStatsNativeRedisAcceptanceTest.java} | 9 +- .../hash/AbstractHashesIntegrationTest.java| 40 +-- .../server/AbstractInfoIntegrationTest.java| 1 + .../AbstractRedisMemoryStatsIntegrationTest.java | 120 ...onTest.java => MemoryStatsIntegrationTest.java} | 4 +- .../internal/executor/server/InfoExecutor.java | 5 +- 14 files changed, 588 insertions(+), 54 deletions(-) create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaForceSizingFlagDUnitTest.java copy geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/server/{InfoNativeRedisAcceptanceTest.java => MemoryStatsNativeRedisAcceptanceTest.java} (78%) create mode 100644 geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractRedisMemoryStatsIntegrationTest.java copy geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/{DBSizeIntegrationTest.java => MemoryStatsIntegrationTest.java} (92%)
[geode] 02/04: GEODE-8894 allow individual deltas to trigger bucket size recalculation (#5978)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git commit d1b8319d7bc46de6b10480ebb0c9df41aeae894e Author: Ray Ingles AuthorDate: Tue Feb 23 12:20:45 2021 -0500 GEODE-8894 allow individual deltas to trigger bucket size recalculation (#5978) * add interface for forcing size recalculation on buckets * Allow individual deltas to trigger bucket size recalculation * remove all deprecated methods and redundant tests * update Javadoc and remove Event instance variable * add EntryEventImpl unit tests for size recalc * remove unused classes/code * remove unused TestKey * reorganize and clarify region creation Co-authored-by: Ray Ingles (cherry-picked from 3a21c2852746f19755ac302f584ca5b8908eae2e) --- .../internal/cache/DeltaFaultInDUnitTest.java | 6 +- .../cache/DeltaForceSizingFlagDUnitTest.java | 315 + .../org/apache/geode/internal/cache/TestDelta.java | 28 +- .../src/main/java/org/apache/geode/Delta.java | 35 ++- .../apache/geode/internal/cache/BucketRegion.java | 1 + .../geode/internal/cache/EntryEventImpl.java | 19 +- .../apache/geode/internal/cache/LocalRegion.java | 3 - .../geode/internal/cache/EntryEventImplTest.java | 56 8 files changed, 437 insertions(+), 26 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaFaultInDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaFaultInDUnitTest.java index 33af502..3f233d6 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaFaultInDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaFaultInDUnitTest.java @@ -32,10 +32,6 @@ import org.apache.geode.test.dunit.SerializableRunnable; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase; -/** - * Test that the bucket size does not go negative when we fault out and in a delta object. - * - */ public class DeltaFaultInDUnitTest extends JUnit4CacheTestCase { @@ -45,7 +41,7 @@ public class DeltaFaultInDUnitTest extends JUnit4CacheTestCase { } @Test - public void test() throws Exception { + public void bucketSizeShould_notGoNegative_onFaultInDeltaObject() throws Exception { final Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaForceSizingFlagDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaForceSizingFlagDUnitTest.java new file mode 100644 index 000..df95e6e --- /dev/null +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaForceSizingFlagDUnitTest.java @@ -0,0 +1,315 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.cache; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.logging.log4j.Logger; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.DataPolicy; +import org.apache.geode.cache.DiskStoreFactory; +import org.apache.geode.cache.EvictionAction; +import org.apache.geode.cache.EvictionAttributes; +import org.apache.geode.cache.InterestPolicy; +import org.apache.geode.cache.PartitionAttributes; +import org.apache.geode.cache.PartitionAttributesFactory; +import org.apache.geode.cache.RegionFactory; +import org.apache.geode.cache.Scope; +import org.apache.geode.cache.SubscriptionAttributes; +import org.apache.geode.cache.util.ObjectSizer; +import org.apache.geode.logging.internal.log4j.api.LogService; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.ClusterStartupRule; +import org.apache.geode.test.dunit.rules.MemberVM; + +/** + * Tests the use of the per-delta "forceRecalculateSize" flag. +
[geode] 03/04: GEODE-8865: Create additional dunit and integration tests for Redis HMGET (#5945)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git commit 944d7969b72cc4aab1a4e5786a34981d389f7c0d Author: Jens Deppe AuthorDate: Sat Jan 23 13:20:44 2021 -0800 GEODE-8865: Create additional dunit and integration tests for Redis HMGET (#5945) (cherry-picked from commit bba1935d98328c7b767adebded577f433e49ba87) --- .../hash/AbstractHashesIntegrationTest.java| 40 +++--- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java index 12d4e56..96493a4 100755 --- a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java +++ b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java @@ -57,8 +57,12 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier } @After - public void tearDown() { + public void flushAll() { jedis.flushAll(); + } + + @After + public void tearDown() { jedis.close(); jedis2.close(); } @@ -145,23 +149,19 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier } @Test - public void testHMGet() { + public void testHMGet_HDel_HGetAll_HVals() { String key = "key"; -Map hash = setupHash(10); +Map hash = new HashMap<>(); +for (int i = 0; i < 10; i++) { + hash.put("field_" + i, "member_" + i); +} jedis.hmset(key, hash); Set keys = hash.keySet(); -String[] keyArray = keys.toArray(new String[0]); +String[] keyArray = keys.toArray(new String[keys.size()]); List retList = jedis.hmget(key, keyArray); assertThat(retList).containsExactlyInAnyOrderElementsOf(hash.values()); - } - - @Test - public void testHgetall() { -String key = "key"; -Map hash = setupHash(10); -jedis.hmset(key, hash); Map retMap = jedis.hgetAll(key); @@ -190,14 +190,6 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier assertThat(jedis.hlen(key)).isEqualTo(0); } - private Map setupHash(int entries) { -Map hash = new HashMap<>(); -for (int i = 0; i < entries; i++) { - hash.put("field-" + i, "member-" + i); -} -return hash; - } - @Test public void testHMGet_returnNull_forUnknownFields() { String key = "key"; @@ -210,7 +202,7 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier } @Test - public void testHMGet_givenTooFewArguments() { + public void testHMGet_givenWrongNumberOfArguments() { assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HMGET)) .hasMessage("ERR wrong number of arguments for 'hmget' command"); assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HMGET, "1")) @@ -967,4 +959,12 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier return args; } + + private Map setupHash(int entries) { +Map hash = new HashMap<>(); +for (int i = 0; i < entries; i++) { + hash.put("field-" + i, "member-" + i); +} +return hash; + } }
[geode] 04/04: GEODE-8624: Support Redis HINCRBYFLOAT command (#5986)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git commit d201090a6ae6ef4d591e936ffce776b3f8919e89 Author: Jens Deppe AuthorDate: Thu Feb 4 05:50:04 2021 -0800 GEODE-8624: Support Redis HINCRBYFLOAT command (#5986) - Switch to using BigDecimal instead of double for increment value. - Improve HINCRBYFLOAT output accuracy for very large values. - Add concurrency tests. - Mark HINCRBYFLOAT as supported. (cherry-picked from 8a0dc1aae8636a44c4fa4d5d30dcbc0efafb4430) --- .../redis/internal/executor/hash/AbstractHashesIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java index 96493a4..d7b606f 100755 --- a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java +++ b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java @@ -202,7 +202,7 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier } @Test - public void testHMGet_givenWrongNumberOfArguments() { + public void testHMGet_givenTooFewArguments() { assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HMGET)) .hasMessage("ERR wrong number of arguments for 'hmget' command"); assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HMGET, "1")) @@ -819,7 +819,7 @@ public abstract class AbstractHashesIntegrationTest implements RedisPortSupplier } @Test - public void testConcurrentHIncrByFloat_sameKeyPerClient() throws InterruptedException { + public void testConcurrentHIncrByFloat_sameKeyPerClient() { String key = "HSET_KEY"; String field = "HSET_FIELD";
[geode] 01/04: GEODE-8933: update INFO to return maxmemory field (#6019)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git commit 453e298cbeaf847b5cb7dd6136858be212f9237f Author: Ray Ingles AuthorDate: Tue Feb 16 09:47:52 2021 -0500 GEODE-8933: update INFO to return maxmemory field (#6019) * Also fix fragmentation ratio Co-authored-by: Ray Ingles (cherry-picked from ab5ef9d46b24bd686d91c920bdbd3dc0a5026e26) --- .../MemoryStatsNativeRedisAcceptanceTest.java | 37 +++ .../server/AbstractInfoIntegrationTest.java| 1 + .../AbstractRedisMemoryStatsIntegrationTest.java | 120 + .../server/MemoryStatsIntegrationTest.java | 30 ++ .../internal/executor/server/InfoExecutor.java | 5 +- 5 files changed, 192 insertions(+), 1 deletion(-) diff --git a/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/server/MemoryStatsNativeRedisAcceptanceTest.java b/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/server/MemoryStatsNativeRedisAcceptanceTest.java new file mode 100644 index 000..4f2d34a --- /dev/null +++ b/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/server/MemoryStatsNativeRedisAcceptanceTest.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.apache.geode.redis.internal.executor.server; + +import org.junit.ClassRule; +import redis.clients.jedis.Jedis; + +import org.apache.geode.NativeRedisTestRule; + +public class MemoryStatsNativeRedisAcceptanceTest extends AbstractRedisMemoryStatsIntegrationTest { + @ClassRule + public static NativeRedisTestRule redis = new NativeRedisTestRule(); + + @Override + public int getPort() { +return redis.getPort(); + } + + @Override + public void configureMemoryAndEvictionPolicy(Jedis jedis) { +jedis.configSet("maxmemory", "200"); +jedis.configSet("maxmemory-policy", "allkeys-lru"); + } +} diff --git a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractInfoIntegrationTest.java b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractInfoIntegrationTest.java index 83e3e3c..84b3043 100644 --- a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractInfoIntegrationTest.java +++ b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractInfoIntegrationTest.java @@ -80,6 +80,7 @@ public abstract class AbstractInfoIntegrationTest implements RedisPortSupplier { final List MEMORY_PROPERTIES = Arrays.asList( "# Memory", + "maxmemory:", "used_memory:", "mem_fragmentation_ratio:"); diff --git a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractRedisMemoryStatsIntegrationTest.java b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractRedisMemoryStatsIntegrationTest.java new file mode 100644 index 000..85de4fe --- /dev/null +++ b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractRedisMemoryStatsIntegrationTest.java @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.redis.internal.executor.server; + +import static org.assert
[geode] branch support/1.14 updated: GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925)
This is an automated email from the ASF dual-hosted git repository. jchen21 pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.14 by this push: new 6b85568 GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925) 6b85568 is described below commit 6b85568cc21678d5854fb89f2fdaecd2a22ccd2f Author: Jianxia Chen <11181423+jche...@users.noreply.github.com> AuthorDate: Wed Mar 3 09:19:36 2021 -0800 GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925) For PdxInstance, return a new reference in LocalRegion.optimizedGetObject(), instead of using the value in the Future. This is to avoid Pdx corruption when multiple threads share the same reference of PdxInstance. (cherry picked from commit dabb610b74bb0b27603d7803ec3cdd1cbb16c43f) --- .../cache/RegionConcurrentOperationDUnitTest.java | 102 - .../apache/geode/internal/cache/LocalRegion.java | 33 --- .../geode/internal/cache/LocalRegionTest.java | 43 + 3 files changed, 146 insertions(+), 32 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java index d0ccd1d..cda199d 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java @@ -14,41 +14,42 @@ */ package org.apache.geode.internal.cache; +import static org.apache.geode.cache.RegionShortcut.PARTITION; import static org.apache.geode.cache.RegionShortcut.REPLICATE; import static org.apache.geode.cache.RegionShortcut.REPLICATE_PROXY; import static org.apache.geode.test.dunit.VM.getVM; import static org.assertj.core.api.Assertions.assertThat; import java.io.Serializable; +import java.time.Duration; +import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.junit.After; import org.junit.Rule; import org.junit.Test; +import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.CacheLoader; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.LoaderHelper; import org.apache.geode.cache.Region; import org.apache.geode.cache.Scope; -import org.apache.geode.test.dunit.DUnitBlackboard; +import org.apache.geode.pdx.PdxReader; +import org.apache.geode.pdx.PdxSerializable; +import org.apache.geode.pdx.PdxWriter; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.DistributedBlackboard; import org.apache.geode.test.dunit.rules.DistributedRule; import org.apache.geode.test.junit.rules.ExecutorServiceRule; public class RegionConcurrentOperationDUnitTest implements Serializable { - private static DUnitBlackboard blackboard; - Object key = "KEY"; String value = "VALUE"; - private static DUnitBlackboard getBlackboard() { -if (blackboard == null) { - blackboard = new DUnitBlackboard(); -} + private DistributedBlackboard getBlackboard() { return blackboard; } @@ -61,10 +62,8 @@ public class RegionConcurrentOperationDUnitTest implements Serializable { @Rule public ExecutorServiceRule executorServiceRule = new ExecutorServiceRule(); - @After - public void tearDown() { -blackboard.initBlackboard(); - } + @Rule + public DistributedBlackboard blackboard = new DistributedBlackboard(); @Test public void getOnProxyRegionFromMultipleThreadsReturnsDifferentObjects() throws Exception { @@ -80,13 +79,13 @@ public class RegionConcurrentOperationDUnitTest implements Serializable { .setCacheLoader(new TestCacheLoader()).create(regionName); }); -Future get1 = executorServiceRule.submit(() -> { - Region region = cacheRule.getCache().getRegion(regionName); +Future get1 = executorServiceRule.submit(() -> { + Region region = cacheRule.getCache().getRegion(regionName); return region.get(key); }); -Future get2 = executorServiceRule.submit(() -> { - Region region = cacheRule.getCache().getRegion(regionName); +Future get2 = executorServiceRule.submit(() -> { + Region region = cacheRule.getCache().getRegion(regionName); getBlackboard().waitForGate("Loader", 60, TimeUnit.SECONDS); return region.get(key); }); @@ -113,13 +112,13 @@ public class RegionConcurrentOperationDUnitTest implements Serializable { }); assertThat(cacheRule.getCache().getRegion(regionName).size()).isEqualTo(0); -Future get1 = executorServiceRule.submit(() -> { - Region reg
[geode] branch support/1.13 updated: GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925)
This is an automated email from the ASF dual-hosted git repository. jchen21 pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new 35d2305 GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925) 35d2305 is described below commit 35d230586db7d5a4eee8b91ee93ce0b4ee2c7c67 Author: Jianxia Chen <11181423+jche...@users.noreply.github.com> AuthorDate: Wed Mar 3 09:19:36 2021 -0800 GEODE-8671: Two threads calling get and retrieve the same PdxInstance, resulting in corruption (#5925) For PdxInstance, return a new reference in LocalRegion.optimizedGetObject(), instead of using the value in the Future. This is to avoid Pdx corruption when multiple threads share the same reference of PdxInstance. (cherry picked from commit dabb610b74bb0b27603d7803ec3cdd1cbb16c43f) --- .../cache/RegionConcurrentOperationDUnitTest.java | 102 - .../apache/geode/internal/cache/LocalRegion.java | 33 --- .../geode/internal/cache/LocalRegionTest.java | 43 + 3 files changed, 146 insertions(+), 32 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java index d0ccd1d..cda199d 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java @@ -14,41 +14,42 @@ */ package org.apache.geode.internal.cache; +import static org.apache.geode.cache.RegionShortcut.PARTITION; import static org.apache.geode.cache.RegionShortcut.REPLICATE; import static org.apache.geode.cache.RegionShortcut.REPLICATE_PROXY; import static org.apache.geode.test.dunit.VM.getVM; import static org.assertj.core.api.Assertions.assertThat; import java.io.Serializable; +import java.time.Duration; +import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.junit.After; import org.junit.Rule; import org.junit.Test; +import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.CacheLoader; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.LoaderHelper; import org.apache.geode.cache.Region; import org.apache.geode.cache.Scope; -import org.apache.geode.test.dunit.DUnitBlackboard; +import org.apache.geode.pdx.PdxReader; +import org.apache.geode.pdx.PdxSerializable; +import org.apache.geode.pdx.PdxWriter; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.DistributedBlackboard; import org.apache.geode.test.dunit.rules.DistributedRule; import org.apache.geode.test.junit.rules.ExecutorServiceRule; public class RegionConcurrentOperationDUnitTest implements Serializable { - private static DUnitBlackboard blackboard; - Object key = "KEY"; String value = "VALUE"; - private static DUnitBlackboard getBlackboard() { -if (blackboard == null) { - blackboard = new DUnitBlackboard(); -} + private DistributedBlackboard getBlackboard() { return blackboard; } @@ -61,10 +62,8 @@ public class RegionConcurrentOperationDUnitTest implements Serializable { @Rule public ExecutorServiceRule executorServiceRule = new ExecutorServiceRule(); - @After - public void tearDown() { -blackboard.initBlackboard(); - } + @Rule + public DistributedBlackboard blackboard = new DistributedBlackboard(); @Test public void getOnProxyRegionFromMultipleThreadsReturnsDifferentObjects() throws Exception { @@ -80,13 +79,13 @@ public class RegionConcurrentOperationDUnitTest implements Serializable { .setCacheLoader(new TestCacheLoader()).create(regionName); }); -Future get1 = executorServiceRule.submit(() -> { - Region region = cacheRule.getCache().getRegion(regionName); +Future get1 = executorServiceRule.submit(() -> { + Region region = cacheRule.getCache().getRegion(regionName); return region.get(key); }); -Future get2 = executorServiceRule.submit(() -> { - Region region = cacheRule.getCache().getRegion(regionName); +Future get2 = executorServiceRule.submit(() -> { + Region region = cacheRule.getCache().getRegion(regionName); getBlackboard().waitForGate("Loader", 60, TimeUnit.SECONDS); return region.get(key); }); @@ -113,13 +112,13 @@ public class RegionConcurrentOperationDUnitTest implements Serializable { }); assertThat(cacheRule.getCache().getRegion(regionName).size()).isEqualTo(0); -Future get1 = executorServiceRule.submit(() -> { - Region reg