summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2022-10-27 23:35:34 +0300
committerVlad Lesin <vlad_lesin@mail.ru>2022-10-27 23:35:34 +0300
commit8a450a74f386b885f4b56ddf60c299a32a179b34 (patch)
tree00c41055e91c98883b0abde2c951fb50c97d7a0c
parent18a0f0c17839e3662ac86a22975ae45886ae4cf6 (diff)
downloadmariadb-git-bb-10.6-MDEV-28709-post-push-fix.tar.gz
MDEV-28709 unexpected X lock on Supremum in READ COMMITTEDbb-10.6-MDEV-28709-post-push-fix
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.
-rw-r--r--storage/innobase/lock/lock0lock.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 15a87ce8469..448021d840a 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -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;