You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/12/14 18:48:10 UTC

[GitHub] [geode] albertogpz commented on a change in pull request #5845: GEODE-8783: Publish batchesWithIncompleteTransactions in GatewaySende…

albertogpz commented on a change in pull request #5845:
URL: https://github.com/apache/geode/pull/5845#discussion_r542635697



##########
File path: geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
##########
@@ -467,8 +467,66 @@ public void testPRParallelPropagationWithGroupTransactionEventsSendsBatchesWithC
     assertEquals(0, v4List.get(5) + v5List.get(5) + v6List.get(5) + v7List.get(5));
     // events not queued conflated:
     assertEquals(0, v4List.get(7) + v5List.get(7) + v6List.get(7) + v7List.get(7));
+    // batches with incomplete transactions
+    assertEquals(0, (int) v4List.get(13));
+
+  }
+
+  @Test
+  public void testPRParallelPropagationWithGroupTransactionEventsWithIncompleteTransactions() {
+    Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
+    Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
+
+    createCacheInVMs(nyPort, vm2);
+    createReceiverInVMs(vm2);
+
+    int dispThreads = 2;
+    createSenderInVm(lnPort, vm4, dispThreads);
+
+    createReceiverPR(vm2, 0);
+
+    createSenderPRInVM(0, vm4);
+
+    startSenderInVMs("ln", vm4);
+
+    // Adding events in transactions
+    final Map<Object, Object> keyValue = new HashMap<>();
+    int entries = 30;
+    for (int i = 0; i < entries; i++) {
+      keyValue.put(i, i);
+    }
+
+    int entriesPerTransaction = 3;
+    vm4.invoke(
+        () -> WANTestBase.doPutsInsideTransactions(testName, keyValue, entriesPerTransaction));
+
+    vm4.invoke(() -> WANTestBase.validateRegionSize(testName, entries));
+
+    ArrayList<Integer> v4List =
+        (ArrayList<Integer>) vm4.invoke(() -> WANTestBase.getSenderStats("ln", 0));
+
+    int batches = 4;

Review comment:
       Very good question. I will try to clarify it in a comment in the test case.




----------------------------------------------------------------
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:
users@infra.apache.org