Commit ad46ce65 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14055 Assertion `page_rec_is_leaf(rec)' failed in lock_rec_validate_page

This was a false alarm in a debug check that was introduced in
commit 48192f96 which was a
10.2 code refactoring in preparation for
MDEV-11369 (instant ADD COLUMN) in 10.3.2. The code refactoring
only affected debug builds.

InnoDB B-tree record locks are only supposed to exist on leaf page
records. An assertion failed, because the debug function lock_validate()
was invoking lock_rec_block_validate() on a page for which there were
no locks set in the record lock bitmap. This could happen on a page split.
Especially when the index size grows from a single page to multiple pages,
the root page would transform from a leaf node into an internal node,
and its record lock bitmap would be emptied.

lock_validate(): Skip empty lock bitmaps.
parent bcd1a08e
......@@ -6614,15 +6614,15 @@ lock_validate()
Release both mutexes during the validation check. */
for (ulint i = 0; i < hash_get_n_cells(lock_sys->rec_hash); i++) {
const lock_t* lock;
ib_uint64_t limit = 0;
while ((lock = lock_rec_validate(i, &limit)) != 0) {
ulint space = lock->un_member.rec_lock.space;
ulint page_no = lock->un_member.rec_lock.page_no;
pages.insert(std::make_pair(space, page_no));
while (const lock_t* lock = lock_rec_validate(i, &limit)) {
if (lock_rec_find_set_bit(lock) == ULINT_UNDEFINED) {
/* The lock bitmap is empty; ignore it. */
continue;
}
const lock_rec_t& l = lock->un_member.rec_lock;
pages.insert(std::make_pair(l.space, l.page_no));
}
}
......
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