LP #1525215: buf_pool_resize can lock less in checking whether AHI is on or off

Description

**Reported in Launchpad by Laurynas Biveinis last update 11-12-2015 13:00:33

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.

Environment

None

Smart Checklist

Activity

Show:
Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 8:45 AM
Updated January 24, 2018 at 8:45 AM
Resolved January 24, 2018 at 8:45 AM