diff options
author | Michael Widenius <monty@mysql.com> | 2010-11-30 23:11:03 +0200 |
---|---|---|
committer | Michael Widenius <monty@mysql.com> | 2010-11-30 23:11:03 +0200 |
commit | 1e5061fe3be981d6f685a2865fd1e2bcd3fcc23a (patch) | |
tree | a0c58838a4dd7bdf2ed4d739563da27727ada7b0 /storage/innodb_plugin/buf/buf0buf.c | |
parent | b2e979d868d5d5964d58c97ed9580e07f6123217 (diff) | |
parent | 6f279f40145624c1ffab06c63521f96ce4ac3a02 (diff) | |
download | mariadb-git-1e5061fe3be981d6f685a2865fd1e2bcd3fcc23a.tar.gz |
merge with 5.1
Diffstat (limited to 'storage/innodb_plugin/buf/buf0buf.c')
-rw-r--r-- | storage/innodb_plugin/buf/buf0buf.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index 660686bac1e..65d4311b840 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -2286,6 +2286,30 @@ wait_until_unfixed: bytes. */ UNIV_MEM_ASSERT_RW(&block->page, sizeof block->page); #endif +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG + if (mode == BUF_GET_IF_IN_POOL && ibuf_debug) { + /* Try to evict the block from the buffer pool, to use the + insert buffer as much as possible. */ + + if (buf_LRU_free_block(&block->page, TRUE, NULL) + == BUF_LRU_FREED) { + buf_pool_mutex_exit(); + mutex_exit(&block->mutex); + fprintf(stderr, + "innodb_change_buffering_debug evict %u %u\n", + (unsigned) space, (unsigned) offset); + return(NULL); + } else if (buf_flush_page_try(block)) { + fprintf(stderr, + "innodb_change_buffering_debug flush %u %u\n", + (unsigned) space, (unsigned) offset); + guess = block; + goto loop; + } + + /* Failed to evict the page; change it directly */ + } +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ buf_block_buf_fix_inc(block, file, line); |