lp:~laurynas-biveinis/percona-server/bug1305364-5.5

Created by Laurynas Biveinis on 2014-04-23 and last modified on 2014-04-23
Get this branch:
bzr branch lp:~laurynas-biveinis/percona-server/bug1305364-5.5
Only Laurynas Biveinis can upload to this branch. If you are Laurynas Biveinis please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Recent revisions

625. By Laurynas Biveinis on 2014-04-23

Fix bug 1305364 (InnoDB: Assertion failure in file buf0flu.cc line 546
| crashes if RW workload and InnoDB compression are combined) and bug
1219833
(Redundant page state re-checks in
buf_LRU_free_from_unzip_LRU_list() and
buf_LRU_free_from_common_LRU_list()).

The former bug was fixed by reviewing buf_page_in_file calls and
buf_page_get_state == BUF_BLOCK_REMOVE_HASH checks for locking
correctness. The transition for a buffer page state from
BUF_BLOCK_FILE_PAGE to BUF_BLOCK_REMOVE_HASH is protected by a
combination of locked page_hash_latch, LRU_list_mutex, and block
mutex. Thus, any of the checks above must have locked at least one of
those three sync objects.
- buf_page_get_zip: check if buf_page_get_state is still
  BUF_BLOCK_FILE_PAGE between mutex re-acquisition and
  buf_LRU_free_block call.
- buf_LRU_search_and_free_block: lock LRU list mutex unconditionally,
  so that buf_LRU_free_from_unzip_LRU_list and
  buf_LRU_free_from_common_LRU_list do not attempt unlocked LRU list
  scans anymore.
- buf_read_ahead_random: lock page_hash_latch and do not lock buffer
  pool mutex around buf_page_hash_get mutex. This is in line with
  previous fixes to buf_read_ahead_linear.

Add several asserts to document the required locking better in
buf_pool_watch_is_sentinel, buf_flush_page_and_try_neighbors,
buf_LRU_evict_from_unzip_LRU, buf_flush_or_remove_pages,
buf_LRU_free_from_unzip_LRU_list, buf_LRU_free_from_common_LRU_list,
and buf_page_get_block. Some of these are UNIV_SYNC_DEBUG, thus
nothing more than code comments, because currently UNIV_SYNC_DEBUG
builds are broken.

buf_LRU_search_and_free_block locking LRU list unconditionally enables
removing all the code in its callees that attempts to perform lockless
LRU list scans and is broken, as well as fixing bug 1219833. There
- remove have_LRU_mutex args from buf_LRU_evict_from_unzip_LRU,
  buf_LRU_free_from_unzip_LRU_list, buf_LRU_free_from_common_LRU_list,
  as it's always TRUE.
- remove any have_LRU_mutex checks, page state re-checks, and scan
  restarts from the same functions.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:percona-server/5.6
This branch contains Public information 
Everyone can see this information.