You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Weston M. Price (JIRA)" <ji...@apache.org> on 2012/05/09 16:27:50 UTC

[jira] [Created] (QPID-3990) Multiple XAResources isSameRM behavior

Weston M. Price created QPID-3990:
-------------------------------------

             Summary: Multiple XAResources isSameRM behavior
                 Key: QPID-3990
                 URL: https://issues.apache.org/jira/browse/QPID-3990
             Project: Qpid
          Issue Type: Bug
          Components: Java Client, JCA
    Affects Versions: 0.14, 0.17
         Environment: All supported OS platforms. All supported JEE platforms.
            Reporter: Weston M. Price
            Assignee: Weston M. Price
            Priority: Critical


In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 

According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 

While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 

I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274002#comment-13274002 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------



bq.  On 2012-05-12 00:01:58, rajith attapattu wrote:
bq.  > Based on the description of the problem and the proposed solution the code appears to be doing whats expected.
bq.  > There are a few whitespace errors that could be removed. On eclipse ctr-a and ctr-i should take care of it provided you have set tabs to whitespace.
bq.  > 
bq.  > For my own understand, could you please explain if there could be any implications/corner cases when a particular XAResource calls start and end on the other XAResources participating in the transaction even though they are all managed by the same Resource Manager. In particular is there some sort of ordering that should be preserved when this is called? How about error handling? What if one of the XAResources fail/throw exception when start or end is called ?
bq.  > (I assume under normal circumstances the RM would call these methods and would be in a position to handle these situations. In the above case the XAResource (all though being called by an RM) would act as a proxy for it's siblings). Is my understanding correct ? If not are you able to briefly explain the flow here ?
bq.  
bq.  Weston Price wrote:
bq.      Good question. It's important to keep in mind in a typical XA flow, an XAResource never calls anything on another XAResource as the TransactionManager does this. However, as the original description mentions, the issue here is that because the XAResources in question are on the same transaction branch, the TM only calls start/end on the first XAResource discovered in the protocol and as a result the other XAResources are not allowed to complete correctly. Another way to put this is that doing correctly support joining multiple XAResources in the same transaction from the same ResourceManager (Broker).
bq.      
bq.      The isSameRM method provides a convenient place to 'intercept' the XA flow being that the TM always calls this when another XAResource is being enlisted in the transaction. Because of this fact, the correct order will always be maintained, however, a good test case would be more than two XAResources. I will add this.
bq.      
bq.      Again, this 'fix' is simply to address what is either a discrepancy between the XA and AMQP specs, or an incorrect implementation on the Broker (both Java and C++). It's not ideal, but currently if we don't provide some sort of solution, and code involving multiple XAResources from the same Broker will not work at all which, in my opinion has severe consequences beyond introducing a fix in the JMS/JCA code.

Also, I will remove the whitespace. I typically use Vi which does this automatically but I happened to use Eclipse for this one task. I will take care of it and thanks for pointing it out.


- Weston


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/#review7820
-----------------------------------------------------------


On 2012-05-09 17:41:59, Weston Price wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/5079/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-05-09 17:41:59)
bq.  
bq.  
bq.  Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.
bq.  
bq.  While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.
bq.  
bq.  The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.
bq.  
bq.  
bq.  This addresses bug QPID-3990.
bq.      https://issues.apache.org/jira/browse/QPID-3990
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQXAResource.java PRE-CREATION 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1336275 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1336275 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1336275 
bq.  
bq.  Diff: https://reviews.apache.org/r/5079/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Weston
bq.  
bq.


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13273742#comment-13273742 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/#review7820
-----------------------------------------------------------


Based on the description of the problem and the proposed solution the code appears to be doing whats expected.
There are a few whitespace errors that could be removed. On eclipse ctr-a and ctr-i should take care of it provided you have set tabs to whitespace.

For my own understand, could you please explain if there could be any implications/corner cases when a particular XAResource calls start and end on the other XAResources participating in the transaction even though they are all managed by the same Resource Manager. In particular is there some sort of ordering that should be preserved when this is called? How about error handling? What if one of the XAResources fail/throw exception when start or end is called ?
(I assume under normal circumstances the RM would call these methods and would be in a position to handle these situations. In the above case the XAResource (all though being called by an RM) would act as a proxy for it's siblings). Is my understanding correct ? If not are you able to briefly explain the flow here ?

- rajith


On 2012-05-09 17:41:59, Weston Price wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/5079/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-05-09 17:41:59)
bq.  
bq.  
bq.  Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.
bq.  
bq.  While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.
bq.  
bq.  The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.
bq.  
bq.  
bq.  This addresses bug QPID-3990.
bq.      https://issues.apache.org/jira/browse/QPID-3990
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQXAResource.java PRE-CREATION 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1336275 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1336275 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1336275 
bq.  
bq.  Diff: https://reviews.apache.org/r/5079/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Weston
bq.  
bq.


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271617#comment-13271617 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/
-----------------------------------------------------------

Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.


Summary
-------

In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.

While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.

The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.


This addresses bug QPID-3990.
    https://issues.apache.org/jira/browse/QPID-3990


Diffs
-----

  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1336275 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1336275 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1336275 

Diff: https://reviews.apache.org/r/5079/diff


Testing
-------

Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.


Thanks,

Weston


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271625#comment-13271625 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/
-----------------------------------------------------------

(Updated 2012-05-09 17:41:59.301972)


Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.


Changes
-------

Sorry, did the SVN diff incorrectly and forgot to add new file qpid/java/client/src/main/java/org/apache/qpid/client/AMQXAResource.java. New diff has missing file included. Please use this as the definitive diff.


Summary
-------

In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.

While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.

The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.


This addresses bug QPID-3990.
    https://issues.apache.org/jira/browse/QPID-3990


Diffs (updated)
-----

  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQXAResource.java PRE-CREATION 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1336275 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1336275 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1336275 

Diff: https://reviews.apache.org/r/5079/diff


Testing
-------

Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.


Thanks,

Weston


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271620#comment-13271620 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/
-----------------------------------------------------------

(Updated 2012-05-09 17:37:24.510238)


Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.


Changes
-------

Diff for QPID-3990


Summary
-------

In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.

While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.

The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.


This addresses bug QPID-3990.
    https://issues.apache.org/jira/browse/QPID-3990


Diffs (updated)
-----

  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1336275 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1336275 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1336275 

Diff: https://reviews.apache.org/r/5079/diff


Testing
-------

Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.


Thanks,

Weston


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Resolved] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "Weston M. Price (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Weston M. Price resolved QPID-3990.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.17

Fixed with latest additions to trunk.
                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>             Fix For: 0.17
>
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274310#comment-13274310 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/
-----------------------------------------------------------

(Updated 2012-05-13 18:29:08.476635)


Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.


Changes
-------

Updated diff to remove whitespace, add a new JCA system test, update XAResourceTest and add the new JCA system test to the JavaPre010Excludes file as this does include testing XA functionality.


Summary
-------

In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.

While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.

The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.


This addresses bug QPID-3990.
    https://issues.apache.org/jira/browse/QPID-3990


Diffs (updated)
-----

  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQXAResource.java PRE-CREATION 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1337888 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1337888 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1337888 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/ra/QpidRAXAResourceTest.java PRE-CREATION 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/test-profiles/JavaPre010Excludes 1337888 

Diff: https://reviews.apache.org/r/5079/diff


Testing
-------

Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.


Thanks,

Weston


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[jira] [Commented] (QPID-3990) Multiple XAResources isSameRM behavior

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274001#comment-13274001 ] 

jiraposter@reviews.apache.org commented on QPID-3990:
-----------------------------------------------------



bq.  On 2012-05-12 00:01:58, rajith attapattu wrote:
bq.  > Based on the description of the problem and the proposed solution the code appears to be doing whats expected.
bq.  > There are a few whitespace errors that could be removed. On eclipse ctr-a and ctr-i should take care of it provided you have set tabs to whitespace.
bq.  > 
bq.  > For my own understand, could you please explain if there could be any implications/corner cases when a particular XAResource calls start and end on the other XAResources participating in the transaction even though they are all managed by the same Resource Manager. In particular is there some sort of ordering that should be preserved when this is called? How about error handling? What if one of the XAResources fail/throw exception when start or end is called ?
bq.  > (I assume under normal circumstances the RM would call these methods and would be in a position to handle these situations. In the above case the XAResource (all though being called by an RM) would act as a proxy for it's siblings). Is my understanding correct ? If not are you able to briefly explain the flow here ?

Good question. It's important to keep in mind in a typical XA flow, an XAResource never calls anything on another XAResource as the TransactionManager does this. However, as the original description mentions, the issue here is that because the XAResources in question are on the same transaction branch, the TM only calls start/end on the first XAResource discovered in the protocol and as a result the other XAResources are not allowed to complete correctly. Another way to put this is that doing correctly support joining multiple XAResources in the same transaction from the same ResourceManager (Broker).

The isSameRM method provides a convenient place to 'intercept' the XA flow being that the TM always calls this when another XAResource is being enlisted in the transaction. Because of this fact, the correct order will always be maintained, however, a good test case would be more than two XAResources. I will add this.

Again, this 'fix' is simply to address what is either a discrepancy between the XA and AMQP specs, or an incorrect implementation on the Broker (both Java and C++). It's not ideal, but currently if we don't provide some sort of solution, and code involving multiple XAResources from the same Broker will not work at all which, in my opinion has severe consequences beyond introducing a fix in the JMS/JCA code.


- Weston


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5079/#review7820
-----------------------------------------------------------


On 2012-05-09 17:41:59, Weston Price wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/5079/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-05-09 17:41:59)
bq.  
bq.  
bq.  Review request for Ted Ross, Robbie Gemmell, rajith attapattu, and Rob Godfrey.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RMs were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.
bq.  
bq.  While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.
bq.  
bq.  The following patch/diff allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.
bq.  
bq.  
bq.  This addresses bug QPID-3990.
bq.      https://issues.apache.org/jira/browse/QPID-3990
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQXAResource.java PRE-CREATION 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java 1336275 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java 1336275 
bq.    http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/jms/xa/XAResourceTest.java 1336275 
bq.  
bq.  Diff: https://reviews.apache.org/r/5079/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  Added system test to XAResourceTest to exercise new behavior. Tested against both the Java and C++ Brokers using the 0.10 profile.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Weston
bq.  
bq.


                
> Multiple XAResources isSameRM behavior
> --------------------------------------
>
>                 Key: QPID-3990
>                 URL: https://issues.apache.org/jira/browse/QPID-3990
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client, JCA
>    Affects Versions: 0.14, 0.17
>         Environment: All supported OS platforms. All supported JEE platforms.
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>            Priority: Critical
>
> In fixing QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource. 
> According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper. 
> While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc. 
> I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org