mirror of
https://github.com/MariaDB/server.git
synced 2025-08-30 11:22:14 +03:00
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().
27 lines
1.0 KiB
Plaintext
27 lines
1.0 KiB
Plaintext
CREATE TABLE t1(a VARCHAR(5),FULLTEXT KEY(a)) ENGINE=InnoDB;
|
|
SET DEBUG_SYNC = 'get_next_FTS_DOC_ID SIGNAL prepared WAIT_FOR race';
|
|
REPLACE INTO t1(a) values('aaa');
|
|
SET DEBUG_SYNC = 'now WAIT_FOR prepared';
|
|
REPLACE INTO t1(a) VALUES('aaa');
|
|
SET DEBUG_SYNC = 'now SIGNAL race';
|
|
SET DEBUG_SYNC = 'RESET';
|
|
DROP TABLE t1;
|
|
#
|
|
# MDEV-19529 InnoDB hang on DROP FULLTEXT INDEX
|
|
#
|
|
CREATE TABLE t1(f1 CHAR(100), FULLTEXT(f1))ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES('test');
|
|
CREATE TABLE t2 (f1 char(100), FULLTEXT idx1(f1))ENGINE=InnoDB;
|
|
INSERT INTO t2 VALUES('mariadb');
|
|
SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang';
|
|
SET DEBUG_SYNC= 'fts_instrument_sync_request
|
|
SIGNAL drop_index_start WAIT_FOR sync_op';
|
|
INSERT INTO t1 VALUES('Keyword');
|
|
SET DEBUG_SYNC='now WAIT_FOR drop_index_start';
|
|
SET DEBUG_SYNC= 'norebuild_fts_drop SIGNAL sync_op WAIT_FOR fts_drop_index';
|
|
ALTER TABLE t2 drop index idx1;
|
|
set DEBUG_SYNC= 'now SIGNAL fts_drop_index';
|
|
SET global DEBUG_DBUG=RESET;
|
|
drop table t1, t2;
|
|
set DEBUG_SYNC=RESET;
|