During page flush it may be enqueued for flush again when innodb_flush_neighbours=0

Bug #405714 reported by Evgeniy Firsov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona patches
Won't Fix
Wishlist
Unassigned
Percona-XtraDB
Fix Released
High
Unassigned

Bug Description

I've got the following crash: Assertion failure in thread 1274956096 in file buf/buf0buf.c line 3428

Ther reason is that block_mutex temporary released after checking buf_flush_ready_for_flush in buf_flush_batch and if
--innodb_flush_neighbor_pages is set to 0 it doesn't checked after mutex acquired again. So can be queued for flush again when the page already being flushed.

I think the safer solution is as follows:

diff -r 101cd9bcb1fa storage/innobase/buf/buf0flu.c
--- a/storage/innobase/buf/buf0flu.c Thu Jul 23 23:25:41 2009 +0700
+++ b/storage/innobase/buf/buf0flu.c Tue Jul 28 15:56:59 2009 +0700
@@ -863,8 +863,9 @@
      /* out: number of pages flushed */
  ulint space, /* in: space id */
  ulint offset, /* in: page offset */
- enum buf_flush flush_type) /* in: BUF_FLUSH_LRU or
+ enum buf_flush flush_type, /* in: BUF_FLUSH_LRU or
      BUF_FLUSH_LIST */
+ ibool flush_neighbors)
 {
  buf_page_t* bpage;
  ulint low, high;
@@ -873,7 +874,7 @@

  ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST);

- if (UT_LIST_GET_LEN(buf_pool->LRU) < BUF_LRU_OLD_MIN_LEN) {
+ if (UT_LIST_GET_LEN(buf_pool->LRU) < BUF_LRU_OLD_MIN_LEN || !flush_neighbors) {
   /* If there is little space, it is better not to flush any
   block except from the end of the LRU list */

@@ -1048,23 +1049,10 @@

     old_page_count = page_count;

- if (srv_flush_neighbor_pages) {
- /* Try to flush also all the neighbors */
     page_count += buf_flush_try_neighbors(
- space, offset, flush_type);
- } else {
- /* Try to flush the page only */
- buf_pool_mutex_enter();
+ space, offset, flush_type,
+ srv_flush_neighbor_pages);

- mutex_t* block_mutex = buf_page_get_mutex(bpage);
- mutex_enter(block_mutex);
-
- buf_page_t* bpage_tmp = buf_page_hash_get(space, offset);
- if (bpage_tmp) {
- buf_flush_page(bpage_tmp, flush_type);
- page_count++;
- }
- }
     /* fprintf(stderr,
     "Flush type %lu, page no %lu, neighb %lu\n",
     flush_type, offset,

Changed in percona-xtradb:
assignee: nobody → Yasufumi Kinoshita (yasufumi-kinoshita)
importance: Undecided → High
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Percona-Patches also should be changed only for corresponding the source. (not critical)

Changed in percona-patches:
importance: Undecided → Wishlist
Changed in percona-xtradb:
status: New → Fix Committed
Changed in percona-xtradb:
status: Fix Committed → Fix Released
Changed in percona-patches:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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