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

Remove IBUF_COUNT_DEBUG

The compile-time option IBUF_COUNT_DEBUG has not been used for years.
It would only work with up to 3 created .ibd files, with no buffered
changes existing while InnoDB is started up.
parent 169c0099
...@@ -3854,10 +3854,6 @@ buf_page_get_zip( ...@@ -3854,10 +3854,6 @@ buf_page_get_zip(
} }
} }
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(page_id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
return(bpage); return(bpage);
} }
...@@ -4631,15 +4627,9 @@ buf_page_get_gen( ...@@ -4631,15 +4627,9 @@ buf_page_get_gen(
} }
} }
if (!recv_no_ibuf_operations) { if (!access_time && !recv_no_ibuf_operations) {
if (access_time) { ibuf_merge_or_delete_for_page(
#ifdef UNIV_IBUF_COUNT_DEBUG block, page_id, &page_size, TRUE);
ut_a(ibuf_count_get(page_id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
} else {
ibuf_merge_or_delete_for_page(
block, page_id, &page_size, TRUE);
}
} }
buf_pool_mutex_enter(buf_pool); buf_pool_mutex_enter(buf_pool);
...@@ -4843,10 +4833,6 @@ buf_page_get_gen( ...@@ -4843,10 +4833,6 @@ buf_page_get_gen(
buf_read_ahead_linear(page_id, page_size, ibuf_inside(mtr)); buf_read_ahead_linear(page_id, page_size, ibuf_inside(mtr));
} }
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(fix_block->page.id) == 0);
#endif
ut_ad(!rw_lock_own_flagged(hash_lock, ut_ad(!rw_lock_own_flagged(hash_lock,
RW_LOCK_FLAG_X | RW_LOCK_FLAG_S)); RW_LOCK_FLAG_X | RW_LOCK_FLAG_S));
...@@ -4956,10 +4942,6 @@ buf_page_optimistic_get( ...@@ -4956,10 +4942,6 @@ buf_page_optimistic_get(
ibuf_inside(mtr)); ibuf_inside(mtr));
} }
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(block->page.id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
buf_pool = buf_pool_from_block(block); buf_pool = buf_pool_from_block(block);
buf_pool->stat.n_page_gets++; buf_pool->stat.n_page_gets++;
...@@ -5063,9 +5045,6 @@ buf_page_get_known_nowait( ...@@ -5063,9 +5045,6 @@ buf_page_get_known_nowait(
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a((mode == BUF_KEEP_OLD) || ibuf_count_get(block->page.id) == 0);
#endif
buf_pool->stat.n_page_gets++; buf_pool->stat.n_page_gets++;
return(TRUE); return(TRUE);
...@@ -5152,10 +5131,6 @@ buf_page_try_get_func( ...@@ -5152,10 +5131,6 @@ buf_page_try_get_func(
buf_pool->stat.n_page_gets++; buf_pool->stat.n_page_gets++;
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(block->page.id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
return(block); return(block);
} }
...@@ -5554,11 +5529,6 @@ buf_page_create( ...@@ -5554,11 +5529,6 @@ buf_page_create(
if (block if (block
&& buf_page_in_file(&block->page) && buf_page_in_file(&block->page)
&& !buf_pool_watch_is_sentinel(buf_pool, &block->page)) { && !buf_pool_watch_is_sentinel(buf_pool, &block->page)) {
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(page_id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
ut_d(block->page.file_page_was_freed = FALSE); ut_d(block->page.file_page_was_freed = FALSE);
/* Page can be found in buf_pool */ /* Page can be found in buf_pool */
...@@ -5663,9 +5633,6 @@ buf_page_create( ...@@ -5663,9 +5633,6 @@ buf_page_create(
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(++buf_dbg_counter % 5771 || buf_validate()); ut_a(++buf_dbg_counter % 5771 || buf_validate());
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(block->page.id) == 0);
#endif
return(block); return(block);
} }
...@@ -6114,14 +6081,6 @@ buf_page_io_complete(buf_page_t* bpage, bool dblwr, bool evict) ...@@ -6114,14 +6081,6 @@ buf_page_io_complete(buf_page_t* bpage, bool dblwr, bool evict)
buf_pool_mutex_enter(buf_pool); buf_pool_mutex_enter(buf_pool);
mutex_enter(block_mutex); mutex_enter(block_mutex);
#ifdef UNIV_IBUF_COUNT_DEBUG
if (io_type == BUF_IO_WRITE || uncompressed) {
/* For BUF_IO_READ of compressed-only blocks, the
buffered operations will be merged by buf_page_get_gen()
after the block has been uncompressed. */
ut_a(ibuf_count_get(bpage->id) == 0);
}
#endif
/* Because this thread which does the unlocking is not the same that /* Because this thread which does the unlocking is not the same that
did the locking, we use a pass value != 0 in unlock, which simply did the locking, we use a pass value != 0 in unlock, which simply
removes the newest lock debug record, without checking the thread removes the newest lock debug record, without checking the thread
...@@ -6350,11 +6309,6 @@ buf_pool_validate_instance( ...@@ -6350,11 +6309,6 @@ buf_pool_validate_instance(
buf_pool, block->page.id) buf_pool, block->page.id)
== &block->page); == &block->page);
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(buf_page_get_io_fix(&block->page)
== BUF_IO_READ
|| !ibuf_count_get(block->page.id));
#endif
switch (buf_page_get_io_fix(&block->page)) { switch (buf_page_get_io_fix(&block->page)) {
case BUF_IO_NONE: case BUF_IO_NONE:
break; break;
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2018, MariaDB Corporation. Copyright (c) 2013, 2019, MariaDB Corporation.
Copyright (c) 2013, 2014, Fusion-io Copyright (c) 2013, 2014, Fusion-io
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
...@@ -1041,11 +1041,6 @@ buf_flush_write_block_low( ...@@ -1041,11 +1041,6 @@ buf_flush_write_block_low(
ut_ad(!buf_page_get_mutex(bpage)->is_owned()); ut_ad(!buf_page_get_mutex(bpage)->is_owned());
ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_WRITE); ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_WRITE);
ut_ad(bpage->oldest_modification != 0); ut_ad(bpage->oldest_modification != 0);
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(bpage->id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
ut_ad(bpage->newest_modification != 0); ut_ad(bpage->newest_modification != 0);
/* Force the log to the disk before writing the modified block */ /* Force the log to the disk before writing the modified block */
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -1596,10 +1596,6 @@ buf_LRU_free_page( ...@@ -1596,10 +1596,6 @@ buf_LRU_free_page(
goto func_exit; goto func_exit;
} }
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(bpage->id) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
if (zip || !bpage->zip.data) { if (zip || !bpage->zip.data) {
/* This would completely free the block. */ /* This would completely free the block. */
/* Do not completely free dirty blocks. */ /* Do not completely free dirty blocks. */
......
...@@ -195,35 +195,6 @@ uint ibuf_debug; ...@@ -195,35 +195,6 @@ uint ibuf_debug;
/** The insert buffer control structure */ /** The insert buffer control structure */
ibuf_t* ibuf = NULL; ibuf_t* ibuf = NULL;
#ifdef UNIV_IBUF_COUNT_DEBUG
/** Number of tablespaces in the ibuf_counts array */
#define IBUF_COUNT_N_SPACES 4
/** Number of pages within each tablespace in the ibuf_counts array */
#define IBUF_COUNT_N_PAGES 130000
/** Buffered entry counts for file pages, used in debugging */
static ulint ibuf_counts[IBUF_COUNT_N_SPACES][IBUF_COUNT_N_PAGES];
/** Checks that the indexes to ibuf_counts[][] are within limits.
@param[in] page_id page id */
UNIV_INLINE
void
ibuf_count_check(
const page_id_t page_id)
{
if (page_id.space() < IBUF_COUNT_N_SPACES
&& page_id.page_no() < IBUF_COUNT_N_PAGES) {
return;
}
ib::fatal() << "UNIV_IBUF_COUNT_DEBUG limits space_id and page_no"
" and breaks crash recovery. space_id=" << page_id.space()
<< ", should be 0<=space_id<" << IBUF_COUNT_N_SPACES
<< ". page_no=" << page_id.page_no()
<< ", should be 0<=page_no<" << IBUF_COUNT_N_PAGES;
}
#endif
/** @name Offsets to the per-page bits in the insert buffer bitmap */ /** @name Offsets to the per-page bits in the insert buffer bitmap */
/* @{ */ /* @{ */
#define IBUF_BITMAP_FREE 0 /*!< Bits indicating the #define IBUF_BITMAP_FREE 0 /*!< Bits indicating the
...@@ -414,35 +385,6 @@ ibuf_tree_root_get( ...@@ -414,35 +385,6 @@ ibuf_tree_root_get(
return(root); return(root);
} }
#ifdef UNIV_IBUF_COUNT_DEBUG
/** Gets the ibuf count for a given page.
@param[in] page_id page id
@return number of entries in the insert buffer currently buffered for
this page */
ulint ibuf_count_get(const page_id_t page_id)
{
ibuf_count_check(page_id);
return(ibuf_counts[page_id.space()][page_id.page_no()]);
}
/** Sets the ibuf count for a given page.
@param[in] page_id page id
@param[in] val value to set */
static
void
ibuf_count_set(
const page_id_t page_id,
ulint val)
{
ibuf_count_check(page_id);
ut_a(val < UNIV_PAGE_SIZE);
ibuf_counts[page_id.space()][page_id.page_no()] = val;
}
#endif
/******************************************************************//** /******************************************************************//**
Closes insert buffer and frees the data structures. */ Closes insert buffer and frees the data structures. */
void void
...@@ -736,10 +678,6 @@ ibuf_bitmap_page_set_bits( ...@@ -736,10 +678,6 @@ ibuf_bitmap_page_set_bits(
#endif #endif
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX)); ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
ut_ad(mtr->is_named_space(page_id.space())); ut_ad(mtr->is_named_space(page_id.space()));
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a((bit != IBUF_BITMAP_BUFFERED) || (val != FALSE)
|| (0 == ibuf_count_get(page_id)));
#endif
bit_offset = (page_id.page_no() % page_size.physical()) bit_offset = (page_id.page_no() % page_size.physical())
* IBUF_BITS_PER_PAGE + bit; * IBUF_BITS_PER_PAGE + bit;
...@@ -3503,9 +3441,6 @@ ibuf_insert_low( ...@@ -3503,9 +3441,6 @@ ibuf_insert_low(
which it cannot do until we have buffered the IBUF_OP_DELETE which it cannot do until we have buffered the IBUF_OP_DELETE
and done mtr_commit(&mtr) to release the latch. */ and done mtr_commit(&mtr) to release the latch. */
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a((buffered == 0) || ibuf_count_get(page_id));
#endif
ibuf_mtr_start(&bitmap_mtr); ibuf_mtr_start(&bitmap_mtr);
bitmap_mtr.set_named_space(page_id.space()); bitmap_mtr.set_named_space(page_id.space());
...@@ -3648,17 +3583,6 @@ ibuf_insert_low( ...@@ -3648,17 +3583,6 @@ ibuf_insert_low(
} }
func_exit: func_exit:
#ifdef UNIV_IBUF_COUNT_DEBUG
if (err == DB_SUCCESS) {
ib::info() << "Incrementing ibuf count of page " << page_id
<< " from " << ibuf_count_get(space, page_no)
<< " by 1";
ibuf_count_set(page_id, ibuf_count_get(page_id) + 1);
}
#endif
ibuf_mtr_commit(&mtr); ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur); btr_pcur_close(&pcur);
...@@ -4356,14 +4280,6 @@ ibuf_delete_rec( ...@@ -4356,14 +4280,6 @@ ibuf_delete_rec(
ibuf->empty = true; ibuf->empty = true;
} }
#ifdef UNIV_IBUF_COUNT_DEBUG
ib::info() << "Decrementing ibuf count of space " << space
<< " page " << page_no << " from "
<< ibuf_count_get(page_id) << " by 1";
ibuf_count_set(page_id, ibuf_count_get(page_id) - 1);
#endif /* UNIV_IBUF_COUNT_DEBUG */
return(FALSE); return(FALSE);
} }
...@@ -4399,10 +4315,6 @@ ibuf_delete_rec( ...@@ -4399,10 +4315,6 @@ ibuf_delete_rec(
false, mtr); false, mtr);
ut_a(err == DB_SUCCESS); ut_a(err == DB_SUCCESS);
#ifdef UNIV_IBUF_COUNT_DEBUG
ibuf_count_set(page_id, ibuf_count_get(page_id) - 1);
#endif /* UNIV_IBUF_COUNT_DEBUG */
ibuf_size_update(root); ibuf_size_update(root);
mutex_exit(&ibuf_mutex); mutex_exit(&ibuf_mutex);
...@@ -4783,10 +4695,6 @@ ibuf_merge_or_delete_for_page( ...@@ -4783,10 +4695,6 @@ ibuf_merge_or_delete_for_page(
my_atomic_addlint(&ibuf->n_merges, 1); my_atomic_addlint(&ibuf->n_merges, 1);
ibuf_add_ops(ibuf->n_merged_ops, mops); ibuf_add_ops(ibuf->n_merged_ops, mops);
ibuf_add_ops(ibuf->n_discarded_ops, dops); ibuf_add_ops(ibuf->n_discarded_ops, dops);
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(page_id) == 0);
#endif
} }
/*********************************************************************//** /*********************************************************************//**
...@@ -4905,11 +4813,6 @@ ibuf_print( ...@@ -4905,11 +4813,6 @@ ibuf_print(
/*=======*/ /*=======*/
FILE* file) /*!< in: file where to print */ FILE* file) /*!< in: file where to print */
{ {
#ifdef UNIV_IBUF_COUNT_DEBUG
ulint i;
ulint j;
#endif
mutex_enter(&ibuf_mutex); mutex_enter(&ibuf_mutex);
fprintf(file, fprintf(file,
...@@ -4926,22 +4829,6 @@ ibuf_print( ...@@ -4926,22 +4829,6 @@ ibuf_print(
fputs("discarded operations:\n ", file); fputs("discarded operations:\n ", file);
ibuf_print_ops(ibuf->n_discarded_ops, file); ibuf_print_ops(ibuf->n_discarded_ops, file);
#ifdef UNIV_IBUF_COUNT_DEBUG
for (i = 0; i < IBUF_COUNT_N_SPACES; i++) {
for (j = 0; j < IBUF_COUNT_N_PAGES; j++) {
ulint count = ibuf_count_get(page_id_t(i, j, 0));
if (count > 0) {
fprintf(stderr,
"Ibuf count for page "
ULINTPF ":" ULINTPF ""
" is " ULINTPF "\n",
i, j, count);
}
}
}
#endif /* UNIV_IBUF_COUNT_DEBUG */
mutex_exit(&ibuf_mutex); mutex_exit(&ibuf_mutex);
} }
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2017, MariaDB Corporation. Copyright (c) 2016, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -384,13 +384,6 @@ ibuf_parse_bitmap_init( ...@@ -384,13 +384,6 @@ ibuf_parse_bitmap_init(
buf_block_t* block, /*!< in: block or NULL */ buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr); /*!< in: mtr or NULL */ mtr_t* mtr); /*!< in: mtr or NULL */
#ifdef UNIV_IBUF_COUNT_DEBUG
/** Gets the ibuf count for a given page.
@param[in] page_id page id
@return number of entries in the insert buffer currently buffered for
this page */
ulint ibuf_count_get(const page_id_t page_id);
#endif
/******************************************************************//** /******************************************************************//**
Looks if the insert buffer is empty. Looks if the insert buffer is empty.
@return true if empty */ @return true if empty */
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2018, MariaDB Corporation. Copyright (c) 2013, 2019, MariaDB Corporation.
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
...@@ -212,9 +212,6 @@ command. */ ...@@ -212,9 +212,6 @@ command. */
this will break redo log file compatibility, but it may be useful when this will break redo log file compatibility, but it may be useful when
debugging redo log application problems. */ debugging redo log application problems. */
#define UNIV_IBUF_DEBUG /* debug the insert buffer */ #define UNIV_IBUF_DEBUG /* debug the insert buffer */
#define UNIV_IBUF_COUNT_DEBUG /* debug the insert buffer;
this limits the database to IBUF_COUNT_N_SPACES and IBUF_COUNT_N_PAGES,
and the insert buffer must be empty when the database is started */
#define UNIV_PERF_DEBUG /* debug flag that enables #define UNIV_PERF_DEBUG /* debug flag that enables
light weight performance light weight performance
related stuff. */ related stuff. */
......
...@@ -1482,10 +1482,6 @@ innobase_start_or_create_for_mysql() ...@@ -1482,10 +1482,6 @@ innobase_start_or_create_for_mysql()
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
ib::info() << "!!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!"; ib::info() << "!!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!";
# ifdef UNIV_IBUF_COUNT_DEBUG
ib::info() << "!!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!";
ib::error() << "Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG";
# endif
#endif #endif
#ifdef UNIV_LOG_LSN_DEBUG #ifdef UNIV_LOG_LSN_DEBUG
......
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