diff options
author | Eugene Kosov <claprix@yandex.ru> | 2019-10-02 22:47:45 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2019-10-04 16:01:18 +0300 |
commit | 0671848863340cf9fff32a0e80c8227e6845f0d7 (patch) | |
tree | 7b7183b8b34e36161f9a134ae0846ebdfa7668b1 | |
parent | 07b10c5c07471047bb32c889baf68c9be318f2aa (diff) | |
download | mariadb-git-bb-10.3-MDEV-19783-check-table.tar.gz |
add more REC_INFO_MIN_REC_FLAG checksbb-10.3-MDEV-19783-check-table
btr_cur_pessimistic_delete(): code changed in a way that allows
to put more REC_INFO_MIN_REC_FLAG assertions inside btr_set_min_rec_mark().
Without that change tests innodb.innodb-table-online,
innodb.temp_table_savepoint and innodb_zip.prefix_index_liftedlimit fail.
Removed basically duplicated page_zip_validate() calls
which fails because of temporary(!) invariant violation.
That fixed innodb_zip.wl5522_debug_zip and innodb_zip.prefix_index_liftedlimit
-rw-r--r-- | storage/innobase/btr/btr0btr.cc | 21 | ||||
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 18 | ||||
-rw-r--r-- | storage/innobase/include/btr0btr.h | 12 | ||||
-rw-r--r-- | storage/innobase/include/page0page.ic | 4 | ||||
-rw-r--r-- | storage/innobase/page/page0cur.cc | 4 | ||||
-rw-r--r-- | storage/innobase/page/page0zip.cc | 4 |
6 files changed, 27 insertions, 36 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index e0fce3fc132..0d6105f51e8 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -3314,25 +3314,22 @@ btr_parse_set_min_rec_mark( return(ptr + 2); } -/****************************************************************//** -Sets a record as the predefined minimum record. */ -void -btr_set_min_rec_mark( -/*=================*/ - rec_t* rec, /*!< in: record */ - mtr_t* mtr) /*!< in: mtr */ +/** Sets a record as the predefined minimum record. */ +void btr_set_min_rec_mark(rec_t* rec, mtr_t* mtr) { - ulint info_bits; + ut_ad(page_rec_is_infimum(page_rec_get_prev(rec))); - if (page_rec_is_comp(rec)) { - info_bits = rec_get_info_bits(rec, TRUE); + const bool comp = page_rec_is_comp(rec); + ut_ad(!(rec_get_info_bits(page_rec_get_next(rec), comp) + & REC_INFO_MIN_REC_FLAG)); + + size_t info_bits = rec_get_info_bits(rec, comp); + if (comp) { rec_set_info_bits_new(rec, info_bits | REC_INFO_MIN_REC_FLAG); btr_set_min_rec_mark_log(rec, MLOG_COMP_REC_MIN_MARK, mtr); } else { - info_bits = rec_get_info_bits(rec, FALSE); - rec_set_info_bits_old(rec, info_bits | REC_INFO_MIN_REC_FLAG); btr_set_min_rec_mark_log(rec, MLOG_REC_MIN_MARK, mtr); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 99a15662e3f..bac6515ef2b 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -5675,6 +5675,9 @@ btr_cur_pessimistic_delete( #endif /* UNIV_ZIP_DEBUG */ } + rec_t* next_rec = NULL; + bool min_mark_next_rec = false; + if (page_is_leaf(page)) { const bool is_metadata = rec_get_info_bits( rec, page_rec_is_comp(rec)) & REC_INFO_MIN_REC_FLAG; @@ -5748,20 +5751,14 @@ discard_page: goto return_after_reservations; } - rec_t* next_rec = page_rec_get_next(rec); + next_rec = page_rec_get_next(rec); if (!page_has_prev(page)) { - /* If we delete the leftmost node pointer on a non-leaf level, we must mark the new leftmost node pointer as the predefined minimum record */ - /* This will make page_zip_validate() fail until - page_cur_delete_rec() completes. This is harmless, - because everything will take place within a single - mini-transaction and because writing to the redo log - is an atomic operation (performed by mtr_commit()). */ - btr_set_min_rec_mark(next_rec, mtr); + min_mark_next_rec = true; } else if (dict_index_is_spatial(index)) { /* For rtree, if delete the leftmost node pointer, we need to update parent page. */ @@ -5829,6 +5826,11 @@ discard_page: block->page.size, mtr); page_cur_delete_rec(btr_cur_get_page_cur(cursor), index, offsets, mtr); + + if (min_mark_next_rec) { + btr_set_min_rec_mark(next_rec, mtr); + } + #ifdef UNIV_ZIP_DEBUG ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 6754fb04469..2c808d4bd06 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -520,14 +520,10 @@ btr_insert_on_non_leaf_level_func( mtr_t* mtr); /*!< in: mtr */ #define btr_insert_on_non_leaf_level(f,i,l,t,m) \ btr_insert_on_non_leaf_level_func(f,i,l,t,__FILE__,__LINE__,m) -/****************************************************************//** -Sets a record as the predefined minimum record. */ -void -btr_set_min_rec_mark( -/*=================*/ - rec_t* rec, /*!< in/out: record */ - mtr_t* mtr) /*!< in: mtr */ - MY_ATTRIBUTE((nonnull)); + +/** Sets a record as the predefined minimum record. */ +void btr_set_min_rec_mark(rec_t* rec, mtr_t* mtr) MY_ATTRIBUTE((nonnull)); + /** Seek to the parent page of a B-tree page. @param[in,out] index b-tree @param[in] block child page diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index fea74c9a15a..9785b451a06 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -659,6 +659,10 @@ page_rec_get_next_low( return(NULL); } + ut_ad(page_rec_is_infimum(rec) + || !(rec_get_info_bits(page + offs, comp) + & REC_INFO_MIN_REC_FLAG)); + return(page + offs); } diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index dd47c13d240..204fedf9d29 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -2425,10 +2425,6 @@ page_cur_delete_rec( if (cur_n_owned <= PAGE_DIR_SLOT_MIN_N_OWNED) { page_dir_balance_slot(page, page_zip, cur_slot_no); } - -#ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page, index)); -#endif /* UNIV_ZIP_DEBUG */ } #ifdef UNIV_COMPILE_TEST_FUNCS diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index c2b6695d6a5..eb38b16c2d9 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -4369,10 +4369,6 @@ page_zip_clear_rec( } else { ut_ad(!rec_offs_any_extern(offsets)); } - -#ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page, index)); -#endif /* UNIV_ZIP_DEBUG */ } /**********************************************************************//** |