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.
**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.