MDEV-20483 trx_lock_t::table_locks is not a subset of trx_lock_t::trx_locks

Problem:
=======
  Transaction left with nonempty table locks list. This leads to
assumption that table_locks is not subset of trx_locks. Problem is that
lock_wait_timeout_thread() doesn't remove the table lock from
table_locks for transaction.

Solution:
========
  In lock_wait_timeout_thread(), remove the lock from table vector of
transaction.
parent 2a98d0b5
...@@ -6480,6 +6480,8 @@ lock_cancel_waiting_and_release( ...@@ -6480,6 +6480,8 @@ lock_cancel_waiting_and_release(
} }
lock_table_dequeue(lock); lock_table_dequeue(lock);
/* Remove the lock from table lock vector too. */
lock_trx_table_locks_remove(lock);
} }
/* Reset the wait flag and the back pointer to lock in trx. */ /* Reset the wait flag and the back pointer to lock in trx. */
......
...@@ -561,8 +561,6 @@ inline void trx_t::release_locks() ...@@ -561,8 +561,6 @@ inline void trx_t::release_locks()
if (UT_LIST_GET_LEN(lock.trx_locks)) if (UT_LIST_GET_LEN(lock.trx_locks))
lock_trx_release_locks(this); lock_trx_release_locks(this);
else
lock.table_locks.clear(); /* Work around MDEV-20483 */
} }
/********************************************************************//** /********************************************************************//**
......
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