Commit b78b77e7 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-32530 Race condition in lock_wait_rpl_report()

After acquiring lock_sys.latch, always load trx->lock.wait_lock.
It could have changed by another thread that did lock_rec_move()
and released lock_sys.latch right before lock_sys.wr_lock_try()
succeeded.

This regression was introduced in
commit e039720b (MDEV-32096).

Reviewed by: Vladislav Lesin
parent b21f52ee
......@@ -1812,8 +1812,14 @@ static lock_t *lock_wait_rpl_report(trx_t *trx)
}
else if (!wait_lock->is_waiting())
{
wait_lock= nullptr;
goto func_exit;
wait_lock= trx->lock.wait_lock;
if (!wait_lock)
goto func_exit;
if (!wait_lock->is_waiting())
{
wait_lock= nullptr;
goto func_exit;
}
}
if (wait_lock->is_table())
......
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