Commit f5ef5531 authored by Jan Lindström's avatar Jan Lindström Committed by Sergei Golubchik

Fixed mutex deadlock found with innodb.innodb-defrag-concurrent

test. We should not take X-lock for index in the begining, setting
tablespace as named space is enough.
parent c8b32447
......@@ -611,8 +611,6 @@ btr_defragment_n_pages(
/* It doesn't make sense to call this function with n_pages = 1. */
ut_ad(n_pages > 1);
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
space = dict_index_get_space(index);
if (space == 0) {
/* Ignore space 0. */
......@@ -801,9 +799,8 @@ DECLARE_THREAD(btr_defragment_thread)(
cursor = btr_pcur_get_btr_cur(pcur);
index = btr_cur_get_index(cursor);
first_block = btr_cur_get_block(cursor);
mtr_x_lock(dict_index_get_lock(index), &mtr);
mtr.set_named_space(index->space);
last_block = btr_defragment_n_pages(first_block, index,
srv_defragment_n_pages,
&mtr);
......
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