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

MDEV-17765 lock_discard_page() may fail to discard locks for SPATIAL INDEX

lock_discard_page(): Traverse and discard the B-tree record locks
only if they exist. Else, discard the R-tree (spatial) index locks.
parent f037b910
...@@ -3424,17 +3424,12 @@ lock_update_discard( ...@@ -3424,17 +3424,12 @@ lock_update_discard(
lock_mutex_enter(); lock_mutex_enter();
if (!lock_rec_get_first_on_page(lock_sys->rec_hash, block) if (lock_rec_get_first_on_page(lock_sys->rec_hash, block)) {
&& (!lock_rec_get_first_on_page(lock_sys->prdt_hash, block))) { ut_ad(!lock_rec_get_first_on_page(lock_sys->prdt_hash, block));
/* No locks exist on page, nothing to do */ ut_ad(!lock_rec_get_first_on_page(lock_sys->prdt_page_hash,
block));
lock_mutex_exit(); /* Inherit all the locks on the page to the record and
reset all the locks on the page */
return;
}
/* Inherit all the locks on the page to the record and reset all
the locks on the page */
if (page_is_comp(page)) { if (page_is_comp(page)) {
rec = page + PAGE_NEW_INFIMUM; rec = page + PAGE_NEW_INFIMUM;
...@@ -3445,7 +3440,8 @@ lock_update_discard( ...@@ -3445,7 +3440,8 @@ lock_update_discard(
lock_rec_inherit_to_gap(heir_block, block, lock_rec_inherit_to_gap(heir_block, block,
heir_heap_no, heap_no); heir_heap_no, heap_no);
lock_rec_reset_and_release_wait(block, heap_no); lock_rec_reset_and_release_wait(
block, heap_no);
rec = page + rec_get_next_offs(rec, TRUE); rec = page + rec_get_next_offs(rec, TRUE);
} while (heap_no != PAGE_HEAP_NO_SUPREMUM); } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
...@@ -3458,13 +3454,24 @@ lock_update_discard( ...@@ -3458,13 +3454,24 @@ lock_update_discard(
lock_rec_inherit_to_gap(heir_block, block, lock_rec_inherit_to_gap(heir_block, block,
heir_heap_no, heap_no); heir_heap_no, heap_no);
lock_rec_reset_and_release_wait(block, heap_no); lock_rec_reset_and_release_wait(
block, heap_no);
rec = page + rec_get_next_offs(rec, FALSE); rec = page + rec_get_next_offs(rec, FALSE);
} while (heap_no != PAGE_HEAP_NO_SUPREMUM); } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
} }
lock_rec_free_all_from_discard_page(block); lock_rec_free_all_from_discard_page_low(
block->page.id.space(), block->page.id.page_no(),
lock_sys->rec_hash);
} else {
lock_rec_free_all_from_discard_page_low(
block->page.id.space(), block->page.id.page_no(),
lock_sys->prdt_hash);
lock_rec_free_all_from_discard_page_low(
block->page.id.space(), block->page.id.page_no(),
lock_sys->prdt_page_hash);
}
lock_mutex_exit(); lock_mutex_exit();
} }
......
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