pivotal-eshu commented on a change in pull request #6625:
URL: https://github.com/apache/geode/pull/6625#discussion_r657570317
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
##########
@@ -391,9 +416,34 @@ void send(TXLockId lockId) {
setRecipientsSendData(Collections.singleton(indivRecip.next()), processor, rcl);
}
} else {
- // Run in normal mode sending to multiple recipients in
- // one shot
- setRecipientsSendData(recipients, processor, rcl);
+ Set<InternalDistributedMember> tempNotificationOnlyMembers =
+ new HashSet<InternalDistributedMember>();
+ Set<InternalDistributedMember> tempTransactionMembers =
+ new HashSet<InternalDistributedMember>();
+ if (!rcl.isEmpty() && !getNotificationOnlyMembers().isEmpty()) {
+ for (RegionCommit rc : rcl) {
+ Set<InternalDistributedMember> getNOM =
getNotificationOnlyMembers().get(rc);
+ Set<InternalDistributedMember> getTM =
getTransactionMembers().get(rc);
+ if (getNOM != null && !getNOM.isEmpty()) {
+ tempNotificationOnlyMembers.addAll(getNOM);
+ }
+ if (getTM != null && !getTM.isEmpty()) {
+ tempTransactionMembers.addAll(getTM);
+ }
+ }
+ tempNotificationOnlyMembers.removeAll(tempTransactionMembers);
+ }
+
+ if (tempNotificationOnlyMembers.isEmpty()) {
+ // Run in normal mode sending to multiple recipients in one
shot
+ setRecipientsSendData(recipients, processor, rcl);
+ } else {
+ recipients.removeAll(tempNotificationOnlyMembers);
Review comment:
This still has the same issue as multiple TxCommitMessages (for
different rcl) being sent to the same remote server.
Let's say there are only 2 rcls in the tx. First rcl contains 1 RegionCommit
on bucket_1. TxCommitMessage (containing the rcl) should be sent to remote
server1 as redundant server. (assume server 2 will be the
notificationOnlyMember due to cq/subscription etc). This will cause on first
rcl being sent to both server1 and server2.
Second rcl also contains 1 RegionCommit on bucket_2. Server 2 is the
redundant server, and server 1 needs to be set as notification only member.
This will cause the second TxCommitMessage (containing second rcl) being sent
to both server1 and server2.
As a result, some of the RCLs is not being processed - causing data
inconsistency. Each server should only receive one TxCommitMessage for a tx.
When processing second rcl (
--
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]