Commit 8e9ec6a5 authored by Kristofer Pettersson's avatar Kristofer Pettersson

Bug#46944 Internal prepared XA transction XIDs are not

          removed if server_id changes

When MySQL crashes (or a snapshot is taken which simulates
a crash), then it is possible that internal XA
transactions (used to sync the binary log and InnoDB)
can be left in a PREPARED state, whereas they should be
rolled back.  This is done when the server_id changes
before the restart occurs.  

This patch releases he restriction that the server_id
should be consistent if the XID is to be considerred
valid. The rollback phase should then be able to
clean up all pending XA transactions.
parent fe0437d3
...@@ -398,7 +398,6 @@ struct xid_t { ...@@ -398,7 +398,6 @@ struct xid_t {
my_xid get_my_xid() my_xid get_my_xid()
{ {
return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 && return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 &&
!memcmp(data+MYSQL_XID_PREFIX_LEN, &server_id, sizeof(server_id)) &&
!memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ? !memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ?
quick_get_my_xid() : 0; quick_get_my_xid() : 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment