Bug #111082 | Queries to the Performance Schema Lock up all transactions until KILL | ||
---|---|---|---|
Submitted: | 19 May 2023 0:37 | Modified: | 19 May 2023 16:54 |
Reporter: | Dathan Pattishall | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Performance Schema | Severity: | S3 (Non-critical) |
Version: | 8.0.25 | OS: | Linux (RDS) |
Assigned to: | CPU Architecture: | x86 | |
Tags: | innodb, locks, performance, schema |
[19 May 2023 0:37]
Dathan Pattishall
[19 May 2023 12:57]
MySQL Verification Team
Hi Mr. Pattishall, Thank you for your bug report. However, this is expected behaviour. The columns `data_locks` and `data_lock_waits` are changed every microsecond. Since these are variables within the volatile structures, we can not allow no parallel reads or writes to those fields. Hence, the mutex is absolutely necessary. The only way to avoid this is to reorganise entirely huge parts of the MySQL code, for that purpose only. Hence, that is not doable ..... Not a bug.
[19 May 2023 16:54]
Dathan Pattishall
Do you have a replacement table that I should use? Could I use innodb_lock_waits ? Without the lock? The goal is to find the query that is causing the lock and show how many queries are waiting on that query.
[22 May 2023 12:09]
MySQL Verification Team
Unfortunately, the answer is no. Locks, mutexes, waits on those and many other values in the realm of the transactional system, are changed at least every millisecond. Hence, there must be protected. You can have no locks only when you do not have any activity. You might get lesser locks with READ COMMITTED concurrency model ...... Read about it in our Reference Manual.
[25 May 2023 8:11]
Jakub Lopuszanski
Hello, I'd like to clarify one thing, as the report seems self-contradictory to me, so I am probably confused. A: > the following query issued every 10 seconds B: > this query was running 2000 times per second with each call taking ~500ms 1. Are A and B talking about the same query? 2. If so, then how to reconcile these two pieces of info? To me one sounds like 0.1Hz, and the other like 2kHz. And then this fragment about ~500ms, sounds like 2Hz unless thousand of threads execute it in parallel.
[12 Oct 0:54]
Marc Reilly
FYI in case anyone stumbles across this. Check out bug#112035 looks like there are optimization coming here in 8.0.40. Also related: Bug #100537
[14 Oct 9:43]
MySQL Verification Team
Thank you, Mr. Reilly.