diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-09-18 13:22:08 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-09-18 13:22:08 +0530 |
commit | 8a79fa0e4d0385818da056f7a4a39fde95d62fe3 (patch) | |
tree | 4dc2b3b2ea887590dfaa9d58b2cf8ea7cd8cdea0 /storage/innobase/include/fts0fts.h | |
parent | 708f1e341915b9fe2968581c60fb6a224b185af9 (diff) | |
download | mariadb-git-8a79fa0e4d0385818da056f7a4a39fde95d62fe3.tar.gz |
MDEV-19529 InnoDB hang on DROP FULLTEXT INDEX
Problem:
=======
During dropping of fts index, InnoDB waits for fts_optimize_remove_table()
and it holds dict_sys->mutex and dict_operaiton_lock even though the
table id is not present in the queue. But fts_optimize_thread does wait
for dict_sys->mutex to process the unrelated table id from the slot.
Solution:
========
Whenever table is added to fts_optimize_wq, update the fts_status
of in-memory fts subsystem to TABLE_IN_QUEUE. Whenever drop index
wants to remove table from the queue, it can check the fts_status
to decide whether it should send the MSG_DELETE_TABLE to the queue.
Removed the following functions because these are all deadcode.
dict_table_wait_for_bg_threads_to_exit(),
fts_wait_for_background_thread_to_start(),fts_start_shutdown(), fts_shudown().
Diffstat (limited to 'storage/innobase/include/fts0fts.h')
-rw-r--r-- | storage/innobase/include/fts0fts.h | 59 |
1 files changed, 9 insertions, 50 deletions
diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index a1fab659732..5c50e381f91 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -279,40 +279,21 @@ struct fts_table_t { index auxiliary table */ }; -enum fts_status { - BG_THREAD_STOP = 1, /*!< TRUE if the FTS background thread - has finished reading the ADDED table, - meaning more items can be added to - the table. */ - - BG_THREAD_READY = 2, /*!< TRUE if the FTS background thread - is ready */ - - ADD_THREAD_STARTED = 4, /*!< TRUE if the FTS add thread - has started */ - - ADDED_TABLE_SYNCED = 8, /*!< TRUE if the ADDED table record is - sync-ed after crash recovery */ - - TABLE_DICT_LOCKED = 16 /*!< Set if the table has - dict_sys->mutex */ -}; - -typedef enum fts_status fts_status_t; - /** The state of the FTS sub system. */ struct fts_t { /*!< mutex protecting bg_threads* and fts_add_wq. */ ib_mutex_t bg_threads_mutex; - ulint bg_threads; /*!< number of background threads - accessing this table */ - - /*!< TRUE if background threads running - should stop themselves */ - ulint fts_status; /*!< Status bit regarding fts - running state */ + /* Wheter the table was added to fts_optimize_wq(); + protected by bg_threads mutex */ + unsigned in_queue:1; + /* Whether the ADDED table record sync-ed after + crash recovery; protected by bg_threads mutex */ + unsigned added_synced:1; + /* Whether the table hold dict_sys->mutex; + protected by bg_threads mutex */ + unsigned dict_locked:1; ib_wqueue_t* add_wq; /*!< Work queue for scheduling jobs for the FTS 'Add' thread, or NULL @@ -615,28 +596,6 @@ fts_startup(void); /*==============*/ /******************************************************************//** -Signal FTS threads to initiate shutdown. */ -UNIV_INTERN -void -fts_start_shutdown( -/*===============*/ - dict_table_t* table, /*!< in: table with FTS - indexes */ - fts_t* fts); /*!< in: fts instance to - shutdown */ - -/******************************************************************//** -Wait for FTS threads to shutdown. */ -UNIV_INTERN -void -fts_shutdown( -/*=========*/ - dict_table_t* table, /*!< in: table with FTS - indexes */ - fts_t* fts); /*!< in: fts instance to - shutdown */ - -/******************************************************************//** Create an instance of fts_t. @return instance of fts_t */ UNIV_INTERN |