summaryrefslogtreecommitdiff
path: root/storage/xtradb/row/row0sel.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-28 12:27:06 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-28 12:39:50 +0200
commitd0116e10a5da52503a89a413e481996ce3f65e63 (patch)
treee67bbdfa81ee11b205610c3b038e864f3206a0a6 /storage/xtradb/row/row0sel.cc
parent81d71ee6b21870772c336bff15b71904914f146a (diff)
downloadmariadb-git-d0116e10a5da52503a89a413e481996ce3f65e63.tar.gz
Revert MDEV-18464 and MDEV-12009
This reverts commit 21b2fada7ab7f35c898c02d2f918461409cc9c8e and commit 81d71ee6b21870772c336bff15b71904914f146a. The MDEV-18464 change introduces a few data race issues. Contrary to the documentation, the field trx_t::victim is not always being protected by lock_sys_t::mutex and trx_t::mutex. Most importantly, it seems that KILL QUERY could wrongly avoid acquiring both mutexes when invoking lock_trx_handle_wait_low(), in case another thread had already set trx->victim=true. We also revert MDEV-12009, because it should depend on the MDEV-18464 fix being present.
Diffstat (limited to 'storage/xtradb/row/row0sel.cc')
-rw-r--r--storage/xtradb/row/row0sel.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc
index 87bc2aa2875..b6b5d107885 100644
--- a/storage/xtradb/row/row0sel.cc
+++ b/storage/xtradb/row/row0sel.cc
@@ -4755,7 +4755,11 @@ no_gap_lock:
a deadlock and the transaction had to wait then
release the lock it is waiting on. */
+ lock_mutex_enter();
+ trx_mutex_enter(trx);
err = lock_trx_handle_wait(trx);
+ lock_mutex_exit();
+ trx_mutex_exit(trx);
switch (err) {
case DB_SUCCESS: