[
https://issues.apache.org/jira/browse/GEODE-7971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17094826#comment-17094826
]
ASF GitHub Bot commented on GEODE-7971:
---------------------------------------
boglesby commented on pull request #4928:
URL: https://github.com/apache/geode/pull/4928#issuecomment-620812923
The next peeked batch doesn't contain 11 events. It only contains 5. This is
because the previous batch failed to be sent which causes addPeekedEvents to
actually do something. In this case, it adds batchSize number of events to the
batch since these events have already been peeked. When this method returns,
the batch contains batchSize events so the loop is short-circuited, and the
incompleteTransactionsInBatch processing doesn't occur.
Here is the behavior:
addPeekedEvents adds 5 previously peeked events to the batch:
```
Event Processor for GatewaySender_ny_3:
ParallelGatewaySenderQueue.addPeekedEvents added 5 previously peeked events to
the batch:
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=0;bucketId=48];action=0;operation=CREATE;region=/customer;key=0;value=Customer[id=0;
name=name-0];creationTime=1588101080903;shadowKey=161;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=1;bucketId=48];action=0;operation=CREATE;region=/order;key=0-0;value=Order[id=0-0;
customerId=0];creationTime=1588101080906;shadowKey=274;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=2;bucketId=48];action=0;operation=CREATE;region=/order;key=0-1;value=Order[id=0-1;
customerId=0];creationTime=1588101080906;shadowKey=387;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=3;bucketId=48];action=0;operation=CREATE;region=/order;key=0-2;value=Order[id=0-2;
customerId=0];creationTime=1588101080906;shadowKey=500;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=4;bucketId=48];action=0;operation=CREATE;region=/order;key=0-3;value=Order[id=0-3;
customerId=0];creationTime=1588101080906;shadowKey=613;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
```
peekEventsFromIncompleteTransactions short-circuits because returns because
areAllTransactionsCompleteInBatch is true:
```
Event Processor for GatewaySender_ny_3:
ParallelGatewaySenderQueue.peekEventsFromIncompleteTransactions
areAllTransactionsCompleteInBatch=true
```
The final batch contains 5 events:
```
Event Processor for GatewaySender_ny_3: ParallelGatewaySenderQueue.peek
final batch 1156975981 contains 5 events:
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=0;bucketId=48];action=0;operation=CREATE;region=/customer;key=0;value=Customer[id=0;
name=name-0];creationTime=1588101080903;shadowKey=161;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=1;bucketId=48];action=0;operation=CREATE;region=/order;key=0-0;value=Order[id=0-0;
customerId=0];creationTime=1588101080906;shadowKey=274;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=2;bucketId=48];action=0;operation=CREATE;region=/order;key=0-1;value=Order[id=0-1;
customerId=0];creationTime=1588101080906;shadowKey=387;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=3;bucketId=48];action=0;operation=CREATE;region=/order;key=0-2;value=Order[id=0-2;
customerId=0];creationTime=1588101080906;shadowKey=500;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
GatewaySenderEventImpl[id=EventID[id=23
bytes;threadID=0x10030|4;sequenceID=4;bucketId=48];action=0;operation=CREATE;region=/order;key=0-3;value=Order[id=0-3;
customerId=0];creationTime=1588101080906;shadowKey=613;timeStamp=1588101080897;transactionId=TXId:
192.168.1.8(ln-client:93385:loner):55648:ae6333c2:ln-client:1;isLastEventInTransaction=false]
```
----------------------------------------------------------------
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]
> Gateway sender to deliver transaction events atomically to gateway receivers
> ----------------------------------------------------------------------------
>
> Key: GEODE-7971
> URL: https://issues.apache.org/jira/browse/GEODE-7971
> Project: Geode
> Issue Type: Improvement
> Components: wan
> Reporter: Alberto Gomez
> Assignee: Alberto Gomez
> Priority: Major
> Fix For: 1.13.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The goal of this ticket is to implement the necessary changes in the gateway
> sender to prevent that events belonging to the same transaction are spread
> across different batches. In other words, to ensure that events from the same
> transaction are sent inside the same batch.
> This will be an optional feature on gateway senders to be enabled via a new
> parameter (--group-transaction-events) and will be restricted to serial
> gateway senders with just one dispatcher thread or to parallel gateway
> senders.
> Apart from the above restriction, grouping of events for a transaction inside
> the same batch may only be attained if the regions to which the events belong
> are replicated by the same set of gateway senders with the
> --group-transaction-events flag enabled. If this condition is not met, the
> events will be correctly delivered by the gateway senders but it will not be
> guaranteed that all events will always be sent inside the same batch.
> For more details see:
> [https://cwiki.apache.org/confluence/display/GEODE/Gw+sender+to+deliver+transaction+events+atomically+to+receivers]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)