-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Atomikos XA transaction started when it is not configured in server.yaml #18894
Comments
This is because two proxy are started on one machine, and the two proxy use the same file to record the transaction log, and different files can be used to record the transaction log. |
Hi @jingshanglu , the root reason is Atomikos XA transaction started when it's not configured, starting 2 proxy instances and print exception just prove Atomikos XA transaction has been started. Is XA transaction must be started? |
The XA transaction is not necessary. Currently, the specific implementation of TM is loaded through SPI. If there is an implementation of xa, the TM will be initialized unless the specific implementation of xa is removed. Any suggestions? |
If
|
|
So could the default transaction function be XA is not necessary sometimes. If we want to support XA even it's not configured, could we initialize XA implementation on demand? |
Hi, has this issue been resolved? I seem to have this problem too。The XA transaction does not seem to be opened, the LOCAL transaction is used |
Yes, it's not updated. I just checked it. Example server.yaml:
proxy log:
|
I will implement this function, other transaction types will not be loaded by default, if you need to load other transaction types, please configure in loadTypes |
Close it, it's fixed by #25696 |
Bug Report
Which version of ShardingSphere did you use?
master branch, 0b41852
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Proxy
Expected behavior
XA transaction won't be started.
Actual behavior
It started.
Reason analyze (If you can)
In GlobalRulesBuilder:
![WX20220706-152940@2x](https://user-images.githubusercontent.com/42492540/177501542-ca95718b-eb17-4b45-bcf0-fc986e12d8e0.png)
In XAShardingSphereTransactionManager:
![图片](https://user-images.githubusercontent.com/42492540/177502052-f409bb37-0707-4a58-bc7b-3d055d1fdb99.png)
Since AtomikosTransactionManagerProvider is the default impl of XATransactionManagerProvider,
XATransactionManagerProviderFactory.getInstance(null)
inXAShardingSphereTransactionManager.init
return AtomikosTransactionManagerProvider instance.Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
server.yaml
:Global rules in ZK after Proxy 3307 started:
1, Start Proxy with 3307 port
2, Start another Proxy with 3308 port
The second one will start failed with exception:
Example codes for reproduce this issue (such as a github link).
The text was updated successfully, but these errors were encountered: