InnoDB: Failing assertion: fil_space_get_type(id) == FIL_TYPE_TABLESPACE in file fsp0fsp.cc line 778

Bug #1554622 reported by Ramesh Sivaraman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Invalid
Undecided
Unassigned
5.7
Fix Released
High
Laurynas Biveinis

Bug Description

** Testcase

DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@SESSION.foreign_key_checks=0;
SET expand_fast_index_creation=1;
create table t3(id int,key id (id),constraint t2_id_fk foreign key (id) references t2 (id)) engine=innodb;
CREATE TEMPORARY TABLE t1 LIKE t3;
INSERT INTO t1 VALUES(0xABE3);
ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;

** GDB info

#0 0x00007f758cdc5771 in pthread_kill () from /lib64/libpthread.so.0
#1 0x0000000001832190 in my_write_core (sig=6) at /sda/PS-5.7-GA_dbg/mysys/stacktrace.c:247
#2 0x0000000000e7389f in handle_fatal_signal (sig=6) at /sda/PS-5.7-GA_dbg/sql/signal_handler.cc:223
#3 <signal handler called>
#4 0x00007f758af515d7 in raise () from /lib64/libc.so.6
#5 0x00007f758af52cc8 in abort () from /lib64/libc.so.6
#6 0x0000000001b35073 in ut_dbg_assertion_failed (expr=0x220a3a0 "fil_space_get_type(id) == FIL_TYPE_TABLESPACE", file=0x2209cf0 "/sda/PS-5.7-GA_dbg/storage/innobase/fsp/fsp0fsp.cc", line=778) at /sda/PS-5.7-GA_dbg/storage/innobase/ut/ut0dbg.cc:67
#7 0x0000000001c2d7db in fsp_space_modify_check (id=24, mtr=0x7f758d375ef0) at /sda/PS-5.7-GA_dbg/storage/innobase/fsp/fsp0fsp.cc:778
#8 0x0000000001c2eb32 in fsp_try_extend_data_file_with_pages (space=0x7f7536811818, page_no=8, header=0x7f754b0d4026 "", mtr=0x7f758d375ef0) at /sda/PS-5.7-GA_dbg/storage/innobase/fsp/fsp0fsp.cc:1387
#9 0x0000000001c34873 in fsp_reserve_free_pages (space=0x7f7536811818, space_header=0x7f754b0d4026 "", size=8, mtr=0x7f758d375ef0, n_pages=2) at /sda/PS-5.7-GA_dbg/storage/innobase/fsp/fsp0fsp.cc:3273
#10 0x0000000001c34aa1 in fsp_reserve_free_extents (n_reserved=0x7f758d376428, space_id=24, n_ext=1, alloc_type=FSP_NORMAL, mtr=0x7f758d375ef0, n_pages=2) at /sda/PS-5.7-GA_dbg/storage/innobase/fsp/fsp0fsp.cc:3346
#11 0x0000000001b859dd in PageBulk::init (this=0x7f753688d3d8) at /sda/PS-5.7-GA_dbg/storage/innobase/btr/btr0bulk.cc:76
#12 0x0000000001b87725 in BtrBulk::insert (this=0x7f758d376c60, tuple=0x7f753693e0d8, level=0) at /sda/PS-5.7-GA_dbg/storage/innobase/btr/btr0bulk.cc:781
#13 0x0000000001a1b83e in BtrBulk::insert (this=0x7f758d376c60, tuple=0x7f753693e0d8) at /sda/PS-5.7-GA_dbg/storage/innobase/include/btr0bulk.h:309
#14 0x0000000001a48916 in row_merge_insert_index_tuples (trx_id=1296, index=0x7f753687dda0, old_table=0x7f7536893a20, fd=-1, block=0x0, row_buf=0x7f753691d440, btr_bulk=0x7f758d376c60, stage=0x0) at /sda/PS-5.7-GA_dbg/storage/innobase/row/row0merge.cc:3322
#15 0x0000000001a464f0 in row_merge_read_clustered_index (trx=0x7f7580000970, table=0x7f7536958420, old_table=0x7f7536893a20, new_table=0x7f7536893a20, online=false, index=0x7f75368377e0, fts_sort_idx=0x0, psort_info=0x0, files=0x7f753682e628, key_numbers=0x7f75368377e8, n_index=1, add_cols=0x0, add_v=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., block=0x7f75814ff000 <Address 0x7f75814ff000 out of bounds>, skip_pk_sort=false, tmpfd=0x7f758d37787c, stage=0x7f7536850178, eval_table=0x7f7536958420) at /sda/PS-5.7-GA_dbg/storage/innobase/row/row0merge.cc:2433
#16 0x0000000001a4b28b in row_merge_build_indexes (trx=0x7f7580000970, old_table=0x7f7536893a20, new_table=0x7f7536893a20, online=false, indexes=0x7f75368377e0, key_numbers=0x7f75368377e8, n_indexes=1, table=0x7f7536958420, add_cols=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=false, stage=0x7f7536850178, add_v=0x0, eval_table=0x7f7536958420) at /sda/PS-5.7-GA_dbg/storage/innobase/row/row0merge.cc:4439
#17 0x0000000001945d6b in ha_innobase::inplace_alter_table (this=0x7f75368efa30, altered_table=0x7f7536958420, ha_alter_info=0x7f758d377e00) at /sda/PS-5.7-GA_dbg/storage/innobase/handler/handler0alter.cc:6056
#18 0x00000000015a99ab in handler::ha_inplace_alter_table (this=0x7f75368efa30, altered_table=0x7f7536958420, ha_alter_info=0x7f758d377e00) at /sda/PS-5.7-GA_dbg/sql/handler.h:3486
#19 0x00000000015a4783 in restore_secondary_keys (thd=0x7f7536819000, create_info=0x7f758d379bb0, table=0x7f7536958420, alter_info=0x7f758d379ae0) at /sda/PS-5.7-GA_dbg/sql/sql_table.cc:9024
#20 0x00000000015a6aa0 in mysql_alter_table (thd=0x7f7536819000, new_db=0x7f753682bf88 "test", new_name=0x0, create_info=0x7f758d379bb0, table_list=0x7f753682ba00, alter_info=0x7f758d379ae0) at /sda/PS-5.7-GA_dbg/sql/sql_table.cc:9974
#21 0x000000000170ec29 in Sql_cmd_alter_table::execute (this=0x7f753682bf98, thd=0x7f7536819000) at /sda/PS-5.7-GA_dbg/sql/sql_alter.cc:320
#22 0x00000000015102e4 in mysql_execute_command (thd=0x7f7536819000, first_level=true) at /sda/PS-5.7-GA_dbg/sql/sql_parse.cc:5029
#23 0x00000000015122c6 in mysql_parse (thd=0x7f7536819000, parser_state=0x7f758d37b500) at /sda/PS-5.7-GA_dbg/sql/sql_parse.cc:5796
#24 0x000000000150725d in dispatch_command (thd=0x7f7536819000, com_data=0x7f758d37bc90, command=COM_QUERY) at /sda/PS-5.7-GA_dbg/sql/sql_parse.cc:1448
#25 0x0000000001506177 in do_command (thd=0x7f7536819000) at /sda/PS-5.7-GA_dbg/sql/sql_parse.cc:1011
#26 0x000000000163eea3 in handle_connection (arg=0x7f7554bffc10) at /sda/PS-5.7-GA_dbg/sql/conn_handler/connection_handler_per_thread.cc:313
#27 0x0000000001cb2920 in pfs_spawn_thread (arg=0x7f755c3f4120) at /sda/PS-5.7-GA_dbg/storage/perfschema/pfs.cc:2192
#28 0x00007f758cdc0df5 in start_thread () from /lib64/libpthread.so.0

The attached tarball (1457454574_bug_bundle.tar.gz) gives the testcase as an exact match of our system, including some handy utilities

$ vi 1457454574_mybase # STEP1: Update the base path in this file (usually the only change required!). If you use a non-binary distribution, please update SOURCE_DIR location also
$ ./1457454574_init # STEP2: Initializes the data dir
$ ./1457454574_start # STEP3: Starts mysqld
$ ./1457454574_cl # STEP4: To check mysqld is up
$ ./1457454574_run_pquery # STEP5: Run the testcase with the pquery binary
$ ./1457454574_run # OPTIONAL: Run the testcase with the mysql CLI (may not reproduce the issue, as the pquery binary was used for the original testcase reduction)
$ vi /dev/shm/1457454574/error.log.out # STEP6: Verify the error log
$ ./1457454574_gdb # OPTIONAL: Brings you to a gdb prompt with gdb attached to the used mysqld and attached to the generated core
$ ./1457454574_parse_core # OPTIONAL: Creates 1457454574_STD.gdb and 1457454574_FULL.gdb; standard and full variables gdb stack traces

Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Reduced testcase

SET expand_fast_index_creation=1;
CREATE TEMPORARY TABLE t1(id int, key id (id)) engine=innodb;
INSERT INTO t1 VALUES(0xABE3);
ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;

tags: added: expand-fast-index-creation regression
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-971

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.