Bug #93978 | XA COMMIT success with same xid | ||
---|---|---|---|
Submitted: | 18 Jan 2019 9:44 | Modified: | 22 Jan 2019 14:04 |
Reporter: | phoenix Zhang (OCA) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.7.23 | OS: | Any |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any |
[18 Jan 2019 9:44]
phoenix Zhang
[22 Jan 2019 13:31]
MySQL Verification Team
Hi, I don't consider this a bug. XA transactions use "external" control managed by user, you are manipulating semisync so you get intentionally into "wrong state", that is user error, not system error, as, like I said, XA transactions are externally controlled by the user. If you plan to change if you are using semisync or not, close your XA transactions before you do the change. Thanks Bogdan
[22 Jan 2019 14:04]
phoenix Zhang
However,in the real replication master-slave. When open semi-sync, if slave net-out sometime, then, in may generate binlog like above in master. SET @@SESSION.GTID_NEXT= 'e9eca58e-6437-11e6-b93d-d8cb8aee97da:11' XA START X'3131',X'',1 Table_map table_id: 111 (test.t1) Write_rows table_id: 111 flags: STMT_END_F XA END X'3131',X'',1 XA PREPARE X'3131',X'',1 SET @@SESSION.GTID_NEXT= 'e9eca58e-6437-11e6-b93d-d8cb8aee97da:12' XA COMMIT X'3131',X'',1 SET @@SESSION.GTID_NEXT= 'e9eca58e-6437-11e6-b93d-d8cb8aee97da:13' XA COMMIT X'3131',X'',1 SET @@SESSION.GTID_NEXT= 'e9eca58e-6437-11e6-b93d-d8cb8aee97da:14' XA COMMIT X'3131',X'',1 SET @@SESSION.GTID_NEXT= 'e9eca58e-6437-11e6-b93d-d8cb8aee97da:15' XA COMMIT X'3131',X'',1 After a while, when the slave net-in again, it will dump above binlog events, and apply in slave itself. When it execute the binlog events in "e9eca58e-6437-11e6-b93d-d8cb8aee97da:12", it will do XA COMMIT, this time it will be ok. However, when it execute the next XA COMMIT in "e9eca58e-6437-11e6-b93d-d8cb8aee97da:13", it will failed now, cause the xa-id does not exist any more. So, this behavior may lead slave sql-thread error. In my opinion,the server should avoid such kind of slave error problem.