From b505039028f8fe7ba1c72d560597d6a73bb6bab4 Mon Sep 17 00:00:00 2001 From: marko <> Date: Wed, 3 Dec 2008 13:34:51 +0000 Subject: [PATCH] branches/innodb+: Remove redundant buf_pool_watch_notify() calls after buf_page_init(). --- buf/buf0buf.c | 2 -- ibuf/ibuf0ibuf.c | 28 +++++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/buf/buf0buf.c b/buf/buf0buf.c index 29fbe382d6a..ef9bd2a0164 100644 --- a/buf/buf0buf.c +++ b/buf/buf0buf.c @@ -2732,7 +2732,6 @@ err_exit2: mutex_enter(&block->mutex); buf_page_init(space, offset, block); - buf_pool_watch_notify(space, offset); /* The block must be put to the LRU list, to the old blocks */ buf_LRU_add_block(bpage, TRUE/* to old blocks */); @@ -2909,7 +2908,6 @@ buf_page_create( mutex_enter(&block->mutex); buf_page_init(space, offset, block); - buf_pool_watch_notify(space, offset); /* The block must be put to the LRU list */ buf_LRU_add_block(&block->page, FALSE); diff --git a/ibuf/ibuf0ibuf.c b/ibuf/ibuf0ibuf.c index 0f594718460..a9e10184009 100644 --- a/ibuf/ibuf0ibuf.c +++ b/ibuf/ibuf0ibuf.c @@ -3249,14 +3249,6 @@ ibuf_insert_low( btr_pcur_open(ibuf->index, ibuf_entry, PAGE_CUR_LE, mode, &pcur, &mtr); - /* Don't buffer deletes if the page has been read in to the buffer - pool. */ - if (op == IBUF_OP_DELETE && buf_pool_watch_occurred(space, page_no)) { - err = DB_STRONG_FAIL; - - goto function_exit; - } - /* Find out the volume of already buffered inserts for the same index page */ min_n_recs = 0; @@ -3334,13 +3326,25 @@ ibuf_insert_low( bitmap_page, page_no, zip_size, IBUF_BITMAP_BUFFERED, &bitmap_mtr); + /* Don't buffer deletes if the page has been read in to the buffer + pool. */ + if (op == IBUF_OP_DELETE && buf_pool_watch_occurred(space, page_no)) { + err = DB_STRONG_FAIL; + + mtr_commit(&bitmap_mtr); + + goto function_exit; + } + if (!old_bit_value) { ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size, IBUF_BITMAP_BUFFERED, TRUE, &bitmap_mtr); } - mtr_commit(&bitmap_mtr); + if (op != IBUF_OP_DELETE) { + mtr_commit(&bitmap_mtr); + } cursor = btr_pcur_get_btr_cur(&pcur); @@ -3377,6 +3381,12 @@ ibuf_insert_low( ibuf_size_update(root, &mtr); } + if (op == IBUF_OP_DELETE) { + ut_a(!buf_pool_watch_occurred(space, page_no)); + + mtr_commit(&bitmap_mtr); + } + function_exit: #ifdef UNIV_IBUF_COUNT_DEBUG if (err == DB_SUCCESS) {