Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL), 10.5, 10.6
-
None
Description
After the fix of MDEV-15532, 10.2 and 10.3 are fine.
However the new code in sql/xa.cc has the same issue and crash scenarios
as MDEV-15532 in the following scenario:
- Start a XA transaction, put it in prepare phase
- Start a normal transaction involving several tables
- kill the connection
In this case the 10.4 code will in THD::cleanup() call
trans_xa_detach(), which will reset the transaction flags, and then
call release_transactional_locks().
The effect will be as in MDEV-15532: We have active transactions but
no MDL locks to protect against ALTER TABLE.
We can't ignore calling release_transactional_locks() in
THD::cleanup() after trans_xa_detach as in this case we have MDL locks
that will never be removed when THD disappears after cleanup().
One suggested fix is to move the transactional locks from THD to the transaction
and keep the transaction around to be picked up by the connection that will
eventually commit the XA transaction.
In case of server restart, we have to also recover the MDL locks for any
table involved in the XA transaction.
Attachments
Issue Links
- relates to
-
MDEV-23484 Rollback unnecessarily acquires dict_operation_lock for every row
- Closed
-
MDEV-15532 XA: Assertion `!log->same_pk' failed in row_log_table_apply_delete
- Closed