[MDEV-26652] xa transactions binlogged in wrong order Created: 2021-09-20 Updated: 2022-12-19 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication, XA |
| Affects Version/s: | 10.5 |
| Fix Version/s: | 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Golubchik | Assignee: | Andrei Elkin |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
XA COMMIT is done by running hton->commit() for all participants. Typically in InnoDB-only transactions there are only two participants, binlog and InnoDB, and binlog is the first. But if we trick binlog to be the second (by starting the transaction from non-InnoDB statement), then InnoDB will commit first. That will release all locks, possibly allowing some other transaction to continue, commit, and reach binlog before this transaction's XA COMMIT gets binlogged. Test case:
binlog clearly shows that first transaction updates the row from (5,5) to (5,50), then the second transaction updates (5,50) to (5,10), then the first transaction commits. In the replication the slave would be stuck on the second update, ultimately timing out. This bug would be easier to repeat if one adds a delay between commits in different participants:
|
| Comments |
| Comment by Sergei Golubchik [ 2021-09-21 ] |
|
this should be fixed by the |
| Comment by Andrei Elkin [ 2021-09-21 ] |
|
[:right:] (I forgot that formerly 21469 part has made into the sources already) |