Bug #113761 | Access performance_schema.data_locks causes SQL execution stuck | ||
---|---|---|---|
Submitted: | 25 Jan 13:33 | Modified: | 19 Sep 9:07 |
Reporter: | Brian Yue (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Performance Schema | Severity: | S5 (Performance) |
Version: | 8.0.36 | OS: | Any (rhel-7.4) |
Assigned to: | CPU Architecture: | Any (x86-64) | |
Tags: | data_locks, Performace schema |
[25 Jan 13:33]
Brian Yue
[25 Jan 14:09]
MySQL Verification Team
Hi Mr. Yue, Thank you for your bug report. We have carefully analysed your report and we do not see what bug are you reporting here. Definitely not those times, at the end of the report, that are in milliseconds. However, if you are reporting the execution that is stuck as in: " Stress test using sysbench with update_index.lua, when access the data_locks table, QPS is stucked for about 20 seconds. " then this is expected behaviour. Simply, there is a mutex lock that prevents that one container is accessed by two simultaneous threads. This is, simply put, the expected behaviour. Not a bug.
[3 Jun 7:02]
Brian Yue
Hello, I request to modify the Severity as "S5 (Performance)" and could this issue to be verified please ? In the test case, accessing performance_schema.data_locks system table causes concurrent DML operations on the same table to be stuck for tens of seconds, event longer. I thinks it's really dangerous to access data_locks table when there is a heavy workload on MySQL server, and there is no alternative methods. So it's pretty important to mitigate impact on concurrent DML performance of accessing data_locks system table. Thanks a lot.
[3 Jun 9:57]
MySQL Verification Team
Hi Mr. Yue, In order to verify this bug report we need you to provide us with a query or queries that introduce the most of latency. We can not search for 100 queries and see which one is causing the problem. Also, profiling information is desirable for the performance bugs. Then, we can profile them ourselves and compare the problematic stacktraces ......
[3 Jun 10:36]
MySQL Verification Team
Hi Mr. Yue, We had some consultation with our Development team and there could be a possibility that your report is verified. In order to know whether this is verifiable as a "Performance" bug, we need to know which two versions or releases have you compared and which one demonstrated a performance regression. We truly need your feedback on this question .......
[3 Jun 12:22]
MySQL Verification Team
Hi Mr. Yue, It turns out that this is a known performance issue. Verified as reported for version 8.0 and higher.
[3 Jun 12:24]
Marc ALFF
Setting this issue as verified. Please note that the following fix, available in MySQL 8.0.37: Bug 35240825 - performance_schema.data_locks query increased RAM usage to OOM should improve the situation. See the MySQL 8.0.37 release notes for details: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-37.html#mysqld-8-0-37-performance...
[7 Aug 14:18]
MySQL Verification Team
This bug is fixed now in our trunk. It is yet to be decided the version and release where it will be pushed. Until then, this bug report will not be closed.
[16 Aug 10:24]
TAMILMARAN C
Hello, Similar performance issue is still occurring MySQL 8.0.37 too.
[16 Aug 10:31]
MySQL Verification Team
Hi, We already wrote that this bug is fixed only in the development version. It is yet to be decided to which stable versions will that patch be ported to. We shall inform you when we ourselves have that information ....... Hence, all current production releases are affected by this bug, until we inform you which stable releases have been fixed. Until then, you will just have to wait. It is a very long process, since a patch is quite big.
[16 Aug 10:35]
TAMILMARAN C
Thanks for the clarification MySQL Verification Team
[16 Aug 10:36]
MySQL Verification Team
You are truly welcome.
[22 Aug 9:40]
MySQL Verification Team
This is the original bug for the following one: https://bugs.mysql.com/bug.php?id=115702
[19 Sep 9:07]
Edward Gilmore
Posted by developer: Added the following note to the MySQL Server 8.0.40 release notes: Redesigned the performance schema data_locks and data_lock_waits tables so that querying them does not require an exclusive global mutex on the transaction or lock system. It now iterates over buckets of hash tables that hold the locks to only latch the actively processed shard, when previously it iterated over the transactions. This also improves the iteration logic complexity in terms of speed and memory to decrease the impact of these queries on the rest of the system. Note that the query result might show an incomplete list of transaction locks if it committed, started, or otherwise changed the set of owned locks in-between visiting two buckets. This differs from previous behavior which always showed a consistent snapshot of locks held by individual transactions, although two different transactions could have been presented at different moments. In other words, the new approach gives a consistent view of a single wait queue to show conflicting locks with a waiting lock because they are always in the same bucket, while the old approach could miss some of them because they belonged to other transactions. The old approach would always show all the other locks held by a reported transaction but could miss locks of other transactions even if they were conflicting.
[19 Sep 9:22]
MySQL Verification Team
Thank you , Edward.
[24 Sep 12:57]
Vasanth S
Hi Edward. Do we have any ETA for the MySQL 8.0.40 release? It will really help us out in planning our next Version upgrade. TIA.