summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-09-30 18:02:29 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-09-30 18:02:29 +0530
commitd6b33ea237c620923a7d4458a5907be0738c821d (patch)
tree0e8d99e67c5a21cc9416b68b151cf499ed067b99
parentcd5f4d2a5939aa047734f023b28462c65f3e4569 (diff)
downloadmariadb-git-d6b33ea237c620923a7d4458a5907be0738c821d.tar.gz
MDEV-23856 fts_optimize_wq accessed after shutdown of FTS Optimize thread
In fts_optimize_remove_table(), InnoDB tries to access the fts_optimize_wq after shutting down the fts optimize thread. This issue caused by the commit a41d429765c7ddb528b9b438c68b25ff55d3bd55. Fix should check for fts optimize thread shutdown state before checking fts_optimize_wq.
-rw-r--r--storage/innobase/fts/fts0opt.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index 39720b07bd1..8ad1cf4ebe1 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -2603,9 +2603,13 @@ fts_optimize_remove_table(
os_event_destroy(event);
- ut_d(mutex_enter(&fts_optimize_wq->mutex));
- ut_ad(!table->fts->in_queue);
- ut_d(mutex_exit(&fts_optimize_wq->mutex));
+#ifdef UNIV_DEBUG
+ if (!fts_opt_start_shutdown) {
+ mutex_enter(&fts_optimize_wq->mutex);
+ ut_ad(!table->fts->in_queue);
+ mutex_exit(&fts_optimize_wq->mutex);
+ }
+#endif /* UNIV_DEBUG */
}
/** Send sync fts cache for the table.