Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.1.0
Description
If target is not set earlier, it will be set in function execution code. It could cause issue when rebalance occurs during function execution by setting target to another node when the local member already hosts the transaction. If target was set earlier, the following code can detect it and throw TransactionDataRebalancedException.
public void validateExecution(Function function, Set targetMembers) {
InternalCache cache = pr.getGemFireCache();
if (cache.getTxManager().getTXState() != null) {
if (targetMembers.size() > 1)
else {
assert targetMembers.size() == 1;
DistributedMember funcTarget = (DistributedMember) targetMembers.iterator().next();
DistributedMember target = cache.getTxManager().getTXState().getTarget();
if (target == null)
else if (!target.equals(funcTarget))
{ throw new TransactionDataRebalancedException( String.format( "Function execution is not colocated with transaction. The transactional data is hosted on node %s, but you are trying to target node %s", target, funcTarget)); } }
}
cache.getInternalResourceManager().getHeapMonitor().checkForLowMemory(function, targetMembers);
}
Attachments
Issue Links
- links to