You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Eric Shu (JIRA)" <ji...@apache.org> on 2018/10/29 23:18:00 UTC

[jira] [Updated] (GEODE-5953) TXStateProxyImpl target needs to be set to local member if it contains TXState

     [ https://issues.apache.org/jira/browse/GEODE-5953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Shu updated GEODE-5953:
----------------------------
    Affects Version/s: 1.1.0

> TXStateProxyImpl target needs to be set to local member if it contains TXState
> ------------------------------------------------------------------------------
>
>                 Key: GEODE-5953
>                 URL: https://issues.apache.org/jira/browse/GEODE-5953
>             Project: Geode
>          Issue Type: Bug
>          Components: transactions
>    Affects Versions: 1.1.0
>            Reporter: Eric Shu
>            Assignee: Eric Shu
>            Priority: Major
>
> 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) {
>         throw new TransactionException(
>             "Function inside a transaction cannot execute on more than one node");
>       } else {
>         assert targetMembers.size() == 1;
>         DistributedMember funcTarget = (DistributedMember) targetMembers.iterator().next();
>         DistributedMember target = cache.getTxManager().getTXState().getTarget();
>         if (target == null) {
>           cache.getTxManager().getTXState().setTarget(funcTarget);
>         } 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);
>   }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)