lp:~laurynas-biveinis/percona-server/bp-split-5.6

Created by Laurynas Biveinis and last modified
Get this branch:
bzr branch lp:~laurynas-biveinis/percona-server/bp-split-5.6
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

422. By Laurynas Biveinis

Port the buffer pool mutex split patch from XtraDB 5.5.

The notable differences from the 5.5 implementation.
- page_hash is already protected by an rw latch array in 5.6, thus do
  not port the corresponding mutex.
- buf_pool->mutex and its associated functions
  (buf_pool_mutex_enter(), buf_pool_mutex_exit(),
  buf_pool_mutex_own(), buf_pool_mutex_enter_all(),
  buf_pool_mutex_exit_all(), buf_pool_mutex_exit_allow(),
  buf_pool_mutex_exit_forbid()) have been completely removed. The
  objects formerly protected by it are now protected as follows:
  - zip_free_mutex protects buf_pool->zip_free and buddy allocator;
  - zip_hash_mutex protects buf_pool->zip_hash;
  - prevention of buffer page relocation is done by a corresponding S
    lock acquisition on page_hash;
  - a new mutex flush_state_mutex protects init_flush and n_flush.
  - buf_stat->n_pages_read, n_pages_written, n_pend_unzip,
    n_pend_reads become atomic variables.
- Many more source code comments have been edited to reflect the
  split. The edits were done as noticed and are not guaranteed to be
  complete.
- New helper function buf_own_zip_mutex_for_page() introduced for the
  code to self-document (and assert the related invariants) that the
  buf_pool->zip_mutex is being held as the block mutex for a given
  page.
- buf_pool_validate_instance() has been changed to drop fewer
  invariants. The only dropped one is the check that an I/O-fixed for
  write page must be S-latched.
- Dirty reads are used more aggressively for heuristic purposes (such
  as reading the list lengths), especially if converting them to clean
  reads requires either LRU or the free list mutex.
- in_LRU_list and in_unzip_LRU_list flag are kept as a debug-only
  flags as the LRU list scans without LRU list mutex were not ported
  from 5.5 as unsafe or redundant in 5.6.
- buf_page_get_mutex_enter() has been dropped as unsafe or
  unnecessary, bug 1220191.
- Some redundant buffer page state checks have not been ported,
  bug 1219833.
- struct buf_page_t list node split to three separate nodes has been
  reverted, bug 1224313.
- mutex_enter_nowait() is used in buf_flush_LRU_list_batch() to
  immediatelly skip currently-locked blocks instead of stalling.

With these changes, also fix:
- bug 1219842 / http://bugs.mysql.com/bug.php?id=69258 (does
  buf_LRU_buf_pool_running_out need to lock buffer pool mutexes);
- bug 1220544 / http://bugs.mysql.com/bug.php?id=70228 (Is
  buf_LRU_free_page() really supposed to make non-zip block sticky at
  the end?)

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.