use of org.apache.geode.internal.cache.wan.BatchException70 in project geode by apache.
the class ConcurrentWANPropagation_1_DUnitTest method testReplicatedSerialPropagationWithRemoteRegionDestroy2.
/**
* Two regions configured in local with the same sender and put is in progress on both the
* regions. Same two regions are configured on remote site as well. One of the two regions is
* destroyed in the middle on remote site.
*
* @throws Exception
*/
@Test
public void testReplicatedSerialPropagationWithRemoteRegionDestroy2() throws Exception {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
// these are part of remote site
createCacheInVMs(nyPort, vm2, vm3);
createReceiverInVMs(vm2, vm3);
// these are part of local site
createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
// senders are created on local site
vm4.invoke(() -> WANTestBase.createConcurrentSender("ln", 2, false, 100, 200, false, false, null, true, 5, OrderPolicy.THREAD));
vm5.invoke(() -> WANTestBase.createConcurrentSender("ln", 2, false, 100, 200, false, false, null, true, 5, OrderPolicy.THREAD));
// create one RR (RR_1) on remote site
vm2.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap()));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap()));
// create another RR (RR_2) on remote site
vm2.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", null, isOffHeap()));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", null, isOffHeap()));
// start the senders on local site
startSenderInVMs("ln", vm4, vm5);
// create one RR (RR_1) on local site
vm4.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
vm5.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
vm6.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
vm7.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
// create another RR (RR_2) on local site
vm4.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
vm5.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
vm6.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
vm7.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
// destroy RR_2 on remote site in the middle
vm2.invoke(() -> WANTestBase.destroyRegion(getTestMethodName() + "_RR_2"));
// expected exceptions in the logs
IgnoredException.addIgnoredException(BatchException70.class.getName());
IgnoredException.addIgnoredException(ServerOperationException.class.getName());
// start puts in RR_2 in another thread
vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_RR_2", 1000));
// start puts in RR_1 in another thread
AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_RR_1", 1000));
try {
inv1.join();
} catch (InterruptedException e) {
e.printStackTrace();
fail();
}
// though region RR_2 is destroyed, RR_1 should still get all the events put in it
// in local site
vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR_1", 1000));
}
use of org.apache.geode.internal.cache.wan.BatchException70 in project geode by apache.
the class SerialWANPropagationDUnitTest method testReplicatedSerialPropagationWithRemoteRegionDestroy2.
/**
* Two regions configured in local with the same sender and put is in progress on both the
* regions. Same two regions are configured on remote site as well. One of the two regions is
* destroyed in the middle on remote site.
*/
@Test
public void testReplicatedSerialPropagationWithRemoteRegionDestroy2() throws Exception {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
// these are part of remote site
createCacheInVMs(nyPort, vm2, vm3);
createReceiverInVMs(vm2, vm3);
// these are part of local site
createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
// senders are created on local site
vm4.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 200, false, false, null, true));
vm5.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 200, false, false, null, true));
// create one RR (RR_1) on remote site
vm2.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap()));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap()));
// create another RR (RR_2) on remote site
vm2.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", null, isOffHeap()));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", null, isOffHeap()));
// start the senders on local site
startSenderInVMs("ln", vm4, vm5);
// create one RR (RR_1) on local site
vm4.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
vm5.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
vm6.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
vm7.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
// create another RR (RR_2) on local site
vm4.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
vm5.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
vm6.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
vm7.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_2", "ln", isOffHeap()));
// destroy RR_2 on remote site in the middle
vm2.invoke(() -> WANTestBase.destroyRegion(getTestMethodName() + "_RR_2"));
// expected exceptions in the logs
IgnoredException.addIgnoredException(BatchException70.class.getName());
IgnoredException.addIgnoredException(ServerOperationException.class.getName());
// start puts in RR_2 in another thread
vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_RR_2", 1000));
// start puts in RR_1 in another thread
AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_RR_1", 1000));
inv1.join();
// though region RR_2 is destroyed, RR_1 should still get all the events put in it
// in local site
vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR_1", 1000));
}
Aggregations