Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XAER_RMERR still being thrown during SQL Server failover with 12.5.0 despite fixes for issues 2130 and 2159 #2346

Closed
djmatthews opened this issue Mar 11, 2024 · 3 comments · Fixed by #2348

Comments

@djmatthews
Copy link

Driver version

12.5.0

SQL Server version

15.00.4345

Client Operating System

Windows Server 2019, version 10.0

JAVA/JVM version

Java version = 1.8.0_331, Java Runtime Version = 8.0.7.11 - pwa6480sr7fp11-20220601_01(SR7 FP11), Java Compiler = j9jit29, Java VM name = IBM J9 VM

Table schema

N/A

Problem description

XAResource.commit throwning XAException with errorCode XAER_RMERR during failover
See issues 2130, 2159 and 1432 for same behaviour in failover scenarios.

Expected behavior

The XAException should be XAER_RMFAIL not XAER_RMERR

Actual behavior

XAException on commit (and other XA flows) with errorCode XAER_RMERR
[1/31/24 5:56:04:364 PST] FFDC Exception:javax.transaction.xa.XAException SourceId:com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.commit ProbeId:410 Reporter:com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl@c2d2d53c
javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: socket write error
at com.microsoft.sqlserver.jdbc.SQLServerXAResource.dtc_XA_interface(SQLServerXAResource.java:775)
at com.microsoft.sqlserver.jdbc.SQLServerXAResource.commit(SQLServerXAResource.java:841)
at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.commit(WSRdbXaResourceImpl.java:383)
at com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:496)
at com.ibm.tx.jta.impl.JTAXAResourceImpl.commit(JTAXAResourceImpl.java:308)
at com.ibm.tx.jta.impl.RegisteredResources.deliverOutcome(RegisteredResources.java:1644)
at com.ibm.tx.jta.impl.RegisteredResources.distributeOutcome(RegisteredResources.java:2003)
at com.ibm.tx.jta.impl.RegisteredResources.distributeCommit(RegisteredResources.java:2315)
at com.ibm.tx.jta.impl.TransactionImpl.internalCommit(TransactionImpl.java:1879)
at com.ibm.tx.jta.impl.TransactionImpl.internalCommit(TransactionImpl.java:1855)
at com.ibm.tx.jta.impl.TransactionImpl.coreStage2CommitProcessing(TransactionImpl.java:1135)
at com.ibm.tx.jta.impl.TransactionImpl.stage2CommitProcessing(TransactionImpl.java:1173)
at com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:1034)
at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:964)
at com.ibm.ws.tx.jta.TransactionImpl.commit(TransactionImpl.java:3790)
at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:439)
at com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:191)
at com.ibm.ws.uow.UOWManagerImpl.uowCommit(UOWManagerImpl.java:807)

    ....

Any other details that can be helpful

I Note that SQLServerXAResource.dtc_XA_interface checks for R_noServerResponse (which does not match) and moreover for isResourceManagerFailure(ex) but that method appears to check for EQUALITY with "Connection reset by peer" (amongst others) whereas the message here appears to be "Connection reset by peer: socket write error".

As per my earlier comments in issue 2130, I still think that XAER_RMFAIL is a better default than XAER_RMERR since that latter has additional semantics.

JDBC trace logs

Provide the JDBC driver trace logs. Instructions can be found here: https://docs.microsoft.com/sql/connect/jdbc/tracing-driver-operation
Currently not available but I can request these from the test team.

@tkyc
Copy link
Member

tkyc commented Mar 11, 2024

I'll talk to team to see if there's some middle ground or compromises to made here... Last time I discussed this with them, it was opt to have RMERR as the default.

@tkyc
Copy link
Member

tkyc commented Mar 18, 2024

We'll default to RMFAIL.

@tkyc
Copy link
Member

tkyc commented Mar 27, 2024

Just an update. A preview with this change will likely be released on April 4th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants