[Commits] 7551031: Fixed mutex deadlock found with innodb.innodb-defrag-concurrent

Jan Lindström jan.lindstrom at mariadb.com
Thu Sep 15 09:43:57 EEST 2016


revision-id: 7551031ed8ce7e87977b58b1f8c3da031e59c448 (mariadb-10.2.1-23-g7551031)
parent(s): 3b95fbb5422fdbfadceb2387b8f16ed57be4cf99
committer: Jan Lindström
timestamp: 2016-09-15 09:42:52 +0300
message:

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.

---
 storage/innobase/btr/btr0defragment.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index e4202b9..a62351f 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);


More information about the commits mailing list