Recently my database started, several times a day, to get stuck with a lot of queries in a Waiting for table flush
state.
Usually there's a very long query in execution that when killed unlock the other queries.
We don't execute automatically ANALYZE
, OPTIMIZE
, RENAME
, ALTER
, REPAIR
and FLUSH
commands that could cause a flush.
The tables are all InnoDB and the version of MySQL is 5.7.39-1
.
There are hundreds of client connected all of the time (372 at the time I'm writing this question).
The database is managed, so I don't have the PROCESS
privilege required to execute the query
SELECT BLOCKING_TRX_ID FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
that could be used to further debug the issue.
Can you help me to debug this issue?