mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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.
This commit is contained in:
parent
169c00994b
commit
d315b4ff39
7 changed files with 7 additions and 189 deletions
|
@ -3854,10 +3854,6 @@ got_block:
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef UNIV_IBUF_COUNT_DEBUG
|
||||
ut_a(ibuf_count_get(page_id) == 0);
|
||||
#endif /* UNIV_IBUF_COUNT_DEBUG */
|
||||
|
||||
return(bpage);
|
||||
}
|
||||
|
||||
|
@ -4631,15 +4627,9 @@ evict_from_pool:
|
|||
}
|
||||
}
|
||||
|
||||
if (!recv_no_ibuf_operations) {
|
||||
if (access_time) {
|
||||
#ifdef UNIV_IBUF_COUNT_DEBUG
|
||||
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);
|
||||
}
|
||||
if (!access_time && !recv_no_ibuf_operations) {
|
||||
ibuf_merge_or_delete_for_page(
|
||||
block, page_id, &page_size, TRUE);
|
||||
}
|
||||
|
||||
buf_pool_mutex_enter(buf_pool);
|
||||
|
@ -4843,10 +4833,6 @@ evict_from_pool:
|
|||
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,
|
||||
RW_LOCK_FLAG_X | RW_LOCK_FLAG_S));
|
||||
|
||||
|
@ -4956,10 +4942,6 @@ buf_page_optimistic_get(
|
|||
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->stat.n_page_gets++;
|
||||
|
||||
|
@ -5063,9 +5045,6 @@ buf_page_get_known_nowait(
|
|||
}
|
||||
#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++;
|
||||
|
||||
return(TRUE);
|
||||
|
@ -5152,10 +5131,6 @@ buf_page_try_get_func(
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -5554,11 +5529,6 @@ buf_page_create(
|
|||
if (block
|
||||
&& buf_page_in_file(&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);
|
||||
|
||||
/* Page can be found in buf_pool */
|
||||
|
@ -5663,9 +5633,6 @@ buf_page_create(
|
|||
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
|
||||
ut_a(++buf_dbg_counter % 5771 || buf_validate());
|
||||
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
|
||||
#ifdef UNIV_IBUF_COUNT_DEBUG
|
||||
ut_a(ibuf_count_get(block->page.id) == 0);
|
||||
#endif
|
||||
return(block);
|
||||
}
|
||||
|
||||
|
@ -6114,14 +6081,6 @@ database_corrupted:
|
|||
buf_pool_mutex_enter(buf_pool);
|
||||
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
|
||||
did the locking, we use a pass value != 0 in unlock, which simply
|
||||
removes the newest lock debug record, without checking the thread
|
||||
|
@ -6350,11 +6309,6 @@ buf_pool_validate_instance(
|
|||
buf_pool, block->page.id)
|
||||
== &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)) {
|
||||
case BUF_IO_NONE:
|
||||
break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
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
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
|
@ -1041,11 +1041,6 @@ buf_flush_write_block_low(
|
|||
ut_ad(!buf_page_get_mutex(bpage)->is_owned());
|
||||
ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_WRITE);
|
||||
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);
|
||||
|
||||
/* Force the log to the disk before writing the modified block */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
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
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -1596,10 +1596,6 @@ buf_LRU_free_page(
|
|||
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) {
|
||||
/* This would completely free the block. */
|
||||
/* Do not completely free dirty blocks. */
|
||||
|
|
|
@ -195,35 +195,6 @@ uint ibuf_debug;
|
|||
/** The insert buffer control structure */
|
||||
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 */
|
||||
/* @{ */
|
||||
#define IBUF_BITMAP_FREE 0 /*!< Bits indicating the
|
||||
|
@ -414,35 +385,6 @@ ibuf_tree_root_get(
|
|||
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. */
|
||||
void
|
||||
|
@ -736,10 +678,6 @@ ibuf_bitmap_page_set_bits(
|
|||
#endif
|
||||
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
|
||||
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())
|
||||
* IBUF_BITS_PER_PAGE + bit;
|
||||
|
@ -3503,9 +3441,6 @@ fail_exit:
|
|||
which it cannot do until we have buffered the IBUF_OP_DELETE
|
||||
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);
|
||||
bitmap_mtr.set_named_space(page_id.space());
|
||||
|
||||
|
@ -3648,17 +3583,6 @@ fail_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);
|
||||
btr_pcur_close(&pcur);
|
||||
|
||||
|
@ -4356,14 +4280,6 @@ ibuf_delete_rec(
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -4399,10 +4315,6 @@ ibuf_delete_rec(
|
|||
false, mtr);
|
||||
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);
|
||||
mutex_exit(&ibuf_mutex);
|
||||
|
||||
|
@ -4783,10 +4695,6 @@ reset_bit:
|
|||
my_atomic_addlint(&ibuf->n_merges, 1);
|
||||
ibuf_add_ops(ibuf->n_merged_ops, mops);
|
||||
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(
|
|||
/*=======*/
|
||||
FILE* file) /*!< in: file where to print */
|
||||
{
|
||||
#ifdef UNIV_IBUF_COUNT_DEBUG
|
||||
ulint i;
|
||||
ulint j;
|
||||
#endif
|
||||
|
||||
mutex_enter(&ibuf_mutex);
|
||||
|
||||
fprintf(file,
|
||||
|
@ -4926,22 +4829,6 @@ ibuf_print(
|
|||
fputs("discarded operations:\n ", 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
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
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -384,13 +384,6 @@ ibuf_parse_bitmap_init(
|
|||
buf_block_t* block, /*!< in: block 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.
|
||||
@return true if empty */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
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.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted by
|
||||
|
@ -212,9 +212,6 @@ command. */
|
|||
this will break redo log file compatibility, but it may be useful when
|
||||
debugging redo log application problems. */
|
||||
#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
|
||||
light weight performance
|
||||
related stuff. */
|
||||
|
|
|
@ -1482,10 +1482,6 @@ innobase_start_or_create_for_mysql()
|
|||
|
||||
#ifdef UNIV_IBUF_DEBUG
|
||||
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
|
||||
|
||||
#ifdef UNIV_LOG_LSN_DEBUG
|
||||
|
|
Loading…
Reference in a new issue