[MDEV-19754] Spider does not translate regular transaction into XA transaction with shards Created: 2019-06-13 Updated: 2021-12-10 Resolved: 2021-12-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Spider |
| Affects Version/s: | 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Gert van Dijk | Assignee: | Nayuta Yanagisawa (Inactive) |
| Resolution: | Not a Bug | Votes: | 1 |
| Labels: | xa | ||
| Environment: |
Tested with MariaDB 10.4.5 & 10.3.15, derived from official Docker image + "apt-get install mariadb-plugin-spider" |
||
| Description |
|
IIUC, if I configure Spider table to shard over several backends, and the transaction given to the Spider table affects multiple shards and those shards cross more than one machine, it should use a two-phase XA commit in the group of (remote) nodes. Well, it doesn't. I observe regular transactions happening in series, not even in parallel. All backend servers are running InnoDB with the same MariaDB version as the Spider. According to docs, XA support is enabled by default; haven't touched a thing regarding that. I may be doing something wrong, this being my first Spider installation. In that case, this issue is filed against the documentation. Thanks! I've started this as a Q on DBA.SE, but I believe it's a bug, hence this issue. Details from there: Snippet from Q
Everything else on the Spider is left at the default settings. Looking at Wireshark PCAPs, I see this in chronological packet-id order on the single bridge interface all my test nodes are connected on:
My observations derived from the above events:
(I've double-checked with Wireshark filters mysql.query contains "prepare", mysql.query contains "xa" that no single MySQL query packet contains this.) How can I obtain XA-2PC as depicted in the image from https://mariadb.com/kb/en/library/spider-storage-engine-overview/#sharding-setup ? I need to have strict guarantees that ALL shards have seen and committed their part of the original client-side commit, OR rollback as a group. Double-checked that my backend-servers are indeed capable of XA (run directly on srvA):
And that the Spider node has it configured OK:
|
| Comments |
| Comment by Gert van Dijk [ 2019-06-14 ] | |||||||||||||||||||||||||||||
|
I've tried out many things, and I triggered Spider to enable XA, but it requires the following, not mentioned in the documentation: If I talk with XA to Spider, it will talk in XA to the shards too. It does not translate a non-XA into an XA one. Why? That's either a bug OR a problem with the documentation. To summarize by example:
results in a PCAP file with XA 2PC commits to the shards: OK.
results in a PCAP file without XA 2PC commits to the shards: NOT OK | |||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-12-10 ] | |||||||||||||||||||||||||||||
|
gertvdijk First of all, sorry for our late reply. Could you test spider_internal_xa=ON? Then, the Spider would work as you expected. |