-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Narayana JTA: expose property to set xaAssumeRecoveryComplete #35806
Comments
/cc @mmusgrov (narayana) |
…me-restore-complete to allow
@gsmet If the corresponding PR gets merged, I'd like to have a |
…me-recovery-complete to allow
…me-recovery-complete to allow
Doing this is risky because you may end up deleting logs for in doubt transactions if the assumption is wrong which could result in inconsistent data. We added the interface org.jboss.tm.XAResourceWrapper to mitigate against this and it should be implemented by the resources that get passed to the transaction extension. |
Okay... then I am out. I took a quick look at the interface and I have no idea how to implement this and what resource have to implement this interface. I am going to close my PR. |
@turing85 Not really. We do not know which resources might have known about the transaction unless our transaction record can identify the resource. If the resource that's registered with us implements But we do not control the resource registrations, that is the job of the Agroal subsystem so only Agroal can help in this situation. But Agroal does not know either because Quarkus does not initialise the integration code with the datasource name. @barreiro is that a fair description of the situation and if so can anyone suggest what it would take to ensure that Agroal can be supplied with that name. |
@mmusgrov I am very sure that the resource causing the issue is the JMS connection, so no Agroal is involved. What does this exactly mean? Should I re-open the PR? |
The issue needs to be fixed by whatever component is supplying us with the resource. |
That would be |
Maybe the thing that implements the XASession methods can check. You'd need to do it just for the resources that you register with us since end user apps would not want the wrapper. I assumed that the route from |
It is obvious. |
Agroal does not implement it, I was hoping that this problem would be a trigger for Luis and the quarkus team to support the interface because it's a problem. But IronJacamar does and I believe there is some work in Quarkus to support that. |
Well in this case, I propose we merge my original PR until this issue is resolved for good. Having these logs popping up over and over again is noise, and setting the property does not work in native mode. |
The window where this crash can happen is very small:
So I'd be surprised to see the problem popping up over and over again, perhaps there is another root cause analysis or the reproducer is contrived. The consequences of leaving the TM log lying around is rare noise. I'd definitely want to avoid the latter so I'd resist approving the PR. |
Multiply the window times 100. We have multiple services producing those logs. |
I'd still prefer noise over loss of data integrity so lets see if we can up the priority of implementing XAResourceWrapper. |
For completeness, as an aside, the name of the datasource doesn't have to be JNDI, which I'm not sure if Quarkus supports, it just needs to be unique. |
Nobody is forced to set this option. We are right now forced to have this noise. And setting said property produces a very clear log message, stating that the transaction will be assumed to be completed. |
I'm not convinced every developer knows the value of maintaining ACID semantics. |
I'd also check your environment to determine why so many applications are crashing or are being scaled down with pending work. |
@turing85 As mentioned, even though the property xaAssumeRecoveryComplete requires that wrapped resources have JNDI names any unique value (amongst all resources) will do. So I agree that we could add support for XAResourceWrapper to the jta extension now so that if, in the future, Agroal is able to wrap its resources and provide such a unique value then the issue would not be blocked waiting for the jta extension part of the feature. |
Description
There is a gap in the XA restore process. If all resources have acknowledged the transaction, narayana deletes the transaction from its transaction store. If the application dies right in this moment and restarts, narayana still thinks that the XA transaction is not finished, but the transactions on the resources were already committed, and the resources do not have any memory about those transactions. This, in return, leads the a log message similar to:
This message will appear periodically with log-level
WARN
, until the correspoding transaction log is removed.This link (
access.redhat.com
) suggests setting system-propertycom.arjuna.ats.jta.xaAssumeRecoveryComplete
totrue
.While we can start the application with
java ... -Dcom.arjuna.ats.jta.xaAssumeRecoveryComplete=true ...
, it would be convenient to have a configuration property likequarkus.transaction-manager.xa-assume-recovery-complete
that can be set inapplication.properties
/application.yml
.Implementation ideas
No response
The text was updated successfully, but these errors were encountered: