Merge lp:~laurynas-biveinis/percona-server/bug1305364-5.6 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 593
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1305364-5.6
Merge into: lp:percona-server/5.6
Diff against target: 91 lines (+24/-3)
4 files modified
storage/innobase/btr/btr0sea.cc (+5/-1)
storage/innobase/buf/buf0flu.cc (+12/-2)
storage/innobase/buf/buf0lru.cc (+2/-0)
storage/innobase/include/buf0buf.ic (+5/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1305364-5.6
Reviewer Review Type Date Requested Status
Vlad Lesin (community) g2 Approve
Review via email: mp+217090@code.launchpad.net

Description of the change

Merge bug 1305364 (InnoDB: Assertion failure in file buf0flu.cc line
546 | crashes if RW workload and InnoDB compression are combined) from
5.5 and null-merge fix for bug 1219833.

The automerged bits from 5.5 are extra assertions in
buf_flush_page_and_try_neighbors and buf_flush_or_remove_pages. All
other 5.5 bits have been null-merged.

The 5.6-specific extra fixes implemented:
- in btr_search_validate_one_table: lock LRU list mutex around
  buf_page_get_state/buf_block_hash_get calls. That's a
  counterintuitive way to achieve the correct locking, but the obvious
  option of moving up the block mutex locking would violate the
  locking order with page_hash locking performed by
  buf_block_hash_get, and locking page_hash earlier would require
  verbose changes to lock to get the right latch, unlock, relock,
  check the state.
- in buf_flush_ready_for_flush: accept BUF_BLOCK_REMOVE_HASH pages (if
  LRU list is unlocked), return false for them.
- in buf_page_get_block: assert that page hash is S or X latched or
  that LRU list mutex is held.

http://jenkins.percona.com/job/percona-server-5.6-param/593/
Not sure if G1 or G2

To post a comment you must log in.
Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

Looks good for me.

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/btr/btr0sea.cc'
2--- storage/innobase/btr/btr0sea.cc 2013-10-23 08:48:28 +0000
3+++ storage/innobase/btr/btr0sea.cc 2014-04-24 16:39:10 +0000
4@@ -1944,7 +1944,10 @@
5 buf_pool_t* buf_pool;
6 index_id_t page_index_id;
7
8- buf_pool = buf_pool_from_bpage((buf_page_t*) block);
9+ buf_pool = buf_pool_from_bpage((buf_page_t *) block);
10+ /* Prevent BUF_BLOCK_FILE_PAGE -> BUF_BLOCK_REMOVE_HASH
11+ transition until we lock the block mutex */
12+ mutex_enter(&buf_pool->LRU_list_mutex);
13
14 if (UNIV_LIKELY(buf_block_get_state(block)
15 == BUF_BLOCK_FILE_PAGE)) {
16@@ -1980,6 +1983,7 @@
17 }
18
19 mutex_enter(&block->mutex);
20+ mutex_exit(&buf_pool->LRU_list_mutex);
21
22 ut_a(!dict_index_is_ibuf(block->index));
23
24
25=== modified file 'storage/innobase/buf/buf0flu.cc'
26--- storage/innobase/buf/buf0flu.cc 2014-03-26 13:14:09 +0000
27+++ storage/innobase/buf/buf0flu.cc 2014-04-24 16:39:10 +0000
28@@ -546,7 +546,12 @@
29 ut_ad(flush_type < BUF_FLUSH_N_TYPES);
30 ut_ad(mutex_own(buf_page_get_mutex(bpage))
31 || flush_type == BUF_FLUSH_LIST);
32- ut_a(buf_page_in_file(bpage));
33+ ut_a(buf_page_in_file(bpage)
34+ || (buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH
35+#ifdef UNIV_DEBUG
36+ && !mutex_own(&buf_pool_from_bpage(bpage)->LRU_list_mutex)
37+#endif
38+ ));
39
40 if (bpage->oldest_modification == 0
41 || buf_page_get_io_fix_unlocked(bpage) != BUF_IO_NONE) {
42@@ -557,6 +562,7 @@
43
44 switch (flush_type) {
45 case BUF_FLUSH_LIST:
46+ return(buf_page_get_state(bpage) != BUF_BLOCK_REMOVE_HASH);
47 case BUF_FLUSH_LRU:
48 case BUF_FLUSH_SINGLE_PAGE:
49 return(true);
50@@ -1361,7 +1367,11 @@
51 }
52
53 ut_a(buf_page_in_file(bpage)
54- || buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH);
55+ || (buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH
56+#ifdef UNIV_DEBUG
57+ && !mutex_own(&buf_pool->LRU_list_mutex)
58+#endif
59+ ));
60
61 if (buf_flush_ready_for_flush(bpage, flush_type)) {
62 buf_pool_t* buf_pool;
63
64=== modified file 'storage/innobase/buf/buf0lru.cc'
65--- storage/innobase/buf/buf0lru.cc 2014-02-17 11:12:40 +0000
66+++ storage/innobase/buf/buf0lru.cc 2014-04-24 16:39:10 +0000
67@@ -595,6 +595,8 @@
68 buf_page_t* bpage;
69 ulint processed = 0;
70
71+ ut_ad(mutex_own(&buf_pool->LRU_list_mutex));
72+
73 buf_flush_list_mutex_enter(buf_pool);
74
75 rescan:
76
77=== modified file 'storage/innobase/include/buf0buf.ic'
78--- storage/innobase/include/buf0buf.ic 2014-02-17 11:12:40 +0000
79+++ storage/innobase/include/buf0buf.ic 2014-04-24 16:39:10 +0000
80@@ -662,6 +662,11 @@
81 buf_page_t* bpage) /*!< in: control block, or NULL */
82 {
83 if (bpage != NULL) {
84+#ifdef UNIV_DEBUG
85+ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
86+ ut_ad(buf_page_hash_lock_held_s_or_x(buf_pool, bpage)
87+ || mutex_own(&buf_pool->LRU_list_mutex));
88+#endif
89 ut_ad(buf_page_in_file(bpage));
90
91 if (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE) {

Subscribers

People subscribed via source and target branches