Skip to content

Commit 4a35e76

Browse files
committed
MDEV-14773 DROP TABLE hangs for InnoDB table with FULLTEXT index
fts_sync(): If the dict_table_t::to_be_dropped flag is set, do not "goto begin_sync". Also, clean up the way how dict_index_t::index_fts_syncing is cleared. It looks like this regression was introduced by merging Oracle Bug #24938374 MYSQL CRASHED AFTER LONG WAIT ON DICT OPERATION LOCK WHILE SYNCING FTS INDEX mysql/mysql-server@068f826 from MySQL 5.6.38 into MariaDB 10.0.33, 10.1.29, 10.2.10. The same hang is present in MySQL 5.7.20.
1 parent 4a5c237 commit 4a35e76

File tree

2 files changed

+10
-36
lines changed

2 files changed

+10
-36
lines changed

storage/innobase/fts/fts0fts.cc

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2016, 2017, MariaDB Corporation.
4+
Copyright (c) 2016, 2018, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -4627,6 +4627,7 @@ fts_sync(
46274627
ib_vector_get(cache->indexes, i));
46284628

46294629
if (index_cache->index->to_be_dropped
4630+
|| index_cache->index->table->to_be_dropped
46304631
|| fts_sync_index_check(index_cache)) {
46314632
continue;
46324633
}
@@ -4637,17 +4638,6 @@ fts_sync(
46374638
end_sync:
46384639
if (error == DB_SUCCESS && !sync->interrupted) {
46394640
error = fts_sync_commit(sync);
4640-
if (error == DB_SUCCESS) {
4641-
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
4642-
fts_index_cache_t* index_cache;
4643-
index_cache = static_cast<fts_index_cache_t*>(
4644-
ib_vector_get(cache->indexes, i));
4645-
if (index_cache->index->index_fts_syncing) {
4646-
index_cache->index->index_fts_syncing
4647-
= false;
4648-
}
4649-
}
4650-
}
46514641
} else {
46524642
fts_sync_rollback(sync);
46534643
}
@@ -4656,12 +4646,9 @@ fts_sync(
46564646
/* Clear fts syncing flags of any indexes incase sync is
46574647
interrupeted */
46584648
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
4659-
fts_index_cache_t* index_cache;
4660-
index_cache = static_cast<fts_index_cache_t*>(
4661-
ib_vector_get(cache->indexes, i));
4662-
if (index_cache->index->index_fts_syncing == true) {
4663-
index_cache->index->index_fts_syncing = false;
4664-
}
4649+
static_cast<fts_index_cache_t*>(
4650+
ib_vector_get(cache->indexes, i))
4651+
->index->index_fts_syncing = false;
46654652
}
46664653

46674654
sync->interrupted = false;

storage/xtradb/fts/fts0fts.cc

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2016, 2017, MariaDB Corporation.
4+
Copyright (c) 2016, 2018, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -4627,6 +4627,7 @@ fts_sync(
46274627
ib_vector_get(cache->indexes, i));
46284628

46294629
if (index_cache->index->to_be_dropped
4630+
|| index_cache->index->table->to_be_dropped
46304631
|| fts_sync_index_check(index_cache)) {
46314632
continue;
46324633
}
@@ -4637,17 +4638,6 @@ fts_sync(
46374638
end_sync:
46384639
if (error == DB_SUCCESS && !sync->interrupted) {
46394640
error = fts_sync_commit(sync);
4640-
if (error == DB_SUCCESS) {
4641-
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
4642-
fts_index_cache_t* index_cache;
4643-
index_cache = static_cast<fts_index_cache_t*>(
4644-
ib_vector_get(cache->indexes, i));
4645-
if (index_cache->index->index_fts_syncing) {
4646-
index_cache->index->index_fts_syncing
4647-
= false;
4648-
}
4649-
}
4650-
}
46514641
} else {
46524642
fts_sync_rollback(sync);
46534643
}
@@ -4656,12 +4646,9 @@ fts_sync(
46564646
/* Clear fts syncing flags of any indexes incase sync is
46574647
interrupeted */
46584648
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
4659-
fts_index_cache_t* index_cache;
4660-
index_cache = static_cast<fts_index_cache_t*>(
4661-
ib_vector_get(cache->indexes, i));
4662-
if (index_cache->index->index_fts_syncing == true) {
4663-
index_cache->index->index_fts_syncing = false;
4664-
}
4649+
static_cast<fts_index_cache_t*>(
4650+
ib_vector_get(cache->indexes, i))
4651+
->index->index_fts_syncing = false;
46654652
}
46664653

46674654
sync->interrupted = false;

0 commit comments

Comments
 (0)