在mysql重新启动上提交XA待处理事务时,出现以下错误。请帮助我解决此错误。

mysql> XA RECOVER CONVERT XID;
+----------+--------------+--------------+------------------------------------------------------------------------------------------------+
| formatID | gtrid_length | bqual_length | data                                                                                           |
+----------+--------------+--------------+------------------------------------------------------------------------------------------------+
|  4871251 |           26 |           20 | 0xA223010095EDCC9A6369736861322C7365727665722C503130306369736861322C7365727665722C503130302C00 |
|  4871251 |           26 |           20 | 0xA123010095EDCC9A6369736861322C7365727665722C503130306369736861322C7365727665722C503130302C00 |
|  4871251 |           26 |           20 | 0xA023010095EDCC9A6369736861322C7365727665722C503130306369736861322C7365727665722C503130302C01 |


mysql> XA COMMIT 0x7023010095EDCC9A6369736861322C7365727665722C503130,0x306369736861322C7365727665722C503130302C00,4871251;
ERROR 1397 (XAE04): XAER_NOTA: Unknown XID

[root@db1 ~]# mysql --version
mysql  Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using  EditLine wrapper
[root@db1 ~]# uname -a
Linux db1 3.10.0-514.26.2.el7.x86_64 #1 SMP Fri Jun 30 05:26:04 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@db1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

最佳答案

根据您的数据,gtrid的长度为26,但是提交(gtrid)中的7023010095EDCC9A6369736861322C7365727665722C503130值只有50个字符,因此实际长度仅为25,而不是26。相应地,您的更长。您的bqual应该是gtrid,并应相应地调整7023010095EDCC9A6369736861322C7365727665722C50313030

09-07 15:51