[MDEV-23527] mariadb-10.5 hangs on "query cache lock" on DROP DATABASE Created: 2020-08-21 Updated: 2022-11-25 Resolved: 2022-11-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Locking, Query Cache |
| Affects Version/s: | 10.5.5, 10.6 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | sjon | Assignee: | Daniel Black |
| Resolution: | Duplicate | Votes: | 6 |
| Labels: | not-10.3, not-10.4 | ||
| Environment: |
mariadb 10.5.5-1 query_cache_type = 1 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
ever since upgrading to 10.5 (from 10.4.14) we experience strange hangs of the mariadb server. This is a nice example:
there seems to be no real relation between the DROP and the INSERT as they operate on completely different databases (they have no relation). I also have examples where there are multiple (killed) Waiting for query cache lock threads and a single DROP closing tables The mariadbd consumes 100% CPU but I'm not sure what it's doing. strace shows some futex calls |
| Comments |
| Comment by Elena Stepanova [ 2020-10-17 ] | ||||||||||||||||||||||||||||||||
|
Could you please paste or attach your cnf file(s) and also elaborate on what exactly your SQL inflow is – which engines are used, which connectors if any, are transactions or XA transactions or table locks are used explicitly, etc. I can't claim it's necessarily relevant, but something is, as so far I couldn't reproduce the described effect. | ||||||||||||||||||||||||||||||||
| Comment by Jonny Wylie [ 2021-07-06 ] | ||||||||||||||||||||||||||||||||
|
Hi can we re open this issue? I have integration tests which each create new databases and drop them. The latest working version is 10.5.2.
10.5.4 is failing with the bug of getting stuck "closing tables", 10.5.2 does not get stuck. It seems to be caused by the query cache. If I disable the query cache then there is no error.
My cnf file is:
| ||||||||||||||||||||||||||||||||
| Comment by Jonny Wylie [ 2021-07-06 ] | ||||||||||||||||||||||||||||||||
|
I can issue a show tables query for the database, and it hasn't got any tables left. So they have all been dropped, but it's still stuck. | ||||||||||||||||||||||||||||||||
| Comment by Jonny Wylie [ 2021-07-06 ] | ||||||||||||||||||||||||||||||||
|
I guess this is the same as: | ||||||||||||||||||||||||||||||||
| Comment by Jonny Wylie [ 2021-07-13 ] | ||||||||||||||||||||||||||||||||
|
Some more information. I found if I issue a 'RESET QUERY CACHE' before dropping the database, then it doesn't lock up. | ||||||||||||||||||||||||||||||||
| Comment by Alex [ 2021-08-04 ] | ||||||||||||||||||||||||||||||||
|
Same error here, deadlock when dropping a small 8 MB database with 33 tables. | ||||||||||||||||||||||||||||||||
| Comment by Frederik Bosch [ 2021-09-02 ] | ||||||||||||||||||||||||||||||||
|
Today I also hit this issue from a 10.6 Docker environment, so I can confirm 10.6 is also affected. I am using the RESET QUERY CACHE suggestion from Johny to prevent the lock. | ||||||||||||||||||||||||||||||||
| Comment by Rémi Augier [ 2022-01-11 ] | ||||||||||||||||||||||||||||||||
|
Same issue here in 10.5.12 and 10.6.5 | ||||||||||||||||||||||||||||||||
| Comment by Neven Ivanov [ 2022-10-07 ] | ||||||||||||||||||||||||||||||||
|
Hi, I was able to reproduce the problem on 100% of the times with MariaDB 10.5/10.6 ( no matter of the subversion but tested mostly with 10.6.10 ) You will need the files all.sql and source_db_schema.sql which are attached to this task. Then just execute from bash console:
In summary if specific query cache is present, you are unable to drop database and it just hangs (MariaDB uses 100% cpu) and no restart ( without "kill -9" can be performed. | ||||||||||||||||||||||||||||||||
| Comment by Alex [ 2022-10-28 ] | ||||||||||||||||||||||||||||||||
|
I can reproduce the deadlock with Nevens example everytime also with the latest MariaDB 10.6.10. As written already last year, please add 10.6 to affected versions! |