Merge lp:~laurynas-biveinis/percona-server/bug1269352-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 621
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1269352-5.5
Merge into: lp:percona-server/5.5
Diff against target: 36 lines (+6/-13)
1 file modified
storage/innobase/buf/buf0flu.c (+6/-13)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1269352-5.5
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+201890@code.launchpad.net

Description of the change

BT 37223

    Fix bug 1269352 (InnoDB: failing assertion: buf_page_in_file(bpage)
    below buf_flush_page_and_try_neighbors()), a follow-up to bug
    1227581.

    The latter bug attempted to fix race conditions involving buffer
    blocks in the middle of flush list relocations having
    BUF_BLOCK_REMOVE_HASH state, but the fix was not fully
    correct. buf_LRU_block_remove_hashed_page()/buf_LRU_free_block() will
    ake a page BUF_BLOCK_REMOVE_HASH while holding an LRU list mutex, a
    page hash X latch, and the block mutex.
    buf_flush_page_and_try_neighbors() may hold a flush list mutex
    instead. So, even though it checks for BUF_BLOCK_REMOVE_HASH pages,
    there is nothing to protect the flushing candidate page from becoming
    BUF_BLOCK_REMOVE_HASH after that check.

    Fix by reverting BUF_BLOCK_REMOVE_HASH check in
    buf_flush_page_and_try_neighbors() and adjusting it to accept
    BUF_BLOCK_REMOVE_HASH pages until the mutex release before the
    buf_flush_try_neighbors() call.

http://jenkins.percona.com/job/percona-server-5.5-param/935/

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

Jenkins testing does not cover such kind of fixes. I think we should consider using RQG results for such things.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Vlad -

Please see PQA-10.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/buf/buf0flu.c'
2--- storage/innobase/buf/buf0flu.c 2013-11-29 06:22:52 +0000
3+++ storage/innobase/buf/buf0flu.c 2014-01-16 07:31:11 +0000
4@@ -1605,17 +1605,8 @@
5 ut_ad(block_mutex);
6 }
7
8- if (UNIV_UNLIKELY(buf_page_get_state(bpage)
9- == BUF_BLOCK_REMOVE_HASH)) {
10-
11- /* In case we don't hold the LRU list mutex, we may see a page
12- that is about to be relocated on the flush list. Do not
13- attempt to flush it. */
14- ut_ad(flush_type == BUF_FLUSH_LIST);
15- return (flushed);
16- }
17-
18- ut_a(buf_page_in_file(bpage));
19+ ut_a(buf_page_in_file(bpage)
20+ || buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH);
21
22 if (buf_flush_ready_for_flush(bpage, flush_type)) {
23 ulint space;
24@@ -1631,8 +1622,10 @@
25
26 /* These fields are protected by both the
27 buffer pool mutex and block mutex. */
28- space = buf_page_get_space(bpage);
29- offset = buf_page_get_page_no(bpage);
30+ /* Read the fields directly in order to avoid asserting on
31+ BUF_BLOCK_REMOVE_HASH pages. */
32+ space = bpage->space;
33+ offset = bpage->offset;
34
35 if (flush_type == BUF_FLUSH_LRU) {
36 mutex_exit(block_mutex);

Subscribers

People subscribed via source and target branches