I'm trying to drop a table on a local mysql instance, and the DROP statement (DROP TABLE wqs_info) hangs out forever...

Looking at mysql logs, I see the lock dumps:

--Thread 18692 has waited at btr0cur.cc line 1870 for 241.00 seconds the semaphore:
X-lock (wait_ex) on RW-latch at 00000194D3745E88 created in file buf0buf.cc line 1460
a writer (thread id 18692) has reserved it in mode  wait exclusive
number of readers 1, waiters flag 1, lock_word: efffffff
Last time read locked in file row0row.cc line 989
Last time write locked in file g:\ade\build\sb_0-26514852-1514435511.83\mysql-5.7.21\storage\innobase\include\mtr0mtr.ic line 117

What's strange here is that thread 18692 (a mysqld thread) is waiting for a lock that it's already owning?! How can this be possible?

(after 4-5 server restarts, I finally managed to drop the table, but I want to know how it's possible for a thread to wait for a lock itself owns?!)

  • What version of mysql?
    – Rick James
    Nov 20, 2019 at 19:36
  • @RickJames 5.7.21 (on windows)
    – Xenos
    Nov 20, 2019 at 19:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.