MDEV-7793 - Race condition between XA COMMIT/ROLLBACK and disconnect

XA COMMIT/ROLLBACK of XA transaction owned by different thread may access
freed memory if that thread disconnects at the same time.

Also concurrent XA COMMIT/ROLLBACK of recovered XA transaction were not
serialized properly.
This commit is contained in:
Sergey Vojtovich 2015-03-17 19:49:04 +04:00
commit 7ed673f35c
6 changed files with 136 additions and 53 deletions

View file

@ -1872,7 +1872,6 @@ int spider_internal_start_trx(
trx->internal_xid_state.xa_state = XA_ACTIVE;
trx->internal_xid_state.xid.set(&trx->xid);
trx->internal_xid_state.in_thd = 1;
if ((error_num = spider_xa_lock(&trx->internal_xid_state)))
{
if (error_num == ER_SPIDER_XA_LOCKED_NUM)