Is buf_LRU_free_page() really supposed to make non-zip block sticky at the end?

Bug #1220544 reported by Laurynas Biveinis
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Percona Server moved to
Fix Released
Laurynas Biveinis
Laurynas Biveinis
Laurynas Biveinis
Fix Released
Laurynas Biveinis

Bug Description

Copy of for Percona Server.

[3 Sep 15:17] Laurynas Biveinis

buf_LRU_free_page() appears to either have redundant code to needlessly make the removed page sticky to the buffer pool, or at least a misleading comment.

How to repeat:
The relevant bits are:

 if (!buf_LRU_block_remove_hashed(bpage, zip)) {
 if (b) {
 } else {

  /* There can be multiple threads doing an LRU scan to
  free a block. The page_cleaner thread can be doing an
  LRU batch whereas user threads can potentially be doing
  multiple single page flushes. As we release
  buf_pool->mutex below we need to make sure that no one
  else considers this block as a victim for page
  replacement. This block is already out of page_hash
  and we are about to remove it from the LRU list and put
  it on the free list. */


buf_LRU_block_remove_hashed will remove bpage from the LRU list. Thus it appears that
1) The comment "we need sure that no one else considers this block as a victim for page replacement" is false, as the block is not on the LRU list anymore where the victims are picked from;
2) There is no need to make the page sticky here and non-sticky below (not shown in the code snippet).

Suggested fix:
Remove else branch, make the final buf_page_unset_sticky() handle the b != NULL case only.

Tags: innodb

Related branches

tags: added: innodb
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to:

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

Other bug subscribers

Related blueprints

Remote bug watches

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