[jbossts-issues] [JBoss JIRA] (JBTM-3351) clearHeuristic management operation should clear participant's heuristic flag as well as it clears the transaction heuristic flag

Ondrej Chaloupka (Jira) issues at jboss.org
Fri Aug 7 11:28:00 EDT 2020


    [ https://issues.redhat.com/browse/JBTM-3351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14368101#comment-14368101 ] 

Ondrej Chaloupka edited comment on JBTM-3351 at 8/7/20 11:27 AM:
-----------------------------------------------------------------

After the discussion with [~mmusgrov] it's clear that the `:recover` call from WildFly jboss-cli.sh which invokes the `clearHeuristic` should make changes for the participant record if needed. Every record has to imlement that functionality as it inherits from `AbastractRecord`. For `XAResourceRecord` the record is marked with `_heuristic`

The operation to be used is the `AbstractRecord#forgetHeuristic`. The `XAResourcRecorde#forgetHeuristic` cleans the `_heuristc` flag, it calls `XAResource.forget(Xid)` and it removes the connection to the XAResource. But neither of later two is an issue as the `XAResource` ignores the `forget(Xid)` call if the transaction is not heuristically finished (by XA spec) and the connection is no more needed as the recovery will re-create the connection to the resource if neeeded. 
If the XAResource transaction is not heuristically finished then the forget(Xid) call is ignored by RM. In such case the recovery may retry the attempt and it's ok. If the XAREsource was heuristically finished then there is no way to succesfully retry the transaction.

For `:recover` works the XAResourceRecord needs to be reactivated and replayed by recovery manager. The operation of `forgetHeuristic` clears the problematic flag and let the next recovery cycle to retry the attempt.


was (Author: ochaloup):
After the discussion with [~mmusgrov] it's clear that the `:recover` call from WildFly jboss-cli.sh which invokes the `clearHeuristic` should make changes for the participant record marked with `_heuristic`
It could be used the `AbstractRecord#forgetHeuristic`. The `XAResource#forgetHeuristic`does some more things as it calls `XAResource.forget(Xid)` and it removes the connection to the XAResource. But neither of two is an issue as the `XAResource` ignores the `forget(Xid)` call if the transaction is not heuristically finished (by XA spec) and the connection is no more needed as the recovery will re-create the connection to the resource if neeeded. 
If the XAResource transaction is not heuristically finished then the forget(Xid) call is ignored by RM. In such case the recovery may retry the attempt and it's ok. If the XAREsource was heuristically finished then there is no way to succesfully retry the transaction.

For `:recover` works the XAResourceRecord needs to be reactivated and replayed by recovery manager. The operation of `forgetHeuristic` clears the problematic flag and let the next recovery cycle to retry the attempt.

> clearHeuristic management operation should clear participant's heuristic flag as well as it clears the transaction heuristic flag
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBTM-3351
>                 URL: https://issues.redhat.com/browse/JBTM-3351
>             Project: JBoss Transaction Manager
>          Issue Type: Bug
>          Components: Configuration, Transaction Core
>    Affects Versions: 5.10.5.Final
>            Reporter: Ondrej Chaloupka
>            Assignee: Ondrej Chaloupka
>            Priority: Major
>
> The management operation {{clearHeuristic}} should consider to clear heuristic flag not only from the transaction ({{BasicAction}}) but from the participant record as well - when possible, e.g. the XA resource record maintains heuristic flag for participant and thus it should be cleared on the operation.
> The current management operation {{'clearHeuristic'}} is invoked only on the "covering" transaction - {{BasicAction}} is modified[1] -> [2] -> [3]. But the {{XAResourceRecord}} heuristics state[4] is unchanged. Then during recovery commit retry the {{XAResource.commit}} is denied[5].
> [1]  https://github.com/jbosstm/narayana/blob/5.10.5.Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/osb/mbean/ActionBean.java#L433
> [2] https://github.com/jbosstm/narayana/blob/5.10.5.Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/osb/mbean/ActionBean.java#L295
> [3] https://github.com/jbosstm/narayana/blob/5.10.5.Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java#L2551
> [4] https://github.com/jbosstm/narayana/blob/5.10.5.Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java#L1320
> [5] https://github.com/jbosstm/narayana/blob/5.10.5.Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java#L463



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jbossts-issues mailing list