参考 https://dev.mysql.com/doc/refman/8.0/en/xa-statements.html
问题:
XA事务失败后,插入数据报错
mysql> select * from account;
+-------+------+
| money | name |
+-------+------+
| 1000 | bb |
+-------+------+
1 row in set (0.00 sec)
mysql>
mysql> insert into account select 100,'cc';
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
解决
mysql> XA RECOVER CONVERT XID;
+----------+--------------+--------------+--------+
| formatID | gtrid_length | bqual_length | data |
+----------+--------------+--------------+--------+
| 100 | 1 | 1 | 0x1112 |
+----------+--------------+--------------+--------+
1 row in set (0.00 sec)
mysql> xa rollback 0x11,0x12,100;
Query OK, 0 rows affected (0.01 sec)