[ 
https://issues.apache.org/jira/browse/GEODE-8783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249177#comment-17249177
 ] 

ASF GitHub Bot commented on GEODE-8783:
---------------------------------------

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



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -1354,6 +1355,7 @@ private void 
peekEventsFromIncompleteTransactions(List<GatewaySenderEventImpl> b
       return;
     }
 
+    boolean areAllEventsForTransactionsInBatch = true;

Review comment:
       The name of this variable is too similar to the already existing 
`areAllEventsForTransactionInBatch`, which is confusing. Please rename one or 
both of them to make it clearer what they are keeping track of.

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderStats.java
##########
@@ -240,6 +246,9 @@ protected static StatisticsType createType(final 
StatisticsTypeFactory f, final
             f.createIntCounter(BATCHES_REDISTRIBUTED,
                 "Number of batches of events removed from the event queue and 
resent.",
                 "operations", false),
+            f.createIntCounter(BATCHES_WITH_INCOMPLETE_TRANSACTIONS,
+                "Number of batches of events sent with incomplete 
transactions.",
+                "operations", false),

Review comment:
       The `createIntCounter()` method is deprecated. As per the javadocs on 
the method, `createLongCounter()` should be used instead.

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
##########
@@ -486,6 +486,7 @@ private void 
peekEventsFromIncompleteTransactions(List<AsyncEvent<?, ?>> batch,
       return;
     }
 
+    boolean areAllEventsForTransactionsInBatch = true;

Review comment:
       The name of this variable is too similar to the already existing 
areAllEventsForTransactionInBatch, which is confusing. Please rename one or 
both of them to make it clearer what they are keeping track of.

##########
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:
       It's not clear to me where this value is coming from. How do we know 
that we expect 4 batches with incomplete transactions here?




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


> Publish batchesWithIncompleteTransactions in GatewaySenderMXBean
> ----------------------------------------------------------------
>
>                 Key: GEODE-8783
>                 URL: https://issues.apache.org/jira/browse/GEODE-8783
>             Project: Geode
>          Issue Type: Improvement
>          Components: docs, jmx, wan
>            Reporter: Alberto Gomez
>            Assignee: Alberto Gomez
>            Priority: Major
>              Labels: pull-request-available
>
> It would be interesting to have a counter called 
> "batchesWithIncompleteTransactions" in the GatewaySenderMXBean that shows the 
> number of batches sent with incomplete transactions. 
> The reason is that it may not be guaranteed that all the events for a 
> transaction will be sent in the same batch, even if group-transaction-events 
> is enabled, due to a wrong configuration or under very high traffic 
> conditions.
> It would be advisable to document this possibility and also relate it the new 
> counter.
> For completeness sake, it would also be desirable to have batchesDistributed 
> (given that batchesRedistributed and now batchesWithIncompleteTransactions) 
> also published in the GatewaySenderMXBean.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to