在mysql restart上提交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)
答案 0 :(得分:1)
根据您的数据,gtrid
的长度为26,但提交中的gtrid
值(7023010095EDCC9A6369736861322C7365727665722C503130
)只有50个字符,因此实际长度只有25岁,而不是26岁。相应地,你的bqual
更长。您的gtrid
应为7023010095EDCC9A6369736861322C7365727665722C50313030
,并应相应调整bqual
。