summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-03-12 13:06:21 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-03-12 13:06:21 +0200
commit4a35e76f645d0e5e8554f810e16aafa734584ed7 (patch)
tree43c8253d6976ef99e305f6d6043c3bfe39ebb700
parent4a5c237c76232cdd054bca5cb4affc2b9c22b688 (diff)
downloadmariadb-git-4a35e76f645d0e5e8554f810e16aafa734584ed7.tar.gz
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 https://github.com/mysql/mysql-server/commit/068f8261d4c1e134965383ff974ddf30c0758f51 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.
-rw-r--r--storage/innobase/fts/fts0fts.cc23
-rw-r--r--storage/xtradb/fts/fts0fts.cc23
2 files changed, 10 insertions, 36 deletions
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 1d753e3657b..8ccc8afe7b4 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2017, MariaDB Corporation.
+Copyright (c) 2016, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -4627,6 +4627,7 @@ begin_sync:
ib_vector_get(cache->indexes, i));
if (index_cache->index->to_be_dropped
+ || index_cache->index->table->to_be_dropped
|| fts_sync_index_check(index_cache)) {
continue;
}
@@ -4637,17 +4638,6 @@ begin_sync:
end_sync:
if (error == DB_SUCCESS && !sync->interrupted) {
error = fts_sync_commit(sync);
- if (error == DB_SUCCESS) {
- for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
- fts_index_cache_t* index_cache;
- index_cache = static_cast<fts_index_cache_t*>(
- ib_vector_get(cache->indexes, i));
- if (index_cache->index->index_fts_syncing) {
- index_cache->index->index_fts_syncing
- = false;
- }
- }
- }
} else {
fts_sync_rollback(sync);
}
@@ -4656,12 +4646,9 @@ end_sync:
/* Clear fts syncing flags of any indexes incase sync is
interrupeted */
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
- fts_index_cache_t* index_cache;
- index_cache = static_cast<fts_index_cache_t*>(
- ib_vector_get(cache->indexes, i));
- if (index_cache->index->index_fts_syncing == true) {
- index_cache->index->index_fts_syncing = false;
- }
+ static_cast<fts_index_cache_t*>(
+ ib_vector_get(cache->indexes, i))
+ ->index->index_fts_syncing = false;
}
sync->interrupted = false;
diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc
index 8838404460f..49b1028bb5e 100644
--- a/storage/xtradb/fts/fts0fts.cc
+++ b/storage/xtradb/fts/fts0fts.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2017, MariaDB Corporation.
+Copyright (c) 2016, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -4627,6 +4627,7 @@ begin_sync:
ib_vector_get(cache->indexes, i));
if (index_cache->index->to_be_dropped
+ || index_cache->index->table->to_be_dropped
|| fts_sync_index_check(index_cache)) {
continue;
}
@@ -4637,17 +4638,6 @@ begin_sync:
end_sync:
if (error == DB_SUCCESS && !sync->interrupted) {
error = fts_sync_commit(sync);
- if (error == DB_SUCCESS) {
- for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
- fts_index_cache_t* index_cache;
- index_cache = static_cast<fts_index_cache_t*>(
- ib_vector_get(cache->indexes, i));
- if (index_cache->index->index_fts_syncing) {
- index_cache->index->index_fts_syncing
- = false;
- }
- }
- }
} else {
fts_sync_rollback(sync);
}
@@ -4656,12 +4646,9 @@ end_sync:
/* Clear fts syncing flags of any indexes incase sync is
interrupeted */
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
- fts_index_cache_t* index_cache;
- index_cache = static_cast<fts_index_cache_t*>(
- ib_vector_get(cache->indexes, i));
- if (index_cache->index->index_fts_syncing == true) {
- index_cache->index->index_fts_syncing = false;
- }
+ static_cast<fts_index_cache_t*>(
+ ib_vector_get(cache->indexes, i))
+ ->index->index_fts_syncing = false;
}
sync->interrupted = false;