diff options
author | heikki@hundin.mysql.fi <> | 2003-02-21 23:11:31 +0200 |
---|---|---|
committer | heikki@hundin.mysql.fi <> | 2003-02-21 23:11:31 +0200 |
commit | 5e7796c070ab93e76206f39a85906729255e03a4 (patch) | |
tree | 2ae611ca451f91fbc0d2ad9735a84f677d7e5e8a /innobase/ibuf | |
parent | 9d633d9a923ebf0a542059ddf3412c050689b97d (diff) | |
download | mariadb-git-5e7796c070ab93e76206f39a85906729255e03a4.tar.gz |
ibuf0ibuf.c:
Add diagnostic prints if insert buffer merge is tried to a page whose type is not an index page, try to recover from the situation by discarding the insert buffer records
Diffstat (limited to 'innobase/ibuf')
-rw-r--r-- | innobase/ibuf/ibuf0ibuf.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index 2cbffadf6a9..9774ffaf589 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -2483,7 +2483,9 @@ ibuf_merge_or_delete_for_page( ulint old_bits; ulint new_bits; dulint max_trx_id; + ibool corruption_noticed = FALSE; mtr_t mtr; + char err_buf[500]; if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { @@ -2535,7 +2537,38 @@ ibuf_merge_or_delete_for_page( block = buf_block_align(page); rw_lock_x_lock_move_ownership(&(block->lock)); - ut_a(fil_page_get_type(page) == FIL_PAGE_INDEX); + if (fil_page_get_type(page) != FIL_PAGE_INDEX) { + + corruption_noticed = TRUE; + + ut_print_timestamp(stderr); + + mtr_start(&mtr); + + fprintf(stderr, +" InnoDB: Dump of the ibuf bitmap page:\n"); + + bitmap_page = ibuf_bitmap_get_map_page(space, page_no, + &mtr); + buf_page_print(bitmap_page); + + mtr_commit(&mtr); + + fprintf(stderr, "\nInnoDB: Dump of the page:\n"); + + buf_page_print(page); + + fprintf(stderr, +"InnoDB: Error: corruption in the tablespace. Bitmap shows insert\n" +"InnoDB: buffer records to page n:o %lu though the page\n" +"InnoDB: type is %lu, which is not an index page!\n" +"InnoDB: We try to resolve the problem by skipping the insert buffer\n" +"InnoDB: merge for this page. Please run CHECK TABLE on your tables\n" +"InnoDB: to determine if they are corrupt after this.\n\n" +"InnoDB: Please make a detailed bug report and send it to\n" +"InnoDB: mysql@lists.mysql.com\n\n", + page_no, fil_page_get_type(page)); + } } n_inserts = 0; @@ -2578,8 +2611,14 @@ loop: goto reset_bit; } + + if (corruption_noticed) { + rec_sprintf(err_buf, 450, ibuf_rec); + + fprintf(stderr, +"InnoDB: Discarding record\n %s\n from the insert buffer!\n\n", err_buf); - if (page) { + } else if (page) { /* Now we have at pcur a record which should be inserted to the index page; NOTE that the call below copies pointers to fields in ibuf_rec, and we must |