buf_pool_resize can lock less in checking whether AHI is on or off

Bug #1525215 reported by Laurynas Biveinis on 2015-12-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Invalid
Undecided
Unassigned
5.7
Fix Released
Low
Laurynas Biveinis

Bug Description

Copy of https://bugs.mysql.com/bug.php?id=78894:

[21 Oct 7:07] Laurynas Biveinis
Description:
void
buf_pool_resize()
{
...
 btr_search_s_lock_all();
 if (btr_search_enabled) {
  btr_search_s_unlock_all();
  btr_search_disabled = true;
 } else {
  btr_search_s_unlock_all();
 }
...

So, it S-latches all the partitions to read btr_search_enabled. But btr_search_enable/disable X-latches all the partitions to change its value. So here it is not required to latch all the partitions, any single one of them is enough.

How to repeat:
Code analysis

Suggested fix:
S-latch only the first or the last or any random partition.

tags: added: innodb performance upstream

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3340

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.