Commit 2f421688 authored by Vlad Lesin's avatar Vlad Lesin

MDEV-28709 unexpected X lock on Supremum in READ COMMITTED

Post-push fix. The flag of transaction which indicates that it's necessary
to forbid gap lock inheritance after XA PREPARE could be inverted if
lock_release_on_prepare_try() is invoked several times. The fix is to
toggle it on lock_release_on_prepare() exit.
parent 79dc3989
......@@ -4116,7 +4116,6 @@ static bool lock_release_on_prepare_try(trx_t *trx)
lock_sys.rd_unlock();
trx->mutex_unlock();
trx->set_skip_lock_inheritance();
return all_released;
}
......@@ -4124,6 +4123,8 @@ static bool lock_release_on_prepare_try(trx_t *trx)
and release possible other transactions waiting because of these locks. */
void lock_release_on_prepare(trx_t *trx)
{
auto _ = make_scope_exit([trx]() { trx->set_skip_lock_inheritance(); });
for (ulint count= 5; count--; )
if (lock_release_on_prepare_try(trx))
return;
......
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