Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1075086

Summary: [QE] (6.4.0) Some unfinished xids on server after recovery.
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Hayk Hovsepyan <hhovsepy>
Component: EJBAssignee: David M. Lloyd <david.lloyd>
Status: CLOSED CURRENTRELEASE QA Contact: Hayk Hovsepyan <hhovsepy>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bmaxwell, jmartisk, ochaloup
Target Milestone: DR2Keywords: Regression
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
ServerLog none

Description Hayk Hovsepyan 2014-03-11 13:12:58 UTC
Created attachment 873120 [details]
ServerLog

Description of problem:
When using distributed transaction between 2 servers, and one of them crash in prepare phase, after recovery there remains unfinished xids on the other server.

Version-Release number of selected component (if applicable):
jboss-eap-6.3.0.DR2

How reproducible:
always

Steps to Reproduce:
1. Call StlessSB on server 1, which will send message to it's own queue and will call StlessSB of server 2. In that StlessSB Server 2 will send message to it's own queue.
2. In server 1, add mock test XA resource into transaction after all transactional methods are called (send message, call server2).
3. Crash transaction on server 1 when entering "prepare" method of test XA resource.
4. Reboot the server 1, call recovery for both servers.
5. Check that messages sent to both servers queues are rollbacked.
6. Check that for both servers do not have unfinished xids. Here is the fail. Server 2 has unfinished xid.

Actual results:
Server 2 has unfinished xid.

Expected results:
Server 2 should not have unfinished xid.

Additional info:
It works for: 'jboss-eap-6.2.0.CR3'.

Please find the log files attached.

Here is the project git repo: http://git.app.eng.bos.redhat.com/git/jbossqe/eap-tests-transactions.git it is under 'master'.

For running the scenario locally you need to change directory "..../eap-tests-transactions/integration/jbossts" and run "mvn clean verify -Dtest=TxPropagationCrashRecoveryTestCase#prepareHaltClient -Djbossts.hqobjectstore -Djboss.dist=${eap-6.3-home}"

Comment 1 tom.jenkinson 2014-03-11 14:38:10 UTC
Hi Hayk,

Where are you getting eap from?

Thanks,
Tom

Comment 3 tom.jenkinson 2014-03-12 17:05:30 UTC
This issue is not with the transaction manager rather it is with the resource manager, in this case EJB3. What happens in EJB3 is:

1. Returns 3 XAResources from XAResourceRecoveryHelper::getXAResources()
2. Each of these XAResources returns true for each other for isSameRM()
3. However, each XAResource returns a different list of Xids, thereby resetting an internal recovery manager list each time.

The fix is to make the three XAResources return false to isSameRM if they point at different servers. I had a go at it over here and the test passes with it: https://github.com/tomjenkinson/jboss-ejb-client/commit/a7e8900f854f8bd8c5fc0750a3e9065489149a94

Hope that helps,
Tom

Comment 4 Hayk Hovsepyan 2014-03-13 11:50:04 UTC
Thank you Tom for doing research.

Comment 5 Jan Martiska 2014-07-07 12:51:04 UTC
This will be fixed by ejb client 1.0.26.Final. The fix is merged here: https://github.com/jbossas/jboss-ejb-client/commit/f6b6e067935920e03c429183a64454fd8d5104ba
Moving to 6.4.

Comment 6 Hayk Hovsepyan 2014-09-24 15:32:23 UTC
Verified on revision 6.4.0 DR2