Skip to content

Commit

Permalink
MDEV-25018 [FATAL] InnoDB: Unable to read page (of a dropped tablespace)
Browse files Browse the repository at this point in the history
- This issue is caused by commit deadec4
(MDEV-24569). InnoDB fails to read the change buffer bitmap page
from dropped tablespace. In ibuf_bitmap_get_map_page_func(), InnoDB
should fetch the page using BUF_GET_POSSIBLY_FREED mode. Callers of
ibuf_bitmap_get_map_page() should be adjusted in that case.
  • Loading branch information
Thirunarayanan committed Mar 3, 2021
1 parent 4b166ca commit aa4f76b
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions storage/innobase/ibuf/ibuf0ibuf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -688,19 +688,15 @@ ibuf_bitmap_get_map_page_func(
unsigned line,
mtr_t* mtr)
{
buf_block_t* block = NULL;
dberr_t err = DB_SUCCESS;

block = buf_page_get_gen(
buf_block_t* block = buf_page_get_gen(
ibuf_bitmap_page_no_calc(page_id, zip_size),
zip_size, RW_X_LATCH, NULL, BUF_GET, file, line, mtr, &err);
zip_size, RW_X_LATCH, NULL, BUF_GET_POSSIBLY_FREED,
file, line, mtr);

if (err != DB_SUCCESS) {
return NULL;
if (block) {
buf_block_dbg_add_level(block, SYNC_IBUF_BITMAP);
}


buf_block_dbg_add_level(block, SYNC_IBUF_BITMAP);
return block;
}

Expand Down Expand Up @@ -741,9 +737,12 @@ ibuf_set_free_bits_low(
#endif /* UNIV_IBUF_DEBUG */
const page_id_t id(block->page.id());

ibuf_bitmap_page_set_bits<IBUF_BITMAP_FREE>(
ibuf_bitmap_get_map_page(id, block->zip_size(), mtr),
id, block->physical_size(), val, mtr);
if (buf_block_t* bitmap_page = ibuf_bitmap_get_map_page(
id, block->zip_size(), mtr)) {
ibuf_bitmap_page_set_bits<IBUF_BITMAP_FREE>(
bitmap_page, id, block->physical_size(),
val, mtr);
}
}

/************************************************************************//**
Expand Down Expand Up @@ -887,10 +886,13 @@ ibuf_update_free_bits_zip(
buf_page_make_young(&block->page);
}

ibuf_bitmap_page_set_bits<IBUF_BITMAP_FREE>(
ibuf_bitmap_get_map_page(block->page.id(), block->zip_size(),
mtr),
block->page.id(), block->physical_size(), after, mtr);
if (buf_block_t* bitmap_page = ibuf_bitmap_get_map_page(
block->page.id(), block->zip_size(), mtr)) {

ibuf_bitmap_page_set_bits<IBUF_BITMAP_FREE>(
bitmap_page, block->page.id(),
block->physical_size(), after, mtr);
}
}

/**********************************************************************//**
Expand Down Expand Up @@ -3669,14 +3671,15 @@ ibuf_insert_to_index_page_low(
"InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
"InnoDB: that table.\n", stderr);

ib::error() << "page " << block->page.id() << ", size "
<< block->physical_size() << ", bitmap bits "
<< ibuf_bitmap_page_get_bits(
ibuf_bitmap_get_map_page(block->page.id(),
block->zip_size(),
mtr)->frame,
block->page.id(), block->zip_size(),
IBUF_BITMAP_FREE, mtr);
if (buf_block_t *bitmap_page = ibuf_bitmap_get_map_page(
block->page.id(), block->zip_size(), mtr)) {

ib::error() << "page " << block->page.id() << ", size "
<< block->physical_size() << ", bitmap bits "
<< ibuf_bitmap_page_get_bits(bitmap_page->frame,
block->page.id(), block->zip_size(),
IBUF_BITMAP_FREE, mtr);
}

ib::error() << BUG_REPORT_MSG;

Expand Down

0 comments on commit aa4f76b

Please sign in to comment.