diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index c3b802f4284..8e38b99c121 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -703,6 +703,7 @@ public: /** Acquire exclusive lock_sys.latch */ void wr_lock() { + mysql_mutex_assert_not_owner(&wait_mutex); ut_ad(!is_writer()); latch.wr_lock(); ut_ad(!writer.exchange(os_thread_get_curr_id(), @@ -718,6 +719,7 @@ public: /** Acquire shared lock_sys.latch */ void rd_lock() { + mysql_mutex_assert_not_owner(&wait_mutex); ut_ad(!is_writer()); latch.rd_lock(); ut_ad(!writer.load(std::memory_order_relaxed)); diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 7c266eccb3c..756902690c2 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -391,6 +391,7 @@ void lock_sys_t::create(ulint n_cells) /** Acquire exclusive lock_sys.latch */ void lock_sys_t::wr_lock(const char *file, unsigned line) { + mysql_mutex_assert_not_owner(&wait_mutex); latch.wr_lock(file, line); ut_ad(!writer.exchange(os_thread_get_curr_id(), std::memory_order_relaxed)); } @@ -405,6 +406,7 @@ void lock_sys_t::wr_unlock() /** Acquire shared lock_sys.latch */ void lock_sys_t::rd_lock(const char *file, unsigned line) { + mysql_mutex_assert_not_owner(&wait_mutex); latch.rd_lock(file, line); ut_ad(!writer.load(std::memory_order_relaxed)); ut_d(readers.fetch_add(1, std::memory_order_relaxed)); @@ -549,10 +551,6 @@ ATTRIBUTE_NOINLINE static bool wsrep_is_BF_lock_timeout(const trx_t &trx) ib::info() << "WSREP: BF lock wait long for trx:" << ib::hex(trx.id) << " query: " << wsrep_thd_query(trx.mysql_thd); - { - LockMutexGuard g{SRW_LOCK_CALL}; - trx_print_latched(stderr, &trx, 3000); - } srv_print_innodb_monitor= true; srv_print_innodb_lock_monitor= true;