Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
The patch for MDEV-23233 is already in the tree
The test case is non-deterministic, run with --repeat. Remarkably and contrary to the usual, at least on two machines it reproduces the problem significantly easier when it's run with rr.
Recommended to run with --mysqld=--performance-schema=off. It is many times faster.
The rr profile is available.
--source include/have_sequence.inc
|
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, a VARCHAR(512), KEY(a)) ENGINE=InnoDB; |
INSERT INTO t1 SELECT seq, CONCAT('seq',REPEAT(seq,100)) FROM seq_1_to_2500; |
|
--connect (con1,localhost,root,,test)
|
SET lock_wait_timeout= 1; |
--send
|
ALTER TABLE t1 ADD INDEX (a); |
|
--connection default
|
SELECT a INTO OUTFILE 'load_1' FROM t1; |
LOAD DATA INFILE 'load_1' IGNORE INTO TABLE t1 (a); |
SELECT a INTO OUTFILE 'load_2' FROM t1 ; |
LOAD DATA INFILE 'load_2' IGNORE INTO TABLE t1 (a); |
|
# Cleanup
|
--disconnect con1
|
DROP TABLE t1; |
--let $datadir= `select @@datadir`
|
--remove_file $datadir/test/load_1
|
--remove_file $datadir/test/load_2 |
10.2 3c3f172f |
#10 <signal handler called>
|
#11 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
|
#12 0x00007f2349ca342a in __GI_abort () at abort.c:89
|
#13 0x000055bcc69ff1d3 in ut_dbg_assertion_failed (expr=0x0, file=0x55bcc700c060 "/data/src/10.2/storage/innobase/btr/btr0sea.cc", line=1180) at /data/src/10.2/storage/innobase/ut/ut0dbg.cc:60
|
#14 0x000055bcc6a482c7 in btr_search_drop_page_hash_index (block=0x7f2344189900) at /data/src/10.2/storage/innobase/btr/btr0sea.cc:1180
|
#15 0x000055bcc6a65811 in buf_page_create (page_id=..., page_size=..., mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/buf/buf0buf.cc:5605
|
#16 0x000055bcc6afeca6 in fsp_page_create (space=0x7f22dc00b8c0, offset=285, page_size=..., rw_latch=RW_X_LATCH, mtr=0x7f233c05f5e0, init_mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/fsp/fsp0fsp.cc:1288
|
#17 0x000055bcc6b03105 in fseg_alloc_free_page_low (space=0x7f22dc00b8c0, page_size=..., seg_inode=0x7f23446ac0f2 "", hint=285, direction=111 'o', rw_latch=RW_X_LATCH, mtr=0x7f233c05f5e0, init_mtr=0x7f233c05f5e0, has_done_reservation=1) at /data/src/10.2/storage/innobase/fsp/fsp0fsp.cc:2581
|
#18 0x000055bcc6b0326e in fseg_alloc_free_page_general (seg_header=0x7f23446b004a "", hint=285, direction=111 'o', has_done_reservation=1, mtr=0x7f233c05f5e0, init_mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/fsp/fsp0fsp.cc:2634
|
#19 0x000055bcc6a092e0 in btr_page_alloc_low (index=0x7f22dc183770, hint_page_no=285, file_direction=111 'o', level=0, mtr=0x7f233c05f5e0, init_mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/btr/btr0btr.cc:529
|
#20 0x000055bcc6a0935c in btr_page_alloc (index=0x7f22dc183770, hint_page_no=285, file_direction=111 'o', level=0, mtr=0x7f233c05f5e0, init_mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/btr/btr0btr.cc:579
|
#21 0x000055bcc6a0f5f3 in btr_page_split_and_insert (flags=0, cursor=0x7f233c05f280, offsets=0x7f233c05f228, heap=0x7f233c05f220, tuple=0x7f22dc0545e0, n_ext=0, mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/btr/btr0btr.cc:2845
|
#22 0x000055bcc6a2f3df in btr_cur_pessimistic_insert (flags=0, cursor=0x7f233c05f280, offsets=0x7f233c05f228, heap=0x7f233c05f220, entry=0x7f22dc0545e0, rec=0x7f233c05f230, big_rec=0x7f233c05f218, n_ext=0, thr=0x7f22dc059fd0, mtr=0x7f233c05f5e0) at /data/src/10.2/storage/innobase/btr/btr0cur.cc:3437
|
#23 0x000055bcc69135a1 in row_ins_clust_index_entry_low (flags=0, mode=33, index=0x7f22dc183770, n_uniq=1, entry=0x7f22dc0545e0, n_ext=0, thr=0x7f22dc059fd0) at /data/src/10.2/storage/innobase/row/row0ins.cc:2712
|
#24 0x000055bcc69149db in row_ins_clust_index_entry (index=0x7f22dc183770, entry=0x7f22dc0545e0, thr=0x7f22dc059fd0, n_ext=0) at /data/src/10.2/storage/innobase/row/row0ins.cc:3159
|
#25 0x000055bcc6914cfb in row_ins_index_entry (index=0x7f22dc183770, entry=0x7f22dc0545e0, thr=0x7f22dc059fd0) at /data/src/10.2/storage/innobase/row/row0ins.cc:3263
|
#26 0x000055bcc691521f in row_ins_index_entry_step (node=0x7f22dc059b80, thr=0x7f22dc059fd0) at /data/src/10.2/storage/innobase/row/row0ins.cc:3414
|
#27 0x000055bcc69155f5 in row_ins (node=0x7f22dc059b80, thr=0x7f22dc059fd0) at /data/src/10.2/storage/innobase/row/row0ins.cc:3551
|
#28 0x000055bcc69159a2 in row_ins_step (thr=0x7f22dc059fd0) at /data/src/10.2/storage/innobase/row/row0ins.cc:3671
|
#29 0x000055bcc69332f6 in row_insert_for_mysql (mysql_rec=0x7f22dc0591a8 "\376\356\022", prebuilt=0x7f22dc059650) at /data/src/10.2/storage/innobase/row/row0mysql.cc:1411
|
#30 0x000055bcc67f422f in ha_innobase::write_row (this=0x7f22dc058a18, record=0x7f22dc0591a8 "\376\356\022") at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:8178
|
#31 0x000055bcc6601c26 in handler::ha_write_row (this=0x7f22dc058a18, buf=0x7f22dc0591a8 "\376\356\022") at /data/src/10.2/sql/handler.cc:6108
|
#32 0x000055bcc6357731 in write_record (thd=0x7f22dc000af0, table=0x7f22dc057e10, info=0x7f233c0604a0) at /data/src/10.2/sql/sql_insert.cc:1941
|
#33 0x000055bcc6788ab5 in read_sep_field (thd=0x7f22dc000af0, info=..., table_list=0x7f22dc0125c8, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=true) at /data/src/10.2/sql/sql_load.cc:1175
|
#34 0x000055bcc6787120 in mysql_load (thd=0x7f22dc000af0, ex=0x7f22dc012540, table_list=0x7f22dc0125c8, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_ERROR, ignore=true, read_file_from_client=false) at /data/src/10.2/sql/sql_load.cc:682
|
#35 0x000055bcc637d2c8 in mysql_execute_command (thd=0x7f22dc000af0) at /data/src/10.2/sql/sql_parse.cc:4572
|
#36 0x000055bcc63871a9 in mysql_parse (thd=0x7f22dc000af0, rawbuf=0x7f22dc012458 "LOAD DATA INFILE 'load_1' IGNORE INTO TABLE t1 (a)", length=50, parser_state=0x7f233c061610, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7733
|
#37 0x000055bcc63754d5 in dispatch_command (command=COM_QUERY, thd=0x7f22dc000af0, packet=0x7f22dc095a51 "", packet_length=50, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1824
|
#38 0x000055bcc6373f50 in do_command (thd=0x7f22dc000af0) at /data/src/10.2/sql/sql_parse.cc:1377
|
#39 0x000055bcc64c9fb1 in do_handle_one_connection (connect=0x55bcca005ec0) at /data/src/10.2/sql/sql_connect.cc:1336
|
#40 0x000055bcc64c9d1c in handle_one_connection (arg=0x55bcca005ec0) at /data/src/10.2/sql/sql_connect.cc:1241
|
#41 0x000055bcc6ce0396 in pfs_spawn_thread (arg=0x55bcc9fe3ba0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
|
#42 0x00007f234bc234a4 in start_thread (arg=0x7f233c062700) at pthread_create.c:456
|
#43 0x00007f2349d57d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Also fails on 10.3-10.4, but those branches don't have the bugfix for MDEV-23233 yet, so I don't know if it's important.
Alternative stack trace from the same test case:
10.4 423de1e5 |
#10 <signal handler called>
|
#11 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
|
#12 0x00007f05a633242a in __GI_abort () at abort.c:89
|
#13 0x0000561690fecba8 in ut_dbg_assertion_failed (expr=0x0, file=0x5616917b89b0 "/data/src/10.4/storage/innobase/btr/btr0sea.cc", line=1162) at /data/src/10.4/storage/innobase/ut/ut0dbg.cc:60
|
#14 0x0000561691052781 in btr_search_drop_page_hash_index (block=0x7f059f40c270) at /data/src/10.4/storage/innobase/btr/btr0sea.cc:1162
|
#15 0x00005616910a0ea6 in buf_LRU_free_page (bpage=0x7f059f40c270, zip=true) at /data/src/10.4/storage/innobase/buf/buf0lru.cc:1608
|
#16 0x0000561691090e08 in buf_flush_LRU_list_batch (buf_pool=0x5616940589a0, max=100, n=0x7f058adfcc20) at /data/src/10.4/storage/innobase/buf/buf0flu.cc:1621
|
#17 0x000056169109133b in buf_do_LRU_batch (buf_pool=0x5616940589a0, max=100, n=0x7f058adfcc20) at /data/src/10.4/storage/innobase/buf/buf0flu.cc:1692
|
#18 0x0000561691091bd7 in buf_flush_batch (buf_pool=0x5616940589a0, flush_type=BUF_FLUSH_LRU, min_n=100, lsn_limit=0, n=0x7f058adfcc20) at /data/src/10.4/storage/innobase/buf/buf0flu.cc:1821
|
#19 0x00005616910923e3 in buf_flush_do_batch (buf_pool=0x5616940589a0, type=BUF_FLUSH_LRU, min_n=100, lsn_limit=0, n=0x7f058adfcc20) at /data/src/10.4/storage/innobase/buf/buf0flu.cc:1982
|
#20 0x0000561691092eb9 in buf_flush_LRU_list (buf_pool=0x5616940589a0) at /data/src/10.4/storage/innobase/buf/buf0flu.cc:2245
|
#21 0x0000561691095154 in pc_flush_slot () at /data/src/10.4/storage/innobase/buf/buf0flu.cc:2765
|
#22 0x00005616910962a1 in buf_flush_page_cleaner_coordinator () at /data/src/10.4/storage/innobase/buf/buf0flu.cc:3194
|
#23 0x00007f05a82b24a4 in start_thread (arg=0x7f058adfd700) at pthread_create.c:456
|
#24 0x00007f05a63e6d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Doesn't seem to fail on 10.5.
Attachments
Issue Links
- is caused by
-
MDEV-22456 Dropping the adaptive hash index may cause DDL to lock up InnoDB
-
- Closed
-
- is duplicated by
-
MDEV-23370 innodb_fts.innodb_fts_misc failed in buildbot, server crashed in dict_table_autoinc_destroy
-
- Closed
-
- relates to
-
MDEV-23233 Race condition for btr_search_drop_page_hash_index() in buf_page_create()
-
- Closed
-
In row_merge_drop_indexes(), InnoDB have to drop the index later if the table is being
used by some other thread. In that case, InnoDB removes the index from dictionary
and frees the index pages but it maintains the index object and it doesn't
remove the respective ahi entries also. (could be related to
MDEV-22456)rw_lock_x_lock(
dict_index_get_lock(index));
dict_index_set_online_status(
index, ONLINE_INDEX_ABORTED);
index->type |= DICT_CORRUPT;
table->drop_aborted = TRUE;
goto drop_aborted;
........................
........................
.........................
drop_aborted:
rw_lock_x_unlock(dict_index_get_lock(index));
DEBUG_SYNC_C("merge_drop_index_after_abort");
/* covered by dict_sys->mutex */
MONITOR_INC(MONITOR_BACKGROUND_DROP_INDEX);
/* fall through */
case ONLINE_INDEX_ABORTED:
/* Drop the index tree from the
data dictionary and free it from
the tablespace, but keep the object
in the data dictionary cache. */
row_merge_drop_index_dict(trx, index->id);
rw_lock_x_lock(dict_index_get_lock(index));
dict_index_set_online_status(
index, ONLINE_INDEX_ABORTED_DROPPED);
rw_lock_x_unlock(dict_index_get_lock(index));
table->drop_aborted = TRUE;
continue;
This leads to assert failure when we use the existing page from buffer pool.
IMO, there is no need to check index online status in btr_search_drop_page_hash_index() and removing it completely
would make sense