Commit 26e4403f authored by Jan Lindström's avatar Jan Lindström

MDEV-8819: Failing assertion: block->page.space ==...

MDEV-8819: Failing assertion: block->page.space == page_get_space_id(page_align(ptr)) in file buf0buf.cc line 2551

Add error handling on page reading and do not try to access empty pages.
parent 9554342d
......@@ -905,7 +905,7 @@ buf_page_print(
mach_read_from_4(read_buf
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID));
ulint page_type = mach_read_from_4(read_buf + FIL_PAGE_TYPE);
ulint page_type = fil_page_get_type(read_buf);
fprintf(stderr, "InnoDB: page type %ld meaning %s\n", page_type,
fil_get_page_type_name(page_type));
......
......@@ -851,12 +851,18 @@ ibuf_bitmap_get_map_page_func(
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
buf_block_t* block;
buf_block_t* block = NULL;
dberr_t err = DB_SUCCESS;
block = buf_page_get_gen(space, zip_size,
ibuf_bitmap_page_no_calc(zip_size, page_no),
RW_X_LATCH, NULL, BUF_GET,
file, line, mtr);
file, line, mtr, &err);
if (err != DB_SUCCESS) {
return NULL;
}
buf_block_dbg_add_level(block, SYNC_IBUF_BITMAP);
return(buf_block_get_frame(block));
......@@ -4631,16 +4637,20 @@ ibuf_merge_or_delete_for_page(
block = NULL;
update_ibuf_bitmap = FALSE;
} else {
page_t* bitmap_page;
ulint bitmap_bits;
page_t* bitmap_page = NULL;
ulint bitmap_bits = 0;
ibuf_mtr_start(&mtr);
bitmap_page = ibuf_bitmap_get_map_page(
space, page_no, zip_size, &mtr);
bitmap_bits = ibuf_bitmap_page_get_bits(
bitmap_page, page_no, zip_size,
IBUF_BITMAP_BUFFERED, &mtr);
if (bitmap_page &&
fil_page_get_type(bitmap_page) != FIL_PAGE_TYPE_ALLOCATED) {
bitmap_bits = ibuf_bitmap_page_get_bits(
bitmap_page, page_no, zip_size,
IBUF_BITMAP_BUFFERED, &mtr);
}
ibuf_mtr_commit(&mtr);
......
......@@ -981,7 +981,7 @@ buf_page_print(
mach_read_from_4(read_buf
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID));
ulint page_type = mach_read_from_4(read_buf + FIL_PAGE_TYPE);
ulint page_type = fil_page_get_type(read_buf);
fprintf(stderr, "InnoDB: page type %ld meaning %s\n", page_type,
fil_get_page_type_name(page_type));
......
......@@ -892,12 +892,18 @@ ibuf_bitmap_get_map_page_func(
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
buf_block_t* block;
buf_block_t* block = NULL;
dberr_t err = DB_SUCCESS;
block = buf_page_get_gen(space, zip_size,
ibuf_bitmap_page_no_calc(zip_size, page_no),
RW_X_LATCH, NULL, BUF_GET,
file, line, mtr);
file, line, mtr, &err);
if (err != DB_SUCCESS) {
return NULL;
}
buf_block_dbg_add_level(block, SYNC_IBUF_BITMAP);
return(buf_block_get_frame(block));
......@@ -4674,16 +4680,20 @@ ibuf_merge_or_delete_for_page(
block = NULL;
update_ibuf_bitmap = FALSE;
} else {
page_t* bitmap_page;
ulint bitmap_bits;
page_t* bitmap_page = NULL;
ulint bitmap_bits = 0;
ibuf_mtr_start(&mtr);
bitmap_page = ibuf_bitmap_get_map_page(
space, page_no, zip_size, &mtr);
bitmap_bits = ibuf_bitmap_page_get_bits(
bitmap_page, page_no, zip_size,
IBUF_BITMAP_BUFFERED, &mtr);
if (bitmap_page &&
fil_page_get_type(bitmap_page) != FIL_PAGE_TYPE_ALLOCATED) {
bitmap_bits = ibuf_bitmap_page_get_bits(
bitmap_page, page_no, zip_size,
IBUF_BITMAP_BUFFERED, &mtr);
}
ibuf_mtr_commit(&mtr);
......
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