Skip to content
Permalink
Browse files
MDEV-21152 Bogus debug assertion btr_pcur_is_after_last_in_tree() in …
…ibuf code

As noted in commit abd45cd
a search with PAGE_CUR_GE may land on the supremum record on
a leaf page that is not the rightmost leaf page. This could occur
when all keys on the current page are smaller than the search key,
and the smallest key on the successor page is larger than the search key.

Hence, after a failed PAGE_CUR_GE search, assertions
btr_pcur_is_after_last_in_tree() are bogus
and should be replaced with btr_pcur_is_after_last_on_page().
  • Loading branch information
dr-m committed Nov 26, 2019
1 parent a35427f commit dc75f3e
Showing 1 changed file with 3 additions and 3 deletions.
@@ -2434,7 +2434,7 @@ static void ibuf_read_merge_pages(const ulint* space_ids,
btr_pcur_open(ibuf.index, tuple, PAGE_CUR_GE, BTR_MODIFY_LEAF,
&pcur, &mtr);
if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto done;
}

@@ -4480,7 +4480,7 @@ ibuf_merge_or_delete_for_page(
}

if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto reset_bit;
}

@@ -4707,7 +4707,7 @@ void ibuf_delete_for_discarded_space(ulint space)
&pcur, &mtr);

if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto leave_loop;
}

0 comments on commit dc75f3e

Please sign in to comment.