Skip to content

Commit

Permalink
MDEV-29590 Deadlock between ibuf_insert_to_index_page_low() and DDL
Browse files Browse the repository at this point in the history
btr_page_reorganize_low(): Do not invoke lock_move_reorganize_page()
on a dummy index during change buffer merge. The ibuf.index page
latch that we are holding may block a DDL operation that is waiting
in ibuf_delete_for_discarded_space() while holding exclusive
lock_sys.latch. ibuf_insert_low() would refuse to buffer a change
if any locks exist for the index page.
  • Loading branch information
dr-m committed Oct 6, 2022
1 parent 8872d2e commit 3e9e377
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage/innobase/btr/btr0btr.cc
Expand Up @@ -1410,7 +1410,10 @@ static dberr_t btr_page_reorganize_low(page_cur_t *cursor, dict_index_t *index,
block->page.frame + PAGE_MAX_TRX_ID + PAGE_HEADER,
PAGE_DATA - (PAGE_MAX_TRX_ID + PAGE_HEADER)));

if (index->has_locking())
if (!index->has_locking());
else if (index->page == FIL_NULL)
ut_ad(index->is_dummy);
else
lock_move_reorganize_page(block, old);

/* Write log for the changes, if needed. */
Expand Down

0 comments on commit 3e9e377

Please sign in to comment.