From 768a736174d6caf09df43e84b0c1b9ec52f1a301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 4 Dec 2023 11:47:19 +0200 Subject: [PATCH] MDEV-32899 instrumentation fixup dict_sys_t::lock(), dict_sys_t::freeze(): Assert that the current thread is not holding dict_sys.latch in any mode. The SUX lock is reentrant, but the simpler RW lock that we use in non-debug builds is not. --- storage/innobase/include/dict0dict.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index a0ba7d6ff5c..e4fc58007cf 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1512,6 +1512,7 @@ public: void lock(SRW_LOCK_ARGS(const char *file, unsigned line)) { #ifdef UNIV_DEBUG + ut_ad(!latch.have_any()); if (!latch.x_lock_try()) #else if (!latch.wr_lock_try()) @@ -1540,6 +1541,7 @@ public: void freeze() { # ifdef UNIV_DEBUG + ut_ad(!latch.have_any()); latch.s_lock(); # else latch.rd_lock();