summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2016-09-15 09:42:52 +0300
committerSergei Golubchik <serg@mariadb.org>2016-09-16 09:54:30 +0200
commitf5ef5531b8df533ea9d11cd59e728e6cf9a58cf3 (patch)
tree6c7dbcf057a287f17a74c353d0a6440ae55f4858
parentc8b3244703d93a81b6c8983395f7c40e80837193 (diff)
downloadmariadb-git-f5ef5531b8df533ea9d11cd59e728e6cf9a58cf3.tar.gz
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.
-rw-r--r--storage/innobase/btr/btr0defragment.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index e4202b9bace..a62351f2954 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -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);