Comment 9 for bug 1247021

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Re: Assertion failure in file buf0buf.cc line 3687

The issue is buf_page_init_for_read() adjusted for the buffer pool
mutex split incorrectly, visible in a combination of compressed
tables and multiple active purge threads, in 5.6 only.

In upstream, decrement of watch page fix count in
buf_pool_watch_unset() is protected by a combination of the relevant
page_hash X latch, buffer pool mutex, and possibly block mutex. In
XtraDB, buf_pool_watch_unset() locks page_hash X latch and then
either a block mutex or the zip mutex.

In upstream, the code path leading to the failing assert temporarily
releases page_hash latch around buf_buddy_alloc() call, which in turn
may release the buffer pool mutex too. If that happens, the watch
page is re-read from the page hash.

In the same code path in XtraDB, the buffer pool mutex was substituted
by the LRU list mutex and the logic was kept the same. Which is
incorrect, because page_hash unlock in itself is enough to necessitate
the page_hash recheck regardless of the LRU list mutex, because of
buf_pool_watch_unset() differences.