[MDEV-19647] Server hangs after dropping full text indexes and restart Created: 2019-05-30  Updated: 2019-09-18  Resolved: 2019-09-18

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Full-text Search, Storage Engine - InnoDB
Affects Version/s: 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.2.28, 10.1.42, 10.3.19, 10.4.9

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: None

Attachments: File mdev-19647_deb9121fdf2152752346c767321e6e01aa5d6c69_10.1v1.patch    
Issue Links:
Relates
relates to MDEV-18654 Failing assertion: sym_node->table !=... Closed
relates to MDEV-19529 InnoDB hang on DROP FULLTEXT INDEX Closed

 Description   

--source include/have_innodb.inc
 
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, a TEXT) ENGINE=InnoDB;
ALTER TABLE t1 DROP a;
--source include/restart_mysqld.inc
SHOW CREATE TABLE t1;
 
# Cleanup
DROP TABLE t1;

Notes:

  • SHOW CREATE TABLE is not important, initially it was CHECK, same failure;
  • `a` being the only column is not important, fails as well with an extra column present;
  • presence/absence of FULLTEXT index on a in table definition is not important;
  • not reproducible on 5.5.

10.4 debug fails on assertion:

10.4 7d3a759d

mysqld: /data/src/10.4/storage/innobase/include/dict0dict.h:1604: void dict_sys_t::prevent_eviction(dict_table_t*): Assertion `find(table)' failed.
190530 17:54:34 [ERROR] mysqld got signal 6 ;
 
#6  0x00007fd790dcae67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55663b5ed0ec "find(table)", file=file@entry=0x55663b5ed0b8 "/data/src/10.4/storage/innobase/include/dict0dict.h", line=line@entry=1604, function=function@entry=0x55663b5f3280 <dict_sys_t::prevent_eviction(dict_table_t*)::__PRETTY_FUNCTION__> "void dict_sys_t::prevent_eviction(dict_table_t*)") at assert.c:92
#7  0x00007fd790dcaf12 in __GI___assert_fail (assertion=0x55663b5ed0ec "find(table)", file=0x55663b5ed0b8 "/data/src/10.4/storage/innobase/include/dict0dict.h", line=1604, function=0x55663b5f3280 <dict_sys_t::prevent_eviction(dict_table_t*)::__PRETTY_FUNCTION__> "void dict_sys_t::prevent_eviction(dict_table_t*)") at assert.c:101
#8  0x000055663ae61a39 in dict_sys_t::prevent_eviction (this=0x55663be27fe0 <dict_sys>, table=0x7fd73802c1c8) at /data/src/10.4/storage/innobase/include/dict0dict.h:1604
#9  0x000055663b05bee2 in fts_optimize_add_table (table=0x7fd73802c1c8) at /data/src/10.4/storage/innobase/fts/fts0opt.cc:2546
#10 0x000055663afe63ef in dict_load_columns (table=0x7fd73802c1c8, heap=0x7fd7380381c0) at /data/src/10.4/storage/innobase/dict/dict0load.cc:1853
#11 0x000055663afe9c35 in dict_load_table_one (name=..., cached=true, ignore_err=DICT_ERR_IGNORE_NONE, fk_tables=std::deque with 0 elements) at /data/src/10.4/storage/innobase/dict/dict0load.cc:2950
#12 0x000055663afe8fdf in dict_load_table (name=0x7fd786188a20 "test/t1", cached=true, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.4/storage/innobase/dict/dict0load.cc:2756
#13 0x000055663afcc066 in dict_table_open_on_name (table_name=0x7fd786188a20 "test/t1", dict_locked=0, try_drop=1, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.4/storage/innobase/dict/dict0dict.cc:1096
#14 0x000055663acec18e in ha_innobase::open_dict_table (norm_name=0x7fd786188a20 "test/t1", is_partition=false, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:6430
#15 0x000055663aceb1ff in ha_innobase::open (this=0x7fd73802b888, name=0x7fd738028350 "./test/t1") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:6132
#16 0x000055663aac3877 in handler::ha_open (this=0x7fd73802b888, table_arg=0x7fd73802a5c0, name=0x7fd738028350 "./test/t1", mode=2, test_if_locked=18, mem_root=0x0, partitions_to_open=0x0) at /data/src/10.4/sql/handler.cc:2728
#17 0x000055663a8a67b8 in open_table_from_share (thd=0x7fd738000b00, share=0x7fd738027dc8, alias=0x7fd738015508, db_stat=33, prgflag=8, ha_open_flags=18, outparam=0x7fd73802a5c0, is_create_table=false, partitions_to_open=0x0) at /data/src/10.4/sql/table.cc:3894
#18 0x000055663a6e7ebe in open_table (thd=0x7fd738000b00, table_list=0x7fd7380154c0, ot_ctx=0x7fd786189270) at /data/src/10.4/sql/sql_base.cc:2047
#19 0x000055663a6eb3ad in open_and_process_table (thd=0x7fd738000b00, tables=0x7fd7380154c0, counter=0x7fd78618939c, flags=1024, prelocking_strategy=0x7fd786189348, has_prelocking_list=false, ot_ctx=0x7fd786189270) at /data/src/10.4/sql/sql_base.cc:3802
#20 0x000055663a6ec741 in open_tables (thd=0x7fd738000b00, options=..., start=0x7fd786189380, counter=0x7fd78618939c, sroutine_to_open_list=0x7fd7380049f8, flags=1024, prelocking_strategy=0x7fd786189348) at /data/src/10.4/sql/sql_base.cc:4303
#21 0x000055663a6b4994 in open_tables (thd=0x7fd738000b00, options=..., tables=0x7fd786189380, counter=0x7fd78618939c, flags=1024, prelocking_strategy=0x7fd786189348) at /data/src/10.4/sql/sql_base.h:260
#22 0x000055663a6dc22a in open_tables (thd=0x7fd738000b00, tables=0x7fd786189380, counter=0x7fd78618939c, flags=1024) at /data/src/10.4/sql/sql_base.h:482
#23 0x000055663a823614 in mysqld_show_create_get_fields (thd=0x7fd738000b00, table_list=0x7fd7380154c0, field_list=0x7fd786189660, buffer=0x7fd786189680) at /data/src/10.4/sql/sql_show.cc:1304
#24 0x000055663a823db3 in mysqld_show_create (thd=0x7fd738000b00, table_list=0x7fd7380154c0) at /data/src/10.4/sql/sql_show.cc:1410
#25 0x000055663a787b21 in mysql_execute_command (thd=0x7fd738000b00) at /data/src/10.4/sql/sql_parse.cc:4596
#26 0x000055663a7945a7 in mysql_parse (thd=0x7fd738000b00, rawbuf=0x7fd7380153e8 "SHOW CREATE TABLE t1", length=20, parser_state=0x7fd78618b180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8157
#27 0x000055663a77fc83 in dispatch_command (command=COM_QUERY, thd=0x7fd738000b00, packet=0x7fd738008311 "SHOW CREATE TABLE t1", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1829
#28 0x000055663a77e441 in do_command (thd=0x7fd738000b00) at /data/src/10.4/sql/sql_parse.cc:1362
#29 0x000055663a8f6411 in do_handle_one_connection (connect=0x55663e36d6c0) at /data/src/10.4/sql/sql_connect.cc:1403
#30 0x000055663a8f6175 in handle_one_connection (arg=0x55663e36d6c0) at /data/src/10.4/sql/sql_connect.cc:1306
#31 0x000055663b21e6ab in pfs_spawn_thread (arg=0x55663e2eba10) at /data/src/10.4/storage/perfschema/pfs.cc:1862
#32 0x00007fd79293f4a4 in start_thread (arg=0x7fd78618c700) at pthread_create.c:456
#33 0x00007fd790e87d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

10.4 non-debug and 10.1-10.3 debug hang instead:

10.3 617d34ae

#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x000056069020c16e in os_event::wait (this=0x7f9980140b00) at /data/src/10.3/storage/innobase/os/os0event.cc:159
#2  0x000056069020bc02 in os_event::wait_low (this=0x7f9980140b00, reset_sig_count=1) at /data/src/10.3/storage/innobase/os/os0event.cc:326
#3  0x000056069020bf58 in os_event_wait_low (event=0x7f9980140b00, reset_sig_count=0) at /data/src/10.3/storage/innobase/os/os0event.cc:515
#4  0x00005606904aaf00 in fts_optimize_remove_table (table=0x7f998013fe38) at /data/src/10.3/storage/innobase/fts/fts0opt.cc:2591
#5  0x0000560690437cdc in dict_load_table_one (name=..., cached=true, ignore_err=DICT_ERR_IGNORE_NONE, fk_tables=std::deque with 0 elements) at /data/src/10.3/storage/innobase/dict/dict0load.cc:3100
#6  0x00005606904368c0 in dict_load_table (name=0x7f99d4c64180 "test/t1", cached=true, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.3/storage/innobase/dict/dict0load.cc:2758
#7  0x00005606904182e4 in dict_table_open_on_name (table_name=0x7f99d4c64180 "test/t1", dict_locked=0, try_drop=1, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.3/storage/innobase/dict/dict0dict.cc:1159
#8  0x0000560690138ade in ha_innobase::open_dict_table (norm_name=0x7f99d4c64180 "test/t1", is_partition=false, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:6405
#9  0x0000560690137b69 in ha_innobase::open (this=0x7f998013f588, name=0x7f99801433a0 "./test/t1") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:6113
#10 0x000056068ff2cc35 in handler::ha_open (this=0x7f998013f588, table_arg=0x7f998013e940, name=0x7f99801433a0 "./test/t1", mode=2, test_if_locked=18, mem_root=0x0, partitions_to_open=0x0) at /data/src/10.3/sql/handler.cc:2734
#11 0x000056068fd41eef in open_table_from_share (thd=0x7f9980000b00, share=0x7f9980142e68, alias=0x7f9980014a28, db_stat=33, prgflag=8, ha_open_flags=18, outparam=0x7f998013e940, is_create_table=false, partitions_to_open=0x0) at /data/src/10.3/sql/table.cc:3495
#12 0x000056068fb9d74c in open_table (thd=0x7f9980000b00, table_list=0x7f99800149e0, ot_ctx=0x7f99d4c649e0) at /data/src/10.3/sql/sql_base.cc:1979
#13 0x000056068fba09a5 in open_and_process_table (thd=0x7f9980000b00, tables=0x7f99800149e0, counter=0x7f99d4c64b0c, flags=1024, prelocking_strategy=0x7f99d4c64ab8, has_prelocking_list=false, ot_ctx=0x7f99d4c649e0) at /data/src/10.3/sql/sql_base.cc:3666
#14 0x000056068fba1b0d in open_tables (thd=0x7f9980000b00, options=..., start=0x7f99d4c64af0, counter=0x7f99d4c64b0c, sroutine_to_open_list=0x7f9980004998, flags=1024, prelocking_strategy=0x7f99d4c64ab8) at /data/src/10.3/sql/sql_base.cc:4162
#15 0x000056068fbe8824 in open_tables (thd=0x7f9980000b00, options=..., tables=0x7f99d4c64af0, counter=0x7f99d4c64b0c, flags=1024, prelocking_strategy=0x7f99d4c64ab8) at /data/src/10.3/sql/sql_base.h:253
#16 0x000056068fbec3d1 in open_tables (thd=0x7f9980000b00, tables=0x7f99d4c64af0, counter=0x7f99d4c64b0c, flags=1024) at /data/src/10.3/sql/sql_base.h:482
#17 0x000056068fcc4203 in mysqld_show_create_get_fields (thd=0x7f9980000b00, table_list=0x7f99800149e0, field_list=0x7f99d4c64dd0, buffer=0x7f99d4c64df0) at /data/src/10.3/sql/sql_show.cc:1303
#18 0x000056068fcc498e in mysqld_show_create (thd=0x7f9980000b00, table_list=0x7f99800149e0) at /data/src/10.3/sql/sql_show.cc:1409
#19 0x000056068fc2fe64 in mysql_execute_command (thd=0x7f9980000b00) at /data/src/10.3/sql/sql_parse.cc:4534
#20 0x000056068fc3b8d8 in mysql_parse (thd=0x7f9980000b00, rawbuf=0x7f9980014908 "SHOW CREATE TABLE t1", length=20, parser_state=0x7f99d4c665f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8098
#21 0x000056068fc2891a in dispatch_command (command=COM_QUERY, thd=0x7f9980000b00, packet=0x7f9980008c61 "SHOW CREATE TABLE t1", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1858
#22 0x000056068fc2733d in do_command (thd=0x7f9980000b00) at /data/src/10.3/sql/sql_parse.cc:1403
#23 0x000056068fd8f56b in do_handle_one_connection (connect=0x5606933e0900) at /data/src/10.3/sql/sql_connect.cc:1402
#24 0x000056068fd8f2e2 in handle_one_connection (arg=0x5606933e0900) at /data/src/10.3/sql/sql_connect.cc:1308
#25 0x0000560690666a8c in pfs_spawn_thread (arg=0x560693382900) at /data/src/10.3/storage/perfschema/pfs.cc:1862
#26 0x00007f99dd43d4a4 in start_thread (arg=0x7f99d4c67700) at pthread_create.c:456
#27 0x00007f99db985d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2019-09-13 ]

The attached patch fixes the issue. There is no need to add the table in fts_optimize_wq if there is
no fts indexes exist.

Comment by Marko Mäkelä [ 2019-09-17 ]

OK to push to 10.1. Please try to split the added test around an existing restart in innodb_fts.innodb_fts_misc (that is, add part of the test before an existing restart, and part of it after the restart). Server restarts can add at least a couple of seconds to the test execution time.

Generated at Thu Feb 08 08:53:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.