Commit e7283cea authored by Marko Mäkelä's avatar Marko Mäkelä

Bug#16067973 DROP TABLE SLOW WHEN IT DECOMPRESS COMPRESSED-ONLY PAGES

buf_page_get_gen(): Do not attempt to decompress a compressed-only
page when mode == BUF_PEEK_IF_IN_POOL. This mode is only being used by
btr_search_drop_page_hash_when_freed(). There cannot be any adaptive
hash index pointing to a page that does not exist in uncompressed
format in the buffer pool.

innodb_buffer_pool_evict_update(): New function for debug builds, to handle
SET GLOBAL innodb_buffer_pool_evicted='uncompressed'
by evicting all uncompressed page frames of compressed tablespaces
from the buffer pool.

rb#1873 approved by Jimmy Yang
parent bc21e8cd
SELECT @@global.innodb_buffer_pool_evict;
@@global.innodb_buffer_pool_evict
SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
SELECT @@global.innodb_buffer_pool_evict;
@@global.innodb_buffer_pool_evict
-- source include/have_innodb_plugin.inc
# This is a debug variable for now
-- source include/have_debug.inc
SELECT @@global.innodb_buffer_pool_evict;
SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
# Should always be empty.
SELECT @@global.innodb_buffer_pool_evict;
2013-01-21 The InnoDB Team
* buf/buf0buf.cc, handler/ha_innodb.cc:
Fix Bug#16067973 DROP TABLE IS SLOW WHEN IT DECOMPRESSES
COMPRESSED-ONLY PAGES
2013-01-11 The InnoDB Team 2013-01-11 The InnoDB Team
* row/row0sel.c: * row/row0sel.c:
Fix Bug#16088883 KILLING A QUERY INSIDE INNODB CAUSES IT TO Fix Bug#16088883 KILLING A QUERY INSIDE INNODB CAUSES IT TO
...@@ -6,7 +12,7 @@ ...@@ -6,7 +12,7 @@
2012-12-18 The InnoDB Team 2012-12-18 The InnoDB Team
* include/univ.i: * include/univ.i:
Fix Bug#Bug#13463493 INNODB PLUGIN WERE CHANGED, BUT STILL USE THE Fix Bug#13463493 INNODB PLUGIN WERE CHANGED, BUT STILL USE THE
SAME VERSION NUMBER 1.0.17 SAME VERSION NUMBER 1.0.17
2012-12-13 The InnoDB Team 2012-12-13 The InnoDB Team
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
...@@ -1664,6 +1664,7 @@ loop2: ...@@ -1664,6 +1664,7 @@ loop2:
if (must_read && (mode == BUF_GET_IF_IN_POOL if (must_read && (mode == BUF_GET_IF_IN_POOL
|| mode == BUF_PEEK_IF_IN_POOL)) { || mode == BUF_PEEK_IF_IN_POOL)) {
/* The page is only being read to buffer */ /* The page is only being read to buffer */
null_exit:
buf_pool_mutex_exit(); buf_pool_mutex_exit();
return(NULL); return(NULL);
...@@ -1678,6 +1679,14 @@ loop2: ...@@ -1678,6 +1679,14 @@ loop2:
case BUF_BLOCK_ZIP_PAGE: case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY: case BUF_BLOCK_ZIP_DIRTY:
if (mode == BUF_PEEK_IF_IN_POOL) {
/* This mode is only used for dropping an
adaptive hash index. There cannot be an
adaptive hash index for a compressed-only
page, so do not bother decompressing the page. */
goto null_exit;
}
bpage = &block->page; bpage = &block->page;
/* Protect bpage->buf_fix_count. */ /* Protect bpage->buf_fix_count. */
mutex_enter(&buf_pool_zip_mutex); mutex_enter(&buf_pool_zip_mutex);
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
...@@ -10926,6 +10926,55 @@ innodb_change_buffering_update( ...@@ -10926,6 +10926,55 @@ innodb_change_buffering_update(
*static_cast<const char*const*>(save); *static_cast<const char*const*>(save);
} }
#ifndef DBUG_OFF
static char* srv_buffer_pool_evict;
/****************************************************************//**
Called on SET GLOBAL innodb_buffer_pool_evict=...
Handles some values specially, to evict pages from the buffer pool.
SET GLOBAL innodb_buffer_pool_evict='uncompressed'
evicts all uncompressed page frames of compressed tablespaces. */
static
void
innodb_buffer_pool_evict_update(
/*============================*/
THD* thd, /*!< in: thread handle */
struct st_mysql_sys_var*var, /*!< in: pointer to system variable */
void* var_ptr,/*!< out: ignored */
const void* save) /*!< in: immediate result
from check function */
{
if (const char* op = *static_cast<const char*const*>(save)) {
if (!strcmp(op, "uncompressed")) {
/* Evict all uncompressed pages of compressed
tables from the buffer pool. Keep the compressed
pages in the buffer pool. */
buf_pool_mutex_enter();
for (buf_block_t* block = UT_LIST_GET_LAST(
buf_pool->unzip_LRU);
block != NULL; ) {
buf_block_t* prev_block
= UT_LIST_GET_PREV(unzip_LRU, block);
ut_ad(buf_block_get_state(block)
== BUF_BLOCK_FILE_PAGE);
ut_ad(block->in_unzip_LRU_list);
ut_ad(block->page.in_LRU_list);
mutex_enter(&block->mutex);
buf_LRU_free_block(&block->page, FALSE);
mutex_exit(&block->mutex);
block = prev_block;
}
buf_pool_mutex_exit();
}
}
}
#endif /* !DBUG_OFF */
static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff) static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
{ {
innodb_export_status(); innodb_export_status();
...@@ -11128,6 +11177,13 @@ static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment, ...@@ -11128,6 +11177,13 @@ static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
"Data file autoextend increment in megabytes", "Data file autoextend increment in megabytes",
NULL, NULL, 8L, 1L, 1000L, 0); NULL, NULL, 8L, 1L, 1000L, 0);
#ifndef DBUG_OFF
static MYSQL_SYSVAR_STR(buffer_pool_evict, srv_buffer_pool_evict,
PLUGIN_VAR_RQCMDARG,
"Evict pages from the InnoDB buffer pool.",
NULL, innodb_buffer_pool_evict_update, "");
#endif /* !DBUG_OFF */
static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size, static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
...@@ -11300,6 +11356,9 @@ static MYSQL_SYSVAR_BOOL(trx_purge_view_update_only_debug, ...@@ -11300,6 +11356,9 @@ static MYSQL_SYSVAR_BOOL(trx_purge_view_update_only_debug,
static struct st_mysql_sys_var* innobase_system_variables[]= { static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment), MYSQL_SYSVAR(autoextend_increment),
#ifndef DBUG_OFF
MYSQL_SYSVAR(buffer_pool_evict),
#endif /* !DBUG_OFF */
MYSQL_SYSVAR(buffer_pool_size), MYSQL_SYSVAR(buffer_pool_size),
MYSQL_SYSVAR(checksums), MYSQL_SYSVAR(checksums),
MYSQL_SYSVAR(commit_concurrency), MYSQL_SYSVAR(commit_concurrency),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment