Bug #100512 | adaptive hash index(AHI) building causing contention on btr_search_latches | ||
---|---|---|---|
Submitted: | 13 Aug 2020 9:17 | Modified: | 17 May 2022 13:50 |
Reporter: | Zhou Xinjing (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S5 (Performance) |
Version: | 5.7.31,8.0.21 | OS: | Linux (3.10.107) |
Assigned to: | CPU Architecture: | x86 (96 cores) | |
Tags: | performance |
[13 Aug 2020 9:17]
Zhou Xinjing
[13 Aug 2020 9:19]
Zhou Xinjing
We implemented the suggested fix described above. Here is the visualization after the fix: https://4crnuw.sn.files.1drv.com/y4meIDK_67rBRqTVk6mPEoFJwVEWgJgTCdxX2wKavPNbJCziNTao-J4aK...
[13 Aug 2020 9:23]
Zhou Xinjing
This patch implements the idea described above
Attachment: ahi_build_contention_avoidance.patch (application/octet-stream, text), 870 bytes.
[13 Aug 2020 12:40]
MySQL Verification Team
Hi Mr. Zhou Xinjing from CDB Team of Tencent, Thank you for your performance improvement request. What you experience is very useful to us. We do need some further feedback from you. First of all, do you get the same result with the latest 8.0 ???? Next, we are very grateful for the patch, but we can't accept it until you sign our OCA agreement. Hence, please read carefully the next comment.
[13 Aug 2020 12:40]
MySQL Verification Team
Thank you very much for your patch contribution, we appreciate it! In order for us to continue the process of reviewing your contribution to MySQL, please send us a signed copy of the Oracle Contributor Agreement (OCA) as outlined in http://www.oracle.com/technetwork/community/oca-486395.html Signing an OCA needs to be done only once and it's valid for all other Oracle governed Open Source projects as well. Getting a signed/approved OCA on file will help us facilitate your contribution - this one, and others in the future. Please let me know, if you have any questions. Thank you for your interest in MySQL.
[13 Aug 2020 14:20]
Zhou Xinjing
We will verify if it is affecting latest 8.0 branch as well shortly.
[13 Aug 2020 14:38]
MySQL Verification Team
Hi Mr. Zhou Xinjing from CDB Team of Tencent, I am checking regarding your Team's OCA. Thanks in advance regarding 8.0.
[14 Aug 2020 8:40]
Zhou Xinjing
Update on repeating this problem on the latest 8.0.21 branch(from GitHub): Our machine is running Linux kernel 3.10.107 which is a relatively old one. So we encountered the same scalability issue related to ppoll described here: https://bugs.mysql.com/bug.php?id=98284 In order to remove this bottleneck so that we can observe the AHI's behavior more clearly, we modified the source code to replace ppoll with poll. The system then works expectedly after the modification. We then conducted the same experiment on the modified version. We observed similar contention on btr_search_latches. So we think the problem is affecting both 5.7 and 8.0. We then applied the patch and it works as well.
[14 Aug 2020 8:43]
Zhou Xinjing
Visualization of the experiment on 8.0.21
Attachment: 8.0.21, oltp_read_only, 200GB BP, 100GB table, 256 users.pdf (application/pdf, text), 62.49 KiB.
[14 Aug 2020 8:45]
Zhou Xinjing
Visualization of the experiment on 8.0.21.
Attachment: vis.pdf (application/pdf, text), 62.49 KiB.
[14 Aug 2020 13:16]
MySQL Verification Team
Thank you Mr. Zhou Xinjing from CDB Team of Tencent, Now we know that 8.0 version is affected too. We also know that your patch works for 8.0 as well. We are very grateful.
[24 Aug 2020 12:59]
MySQL Verification Team
Hi Mr. Zhou Xinjing from CDB Team of Tencent, We have just been informed that you have not been listed as contributing reporter in your company. Hence, this is a problem that is internal to your company. This is also a reason why our records do not show that you are an OCA contributor. We are eagerly waiting that this problem is resolved on your side. Thanks in advance.
[25 Aug 2020 6:38]
Zhou Xinjing
Just got an update from my team that I am now covered by the Company OCA. I think the issue is resolved.
[25 Aug 2020 12:13]
MySQL Verification Team
Thank you. That solves this issue.
[17 May 2022 13:50]
Daniel Price
Posted by developer: Fixed as of the upcoming 8.0.30 release: Enabling the adaptive hash index (AHI) on a high-concurrency instance caused temporary AHI search latch contention while the hash index was being built. Thanks to Zhou Xinjing from CDB Team at Tencent for the patch.
[2 Mar 2023 16:53]
Matthew General
I know this issue is closed, but it's unclear whether or not this issue was resolved for 5.7. It is included in the 8.0 bug fixes, but not in the change log for 5.7 anywhere. Can anyone confirm/deny this bug is still present in 5.7?
[3 Mar 2023 13:40]
MySQL Verification Team
Hi Mr. Xinjing, We shall check ..........
[3 Mar 2023 14:14]
MySQL Verification Team
Hi, This issue is fixed only in 8.0, since it was deemed too big and risky to port it to the fully stable 5.7 version. Needless to say, 5.7 does not get any new feature requests nor any performance improvement. Thank you and good bye !!!!!