albertogpz commented on a change in pull request #6052:
URL: https://github.com/apache/geode/pull/6052#discussion_r591130076
##########
File path:
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
##########
@@ -472,6 +473,200 @@ public void
testPRParallelPropagationWithGroupTransactionEventsSendsBatchesWithC
}
+ @Test
+ public void
testPRParallelPropagationWithGroupTransactionEventsDoesNotSendBatchesWithIncompleteTransactionsIfGatewaySenderIsStoppedWhileReceivingTrafficAndLaterStarted()
+ throws InterruptedException {
+ Integer lnPort = vm0.invoke(() ->
WANTestBase.createFirstLocatorWithDSId(1));
+ Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2,
lnPort));
+
+ createCacheInVMs(nyPort, vm2);
+ createReceiverCustomerOrderShipmentPR(vm2);
+ createReceiverInVMs(vm2);
+
+ createCacheInVMs(lnPort, vm4, vm5);
+ createSenderCustomerOrderShipmentPRs(vm4);
+ createSenderCustomerOrderShipmentPRs(vm5);
+
+ int batchSize = 10;
+ vm4.invoke(
+ () -> WANTestBase.createSender("ln", 2, true, 100, batchSize, false,
true, null, false,
+ true));
+ vm5.invoke(
+ () -> WANTestBase.createSender("ln", 2, true, 100, batchSize, false,
true, null, false,
+ true));
+
+ int customers = 4;
+ int transactionsPerCustomer = 100;
+ // Each transaction will contain one order plus the following shipments
+ int shipmentsPerTransaction = batchSize;
+ AsyncInvocation<Void> inv1 = asyncExecuteCustomerTransactions(vm4,
customers,
+ transactionsPerCustomer, shipmentsPerTransaction);
+
+ // wait for some batches to be distributed and then stop the sender
+ vm4.invoke(() -> await()
+ .until(() -> WANTestBase.getSenderStats("ln", -1).get(4) > 0));
+
+ stopSenderInVMsAsync("ln", vm4, vm5);
+
+ // Wait for customer transactions to finish
+ inv1.await();
+ int orderEntries = transactionsPerCustomer * customers;
+ int shipmentEntries = orderEntries * 10;
Review comment:
Totally agree
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]