Commit 7d8db470 authored by Vadim Tkachenko's avatar Vadim Tkachenko

sync with extensions rev 23

parent b00b32c7
......@@ -162,7 +162,8 @@ static
void
buf_buddy_block_free(
/*=================*/
void* buf) /* in: buffer frame to deallocate */
void* buf, /* in: buffer frame to deallocate */
ibool have_page_hash_mutex)
{
const ulint fold = BUF_POOL_ZIP_FOLD_PTR(buf);
buf_page_t* bpage;
......@@ -190,7 +191,7 @@ buf_buddy_block_free(
block = (buf_block_t*) bpage;
mutex_enter(&block->mutex);
buf_LRU_block_free_non_file_page(block);
buf_LRU_block_free_non_file_page(block, have_page_hash_mutex);
mutex_exit(&block->mutex);
ut_ad(buf_buddy_n_frames > 0);
......@@ -274,10 +275,11 @@ buf_buddy_alloc_low(
possibly NULL if lru==NULL */
ulint i, /* in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
ibool* lru) /* in: pointer to a variable that will be assigned
ibool* lru, /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
ibool have_page_hash_mutex)
{
buf_block_t* block;
......@@ -312,9 +314,15 @@ buf_buddy_alloc_low(
/* Try replacing an uncompressed page in the buffer pool. */
//buf_pool_mutex_exit();
mutex_exit(&LRU_list_mutex);
if (have_page_hash_mutex)
mutex_exit(&page_hash_mutex);
block = buf_LRU_get_free_block(0);
*lru = TRUE;
//buf_pool_mutex_enter();
mutex_enter(&LRU_list_mutex);
if (have_page_hash_mutex)
mutex_enter(&page_hash_mutex);
alloc_big:
buf_buddy_block_register(block);
......@@ -407,7 +415,8 @@ buf_buddy_relocate(
/* out: TRUE if relocated */
void* src, /* in: block to relocate */
void* dst, /* in: free block to relocate to */
ulint i) /* in: index of buf_pool->zip_free[] */
ulint i, /* in: index of buf_pool->zip_free[] */
ibool have_page_hash_mutex)
{
buf_page_t* bpage;
const ulint size = BUF_BUDDY_LOW << i;
......@@ -433,12 +442,14 @@ buf_buddy_relocate(
actually is a properly initialized buf_page_t object. */
if (size >= PAGE_ZIP_MIN_SIZE) {
mutex_exit(&zip_free_mutex);
if (!have_page_hash_mutex)
mutex_exit(&zip_free_mutex);
/* This is a compressed page. */
mutex_t* mutex;
mutex_enter(&page_hash_mutex);
if (!have_page_hash_mutex)
mutex_enter(&page_hash_mutex);
/* The src block may be split into smaller blocks,
some of which may be free. Thus, the
mach_read_from_4() calls below may attempt to read
......@@ -459,8 +470,10 @@ buf_buddy_relocate(
added to buf_pool->page_hash yet. Obviously,
it cannot be relocated. */
mutex_exit(&page_hash_mutex);
mutex_enter(&zip_free_mutex);
if (!have_page_hash_mutex) {
mutex_exit(&page_hash_mutex);
mutex_enter(&zip_free_mutex);
}
return(FALSE);
}
......@@ -470,11 +483,17 @@ buf_buddy_relocate(
For the sake of simplicity, give up. */
ut_ad(page_zip_get_size(&bpage->zip) < size);
mutex_exit(&page_hash_mutex);
mutex_enter(&zip_free_mutex);
if (!have_page_hash_mutex) {
mutex_exit(&page_hash_mutex);
mutex_enter(&zip_free_mutex);
}
return(FALSE);
}
/* To keep latch order */
if (have_page_hash_mutex)
mutex_exit(&zip_free_mutex);
/* The block must have been allocated, but it may
contain uninitialized data. */
UNIV_MEM_ASSERT_W(src, size);
......@@ -482,7 +501,8 @@ buf_buddy_relocate(
mutex = buf_page_get_mutex(bpage);
mutex_enter(mutex);
mutex_exit(&page_hash_mutex);
if (!have_page_hash_mutex)
mutex_exit(&page_hash_mutex);
if (buf_page_can_relocate(bpage)) {
/* Relocate the compressed page. */
......@@ -529,7 +549,8 @@ buf_buddy_free_low(
/*===============*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
ulint i) /* in: index of buf_pool->zip_free[] */
ulint i, /* in: index of buf_pool->zip_free[] */
ibool have_page_hash_mutex)
{
buf_page_t* bpage;
buf_page_t* buddy;
......@@ -546,7 +567,7 @@ recombine:
ut_d(((buf_page_t*) buf)->state = BUF_BLOCK_ZIP_FREE);
if (i == BUF_BUDDY_SIZES) {
buf_buddy_block_free(buf);
buf_buddy_block_free(buf, have_page_hash_mutex);
return;
}
......@@ -614,7 +635,7 @@ buddy_nonfree:
buf_buddy_remove_from_free(bpage, i);
/* Try to relocate the buddy of buf to the free block. */
if (buf_buddy_relocate(buddy, bpage, i)) {
if (buf_buddy_relocate(buddy, bpage, i, have_page_hash_mutex)) {
ut_d(buddy->state = BUF_BLOCK_ZIP_FREE);
goto buddy_free2;
......@@ -642,7 +663,7 @@ buddy_nonfree:
}
#endif /* UNIV_DEBUG && !UNIV_DEBUG_VALGRIND */
if (buf_buddy_relocate(buddy, buf, i)) {
if (buf_buddy_relocate(buddy, buf, i, have_page_hash_mutex)) {
buf = bpage;
UNIV_MEM_VALID(bpage, BUF_BUDDY_LOW << i);
......
......@@ -1863,6 +1863,7 @@ buf_page_get_gen(
ibool accessed;
ulint fix_type;
ibool must_read;
mutex_t* block_mutex;
ut_ad(mtr);
ut_ad((rw_latch == RW_S_LATCH)
......@@ -1881,7 +1882,8 @@ loop:
//buf_pool_mutex_enter();
if (block) {
mutex_enter(&block->mutex);
block_mutex = buf_page_get_mutex(block);
mutex_enter(block_mutex);
/* If the guess is a compressed page descriptor that
has been allocated by buf_buddy_alloc(), it may have
......@@ -1896,7 +1898,7 @@ loop:
|| space != block->page.space
|| buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE) {
mutex_exit(&block->mutex);
mutex_exit(block_mutex);
block = guess = NULL;
} else {
......@@ -1909,7 +1911,8 @@ loop:
mutex_enter(&page_hash_mutex);
block = (buf_block_t*) buf_page_hash_get(space, offset);
if (block) {
mutex_enter(&block->mutex);
block_mutex = buf_page_get_mutex(block);
mutex_enter(block_mutex);
}
mutex_exit(&page_hash_mutex);
}
......@@ -1940,7 +1943,7 @@ loop2:
if (must_read && mode == BUF_GET_IF_IN_POOL) {
/* The page is only being read to buffer */
//buf_pool_mutex_exit();
mutex_exit(&block->mutex);
mutex_exit(block_mutex);
return(NULL);
}
......@@ -1965,7 +1968,7 @@ wait_until_unfixed:
/* The block is buffer-fixed or I/O-fixed.
Try again later. */
//buf_pool_mutex_exit();
mutex_exit(&block->mutex);
mutex_exit(block_mutex);
os_thread_sleep(WAIT_FOR_READ);
goto loop;
......@@ -1973,16 +1976,17 @@ wait_until_unfixed:
/* Allocate an uncompressed page. */
//buf_pool_mutex_exit();
mutex_exit(&block->mutex);
mutex_exit(block_mutex);
block = buf_LRU_get_free_block(0);
ut_a(block);
block_mutex = buf_page_get_mutex(block);
//buf_pool_mutex_enter();
mutex_enter(&flush_list_mutex);
mutex_enter(&LRU_list_mutex);
mutex_enter(&page_hash_mutex);
mutex_enter(&block->mutex);
mutex_enter(block_mutex);
{
buf_page_t* hash_bpage
......@@ -1993,12 +1997,13 @@ wait_until_unfixed:
while buf_pool_mutex was released.
Free the block that was allocated. */
buf_LRU_block_free_non_file_page(block);
mutex_exit(&block->mutex);
buf_LRU_block_free_non_file_page(block, TRUE);
mutex_exit(block_mutex);
block = (buf_block_t*) hash_bpage;
block_mutex = buf_page_get_mutex(block);
mutex_enter(&block->mutex);
mutex_enter(block_mutex);
mutex_exit(&page_hash_mutex);
mutex_exit(&LRU_list_mutex);
mutex_exit(&flush_list_mutex);
......@@ -2015,7 +2020,7 @@ wait_until_unfixed:
Free the block that was allocated and try again.
This should be extremely unlikely. */
buf_LRU_block_free_non_file_page(block);
buf_LRU_block_free_non_file_page(block, TRUE);
//mutex_exit(&block->mutex);
mutex_exit(&page_hash_mutex);
......@@ -2084,10 +2089,10 @@ wait_until_unfixed:
mutex_exit(&buf_pool_mutex);
rw_lock_x_lock(&block->lock);
mutex_exit(&block->mutex);
mutex_exit(block_mutex);
mutex_exit(&buf_pool_zip_mutex);
buf_buddy_free(bpage, sizeof *bpage);
buf_buddy_free(bpage, sizeof *bpage, FALSE);
//buf_pool_mutex_exit();
......@@ -2102,7 +2107,7 @@ wait_until_unfixed:
/* Unfix and unlatch the block. */
//buf_pool_mutex_enter();
mutex_enter(&block->mutex);
mutex_enter(block_mutex);
mutex_enter(&buf_pool_mutex);
buf_pool->n_pend_unzip--;
mutex_exit(&buf_pool_mutex);
......@@ -2143,7 +2148,7 @@ wait_until_unfixed:
buf_page_set_accessed(&block->page, TRUE);
mutex_exit(&block->mutex);
mutex_exit(block_mutex);
buf_block_make_young(&block->page);
......@@ -2694,7 +2699,7 @@ buf_page_init_for_read(
err_exit:
if (block) {
mutex_enter(&block->mutex);
buf_LRU_block_free_non_file_page(block);
buf_LRU_block_free_non_file_page(block, TRUE);
mutex_exit(&block->mutex);
}
......@@ -2753,9 +2758,9 @@ err_exit2:
operation until after the block descriptor has
been added to buf_pool->LRU and
buf_pool->page_hash. */
//mutex_exit(&block->mutex); /*##may be able to removed?##*/
data = buf_buddy_alloc(zip_size, &lru);
//mutex_enter(&block->mutex); /*##may be able to removed?##*/
mutex_exit(&block->mutex);
data = buf_buddy_alloc(zip_size, &lru, FALSE);
mutex_enter(&block->mutex);
block->page.zip.data = data;
/* To maintain the invariant
......@@ -2779,8 +2784,8 @@ err_exit2:
control block (bpage), in order to avoid the
invocation of buf_buddy_relocate_block() on
uninitialized data. */
data = buf_buddy_alloc(zip_size, &lru);
bpage = buf_buddy_alloc(sizeof *bpage, &lru);
data = buf_buddy_alloc(zip_size, &lru, TRUE);
bpage = buf_buddy_alloc(sizeof *bpage, &lru, TRUE);
/* If buf_buddy_alloc() allocated storage from the LRU list,
it released and reacquired buf_pool_mutex. Thus, we must
......@@ -2931,15 +2936,15 @@ buf_page_create(
rw_lock_x_lock(&block->lock);
page_zip_set_size(&block->page.zip, zip_size);
//mutex_exit(&block->mutex); /*##may be able to removed?##*/
mutex_exit(&block->mutex);
/* buf_pool_mutex may be released and reacquired by
buf_buddy_alloc(). Thus, we must release block->mutex
in order not to break the latching order in
the reacquisition of buf_pool_mutex. We also must
defer this operation until after the block descriptor
has been added to buf_pool->LRU and buf_pool->page_hash. */
data = buf_buddy_alloc(zip_size, &lru);
//mutex_enter(&block->mutex); /*##may be able to removed?##*/
data = buf_buddy_alloc(zip_size, &lru, FALSE);
mutex_enter(&block->mutex);
block->page.zip.data = data;
/* To maintain the invariant
......
......@@ -112,8 +112,9 @@ static
void
buf_LRU_block_free_hashed_page(
/*===========================*/
buf_block_t* block); /* in: block, must contain a file page and
buf_block_t* block, /* in: block, must contain a file page and
be in a state where it can be freed */
ibool have_page_hash_mutex);
/**********************************************************************
Determines if the unzip_LRU list should be used for evicting a victim
......@@ -389,7 +390,7 @@ scan_again:
if (buf_LRU_block_remove_hashed_page(bpage, TRUE)
!= BUF_BLOCK_ZIP_FREE) {
buf_LRU_block_free_hashed_page((buf_block_t*)
bpage);
bpage, TRUE);
} else {
/* The compressed block descriptor
(bpage) has been deallocated and
......@@ -860,7 +861,7 @@ loop:
if (UNIV_UNLIKELY(zip_size)) {
ibool lru;
page_zip_set_size(&block->page.zip, zip_size);
block->page.zip.data = buf_buddy_alloc(zip_size, &lru);
block->page.zip.data = buf_buddy_alloc(zip_size, &lru, FALSE);
UNIV_MEM_DESC(block->page.zip.data, zip_size, block);
} else {
page_zip_set_size(&block->page.zip, 0);
......@@ -1392,7 +1393,7 @@ buf_LRU_free_block(
from the LRU list), refuse to free bpage. */
alloc:
buf_pool_mutex_exit_forbid();
b = buf_buddy_alloc(sizeof *b, NULL);
b = buf_buddy_alloc(sizeof *b, NULL, FALSE);
buf_pool_mutex_exit_allow();
if (UNIV_UNLIKELY(!b)) {
......@@ -1424,7 +1425,7 @@ alloc:
|| ( bpage->oldest_modification
&& buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE ) ) {
if (b) {
buf_buddy_free(b, sizeof *b);
buf_buddy_free(b, sizeof *b, TRUE);
}
mutex_exit(&LRU_list_mutex);
mutex_exit(&page_hash_mutex);
......@@ -1599,7 +1600,7 @@ alloc:
mutex_exit(&buf_pool_zip_mutex);
}
buf_LRU_block_free_hashed_page((buf_block_t*) bpage);
buf_LRU_block_free_hashed_page((buf_block_t*) bpage, FALSE);
} else {
/* It may be bug of 1.0.2 */
//mutex_enter(block_mutex);
......@@ -1614,7 +1615,8 @@ UNIV_INTERN
void
buf_LRU_block_free_non_file_page(
/*=============================*/
buf_block_t* block) /* in: block, must not contain a file page */
buf_block_t* block, /* in: block, must not contain a file page */
ibool have_page_hash_mutex)
{
void* data;
......@@ -1652,7 +1654,7 @@ buf_LRU_block_free_non_file_page(
block->page.zip.data = NULL;
mutex_exit(&block->mutex);
buf_pool_mutex_exit_forbid();
buf_buddy_free(data, page_zip_get_size(&block->page.zip));
buf_buddy_free(data, page_zip_get_size(&block->page.zip), have_page_hash_mutex);
buf_pool_mutex_exit_allow();
mutex_enter(&block->mutex);
page_zip_set_size(&block->page.zip, 0);
......@@ -1823,8 +1825,8 @@ buf_LRU_block_remove_hashed_page(
mutex_exit(&buf_pool_zip_mutex);
buf_pool_mutex_exit_forbid();
buf_buddy_free(bpage->zip.data,
page_zip_get_size(&bpage->zip));
buf_buddy_free(bpage, sizeof(*bpage));
page_zip_get_size(&bpage->zip), TRUE);
buf_buddy_free(bpage, sizeof(*bpage), TRUE);
buf_pool_mutex_exit_allow();
UNIV_MEM_UNDESC(bpage);
return(BUF_BLOCK_ZIP_FREE);
......@@ -1844,7 +1846,7 @@ buf_LRU_block_remove_hashed_page(
bpage->zip.data = NULL;
mutex_exit(&((buf_block_t*) bpage)->mutex);
buf_buddy_free(data, page_zip_get_size(&bpage->zip));
buf_buddy_free(data, page_zip_get_size(&bpage->zip), TRUE);
mutex_enter(&((buf_block_t*) bpage)->mutex);
page_zip_set_size(&bpage->zip, 0);
}
......@@ -1870,15 +1872,16 @@ static
void
buf_LRU_block_free_hashed_page(
/*===========================*/
buf_block_t* block) /* in: block, must contain a file page and
buf_block_t* block, /* in: block, must contain a file page and
be in a state where it can be freed */
ibool have_page_hash_mutex)
{
//ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(&block->mutex));
buf_block_set_state(block, BUF_BLOCK_MEMORY);
buf_LRU_block_free_non_file_page(block);
buf_LRU_block_free_non_file_page(block, have_page_hash_mutex);
}
/************************************************************************
......
......@@ -167,6 +167,7 @@ static char* innobase_log_arch_dir = NULL;
#endif /* UNIV_LOG_ARCHIVE */
static my_bool innobase_use_doublewrite = TRUE;
static my_bool innobase_use_checksums = TRUE;
static my_bool innobase_extra_undoslots = FALSE;
static my_bool innobase_locks_unsafe_for_binlog = FALSE;
static my_bool innobase_rollback_on_timeout = FALSE;
static my_bool innobase_create_status_file = FALSE;
......@@ -1960,6 +1961,8 @@ innobase_init(
goto error;
}
srv_extra_undoslots = (ibool) innobase_extra_undoslots;
/* -------------- Log files ---------------------------*/
/* The default dir for log files is the datadir of MySQL */
......@@ -9357,6 +9360,13 @@ static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
"The common part for InnoDB table spaces.",
NULL, NULL, NULL);
static MYSQL_SYSVAR_BOOL(extra_undoslots, innobase_extra_undoslots,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Enable to use about 4000 undo slots instead of default 1024. "
"#### Attention: Once you enable this parameter, "
"don't use the datafile for normal mysqld or ibbackup! ####",
NULL, NULL, FALSE);
static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Enable InnoDB doublewrite buffer (enabled by default). "
......@@ -9606,6 +9616,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(data_file_path),
MYSQL_SYSVAR(data_home_dir),
MYSQL_SYSVAR(doublewrite),
MYSQL_SYSVAR(extra_undoslots),
MYSQL_SYSVAR(fast_shutdown),
MYSQL_SYSVAR(file_io_threads),
MYSQL_SYSVAR(file_per_table),
......
......@@ -30,5 +30,6 @@ struct innodb_enhancement {
{"innodb_opt_lru_count","Fix of buffer_pool mutex","Decreases contention on buffer_pool mutex on LRU operations","http://www.percona.com/docs/wiki/percona-xtradb:innodb_opt_lru_count"},
{"innodb_buffer_pool_pages","Information of buffer pool content","","http://www.percona.com/docs/wiki/percona-xtradb:innodb_buffer_pool_pages"},
{"innodb_split_buf_pool_mutex","More fix of buffer_pool mutex","Spliting buf_pool_mutex and optimizing based on innodb_opt_lru_count","http://www.percona.com/docs/wiki/percona-xtradb:innodb_split_buf_pool_mutex"},
{"innodb_expand_undo_slots","expandable maximum number of undo slots","from 1024 (default) to about 4000","http://www.percona.com/docs/wiki/percona-xtradb:innodb_expand_undo_slots"},
{NULL, NULL, NULL, NULL}
};
......@@ -33,10 +33,11 @@ buf_buddy_alloc(
/* out: allocated block,
possibly NULL if lru == NULL */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
ibool* lru) /* in: pointer to a variable that will be assigned
ibool* lru, /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
ibool have_page_hash_mutex)
__attribute__((malloc));
/**************************************************************************
......@@ -47,7 +48,8 @@ buf_buddy_free(
/*===========*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
ulint size) /* in: block size, up to UNIV_PAGE_SIZE */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
ibool have_page_hash_mutex)
__attribute__((nonnull));
/** Statistics of buddy blocks of a given size. */
......
......@@ -28,10 +28,11 @@ buf_buddy_alloc_low(
possibly NULL if lru==NULL */
ulint i, /* in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
ibool* lru) /* in: pointer to a variable that will be assigned
ibool* lru, /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
ibool have_page_hash_mutex)
__attribute__((malloc));
/**************************************************************************
......@@ -42,8 +43,9 @@ buf_buddy_free_low(
/*===============*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
ulint i) /* in: index of buf_pool->zip_free[],
ulint i, /* in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
ibool have_page_hash_mutex)
__attribute__((nonnull));
/**************************************************************************
......@@ -81,14 +83,15 @@ buf_buddy_alloc(
/* out: allocated block,
possibly NULL if lru == NULL */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
ibool* lru) /* in: pointer to a variable that will be assigned
ibool* lru, /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
ibool have_page_hash_mutex)
{
//ut_ad(buf_pool_mutex_own());
return(buf_buddy_alloc_low(buf_buddy_get_slot(size), lru));
return(buf_buddy_alloc_low(buf_buddy_get_slot(size), lru, have_page_hash_mutex));
}
/**************************************************************************
......@@ -99,12 +102,13 @@ buf_buddy_free(
/*===========*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
ulint size) /* in: block size, up to UNIV_PAGE_SIZE */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
ibool have_page_hash_mutex)
{
//ut_ad(buf_pool_mutex_own());
mutex_enter(&zip_free_mutex);
buf_buddy_free_low(buf, buf_buddy_get_slot(size));
buf_buddy_free_low(buf, buf_buddy_get_slot(size), have_page_hash_mutex);
mutex_exit(&zip_free_mutex);
}
......
......@@ -736,7 +736,7 @@ buf_block_free(
ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE);
buf_LRU_block_free_non_file_page(block);
buf_LRU_block_free_non_file_page(block, FALSE);
mutex_exit(&block->mutex);
......
......@@ -147,7 +147,8 @@ UNIV_INTERN
void
buf_LRU_block_free_non_file_page(
/*=============================*/
buf_block_t* block); /* in: block, must not contain a file page */
buf_block_t* block, /* in: block, must not contain a file page */
ibool have_page_hash_mutex);
/**********************************************************************
Adds a block to the LRU list. */
UNIV_INTERN
......
......@@ -73,6 +73,8 @@ extern char** srv_data_file_names;
extern ulint* srv_data_file_sizes;
extern ulint* srv_data_file_is_raw_partition;
extern ibool srv_extra_undoslots;
extern ibool srv_auto_extend_last_data_file;
extern ulint srv_last_file_size_max;
extern ulong srv_auto_extend_increment;
......
......@@ -115,8 +115,11 @@ trx_rseg_create(
mtr_t* mtr); /* in: mtr */
/* Real max value may be 4076 in usual. But reserve 4 slot for safety or etc... */
#define TRX_RSEG_N_EXTRA_SLOTS (((UNIV_PAGE_SIZE - (FIL_PAGE_DATA + FIL_PAGE_DATA_END + TRX_RSEG_UNDO_SLOTS)) / TRX_RSEG_SLOT_SIZE) - 4)
/* Number of undo log slots in a rollback segment file copy */
#define TRX_RSEG_N_SLOTS (UNIV_PAGE_SIZE / 16)
#define TRX_RSEG_N_SLOTS (srv_extra_undoslots ? TRX_RSEG_N_EXTRA_SLOTS : (UNIV_PAGE_SIZE / 16))
/* Maximum number of transactions supported by a single rollback segment */
#define TRX_RSEG_MAX_N_TRXS (TRX_RSEG_N_SLOTS / 2)
......
......@@ -12,7 +12,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
#define INNODB_VERSION_BUGFIX 2
#define PERCONA_INNODB_VERSION 2
#define PERCONA_INNODB_VERSION 1
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
......
diff mysql-test/r/information_schema.result.orig mysql-test/r/information_schema.result
--- mysql-test/r/information_schema.result.orig 2008-08-04 09:27:49.000000000 +0300
+++ mysql-test/r/information_schema.result 2008-10-07 11:21:51.000000000 +0300
@@ -64,6 +64,13 @@
@@ -64,6 +64,17 @@
TRIGGERS
USER_PRIVILEGES
VIEWS
+INNODB_CMP_RESET
+INNODB_CMP
+INNODB_BUFFER_POOL_PAGES
+INNODB_CMPMEM
+INNODB_BUFFER_POOL_PAGES_INDEX
+XTRADB_ENHANCEMENTS
+INNODB_TRX
+INNODB_CMPMEM_RESET
+INNODB_BUFFER_POOL_PAGES_BLOB
+INNODB_LOCK_WAITS
+INNODB_CMPMEM
+INNODB_CMP
+INNODB_CMP_RESET
+INNODB_LOCKS
+INNODB_CMPMEM_RESET
columns_priv
db
event
@@ -795,6 +802,8 @@
@@ -795,6 +806,8 @@
TABLES UPDATE_TIME datetime
TABLES CHECK_TIME datetime
TRIGGERS CREATED datetime
......@@ -24,47 +28,74 @@ diff mysql-test/r/information_schema.result.orig mysql-test/r/information_schema
event execute_at datetime
event last_executed datetime
event starts datetime
@@ -848,7 +857,7 @@
@@ -843,12 +856,13 @@
TABLE_CONSTRAINTS TABLE_NAME select
TABLE_PRIVILEGES TABLE_NAME select
VIEWS TABLE_NAME select
+INNODB_BUFFER_POOL_PAGES_INDEX table_name select
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 28
+information_schema 35
+information_schema 39
mysql 22
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
@@ -1263,6 +1272,13 @@
@@ -1263,6 +1277,17 @@
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
VIEWS TABLE_SCHEMA
+INNODB_CMP_RESET page_size
+INNODB_CMP page_size
+INNODB_BUFFER_POOL_PAGES page_type
+INNODB_CMPMEM page_size
+INNODB_BUFFER_POOL_PAGES_INDEX schema_name
+XTRADB_ENHANCEMENTS name
+INNODB_TRX trx_id
+INNODB_CMPMEM_RESET page_size
+INNODB_BUFFER_POOL_PAGES_BLOB space_id
+INNODB_LOCK_WAITS requesting_trx_id
+INNODB_CMPMEM page_size
+INNODB_CMP page_size
+INNODB_CMP_RESET page_size
+INNODB_LOCKS lock_id
+INNODB_CMPMEM_RESET page_size
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
INNER JOIN
@@ -1306,6 +1322,13 @@
@@ -1306,14 +1331,25 @@
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
VIEWS TABLE_SCHEMA
+INNODB_CMP_RESET page_size
+INNODB_CMP page_size
+INNODB_BUFFER_POOL_PAGES page_type
+INNODB_CMPMEM page_size
+INNODB_BUFFER_POOL_PAGES_INDEX schema_name
+XTRADB_ENHANCEMENTS name
+INNODB_TRX trx_id
+INNODB_CMPMEM_RESET page_size
+INNODB_BUFFER_POOL_PAGES_BLOB space_id
+INNODB_LOCK_WAITS requesting_trx_id
+INNODB_CMPMEM page_size
+INNODB_CMP page_size
+INNODB_CMP_RESET page_size
+INNODB_LOCKS lock_id
+INNODB_CMPMEM_RESET page_size
SELECT MAX(table_name) FROM information_schema.tables;
MAX(table_name)
VIEWS
@@ -1382,6 +1405,13 @@
-VIEWS
+XTRADB_ENHANCEMENTS
SELECT table_name from information_schema.tables
WHERE table_name=(SELECT MAX(table_name)
FROM information_schema.tables);
table_name
-VIEWS
+XTRADB_ENHANCEMENTS
DROP TABLE IF EXISTS bug23037;
DROP FUNCTION IF EXISTS get_value;
SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='bug23037';
@@ -1382,6 +1418,16 @@
FILES information_schema.FILES 1
GLOBAL_STATUS information_schema.GLOBAL_STATUS 1
GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
+INNODB_BUFFER_POOL_PAGES information_schema.INNODB_BUFFER_POOL_PAGES 1
+INNODB_BUFFER_POOL_PAGES_BLOB information_schema.INNODB_BUFFER_POOL_PAGES_BLOB 1
+INNODB_BUFFER_POOL_PAGES_INDEX information_schema.INNODB_BUFFER_POOL_PAGES_INDEX 1
+INNODB_CMP information_schema.INNODB_CMP 1
+INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
+INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
......@@ -75,51 +106,71 @@ diff mysql-test/r/information_schema.result.orig mysql-test/r/information_schema
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
PARTITIONS information_schema.PARTITIONS 1
PLUGINS information_schema.PLUGINS 1
@@ -1400,6 +1446,7 @@
TRIGGERS information_schema.TRIGGERS 1
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
VIEWS information_schema.VIEWS 1
+XTRADB_ENHANCEMENTS information_schema.XTRADB_ENHANCEMENTS 1
create table t1(f1 int);
create view v1 as select f1+1 as a from t1;
create table t2 (f1 int, f2 int);
diff mysql-test/r/information_schema_db.result.orig mysql-test/r/information_schema_db.result
--- mysql-test/r/information_schema_db.result.orig 2008-08-04 09:27:49.000000000 +0300
+++ mysql-test/r/information_schema_db.result 2008-10-07 12:26:31.000000000 +0300
@@ -33,6 +33,13 @@
@@ -33,6 +33,17 @@
TRIGGERS
USER_PRIVILEGES
VIEWS
+INNODB_CMP_RESET
+INNODB_CMP
+INNODB_BUFFER_POOL_PAGES
+INNODB_CMPMEM
+INNODB_BUFFER_POOL_PAGES_INDEX
+XTRADB_ENHANCEMENTS
+INNODB_TRX
+INNODB_CMPMEM_RESET
+INNODB_BUFFER_POOL_PAGES_BLOB
+INNODB_LOCK_WAITS
+INNODB_CMPMEM
+INNODB_CMP
+INNODB_CMP_RESET
+INNODB_LOCKS
+INNODB_CMPMEM_RESET
show tables from INFORMATION_SCHEMA like 'T%';
Tables_in_information_schema (T%)
TABLES
diff mysql-test/r/mysqlshow.result.orig mysql-test/r/mysqlshow.result
--- mysql-test/r/mysqlshow.result.orig 2008-08-04 09:27:51.000000000 +0300
+++ mysql-test/r/mysqlshow.result 2008-10-07 12:35:39.000000000 +0300
@@ -107,6 +107,13 @@
@@ -107,6 +107,17 @@
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+| INNODB_CMP_RESET |
+| INNODB_CMP |
+| INNODB_BUFFER_POOL_PAGES |
+| INNODB_CMPMEM |
+| INNODB_BUFFER_POOL_PAGES_INDEX |
+| XTRADB_ENHANCEMENTS |
+| INNODB_TRX |
+| INNODB_CMPMEM_RESET |
+| INNODB_BUFFER_POOL_PAGES_BLOB |
+| INNODB_LOCK_WAITS |
+| INNODB_CMPMEM |
+| INNODB_CMP |
+| INNODB_CMP_RESET |
+| INNODB_LOCKS |
+| INNODB_CMPMEM_RESET |
+---------------------------------------+
Database: INFORMATION_SCHEMA
+---------------------------------------+
@@ -140,6 +147,13 @@
@@ -140,6 +151,17 @@
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+| INNODB_CMP_RESET |
+| INNODB_CMP |
+| INNODB_BUFFER_POOL_PAGES |
+| INNODB_CMPMEM |
+| INNODB_BUFFER_POOL_PAGES_INDEX |
+| XTRADB_ENHANCEMENTS |
+| INNODB_TRX |
+| INNODB_CMPMEM_RESET |
+| INNODB_BUFFER_POOL_PAGES_BLOB |
+| INNODB_LOCK_WAITS |
+| INNODB_CMPMEM |
+| INNODB_CMP |
+| INNODB_CMP_RESET |
+| INNODB_LOCKS |
+| INNODB_CMPMEM_RESET |
+---------------------------------------+
Wildcard: inf_rmation_schema
+--------------------+
......@@ -107,6 +107,8 @@ UNIV_INTERN char** srv_data_file_names = NULL;
/* size in database pages */
UNIV_INTERN ulint* srv_data_file_sizes = NULL;
UNIV_INTERN ibool srv_extra_undoslots = FALSE;
/* if TRUE, then we auto-extend the last data file */
UNIV_INTERN ibool srv_auto_extend_last_data_file = FALSE;
/* if != 0, this tells the max size auto-extending may increase the
......
......@@ -1366,9 +1366,47 @@ trx_undo_lists_init(
rseg_header = trx_rsegf_get_new(rseg->space, rseg->zip_size,
rseg->page_no, &mtr);
if (!srv_extra_undoslots) {
/* uses direct call for avoid "Assertion failure" */
//page_no = trx_rsegf_get_nth_undo(rseg_header, TRX_RSEG_N_EXTRA_SLOTS - 1, &mtr);
page_no = mtr_read_ulint(rseg_header + TRX_RSEG_UNDO_SLOTS
+ (TRX_RSEG_N_EXTRA_SLOTS - 1) * TRX_RSEG_SLOT_SIZE,
MLOG_4BYTES, &mtr);
if (page_no != 0) {
/* check extended slots are not used */
for (i = TRX_RSEG_N_SLOTS; i < TRX_RSEG_N_EXTRA_SLOTS; i++) {
/* uses direct call for avoid "Assertion failure" */
page_no = mtr_read_ulint(rseg_header + TRX_RSEG_UNDO_SLOTS
+ i * TRX_RSEG_SLOT_SIZE,
MLOG_4BYTES, &mtr);
if (page_no != FIL_NULL) {
srv_extra_undoslots = TRUE;
fprintf(stderr,
"InnoDB: Error: innodb_extra_undoslots option is disabled, but it was enabled before.\n"
"InnoDB: The datafile is not normal for mysqld and disabled innodb_extra_undoslots.\n"
"InnoDB: Enable innodb_extra_undoslots if it was enabled before, and\n"
"InnoDB: ### don't use this datafile with other mysqld or ibbackup! ###\n"
"InnoDB: Cannot continue operation for the safety. Calling exit(1).\n");
exit(1);
}
}
fprintf(stderr,
"InnoDB: Warning: innodb_extra_undoslots option is disabled, but it was enabled before.\n"
"InnoDB: But extended undo slots seem not used, so continue operation.\n");
}
}
for (i = 0; i < TRX_RSEG_N_SLOTS; i++) {
page_no = trx_rsegf_get_nth_undo(rseg_header, i, &mtr);
/* If it was not initialized when the datafile created,
page_no will be 0 for the extended slots after that */
if (page_no == 0) {
page_no = FIL_NULL;
trx_rsegf_set_nth_undo(rseg_header, i, page_no, &mtr);
}
/* In forced recovery: try to avoid operations which look
at database pages; undo logs are rapidly changing data, and
the probability that they are in an inconsistent state is
......
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